Skip to content

Commit 7a4d7cc

Browse files
authored
Merge pull request #107 from reactive-commons/feature/docs-update
docs(wildcard): Update documentation with changes in retries and wildcards
2 parents 4449ad1 + 4472223 commit 7a4d7cc

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

docs/docs/reactive-commons-eda/4-configuration-properties.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ app:
1313
async:
1414
app: # this is the name of the default domain
1515
withDLQRetry: false # if you want to have dlq queues with retries you can set it to true, you cannot change it after queues are created, because you will get an error, so you should delete topology before the change.
16-
maxRetries: 10 # max message retries, used when withDLQRetry is enabled
17-
retryDelay: 1000 # interval for message retries, used when withDLQRetry is enabled
16+
maxRetries: -1 # -1 will be considered default value. When withDLQRetry is true, it will be retried 10 times. When withDLQRetry is false, it will be retried indefinitely.
17+
retryDelay: 1000 # interval for message retries, with and without DLQRetry
1818
listenReplies: true # if you will not use ReqReply patter you can set it to false
1919
createTopology: true # if your organization have restricctions with automatic topology creation you can set it to false and create it manually or by your organization process.
2020
delayedCommands: false # Enable to send a delayed command to an external target

docs/docs/reactive-commons/6-handling-domain-events.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ public class DynamicSubscriber {
9494
}
9595
```
9696

97-
The conditions for a success dynamic registry functionallity are:
97+
The conditions for a success dynamic registry functionality are:
9898

9999
- You should handle dynamic events with specific wildcard
100+
100101
```java
101102
@Configuration
102103
public class HandlerRegistryConfiguration {
@@ -109,12 +110,30 @@ public class HandlerRegistryConfiguration {
109110
}
110111
```
111112

112-
- Start a listener dinamically through
113+
- Start a listener dynamically through
113114

114115
```java
115116
registry.startListeningEvent("purchase.cancelled");
116117
```
117118

119+
You also can listen with * wildcard or # wildcard, the * wildcard is for a single word and # wildcard is for multiple words, for example:
120+
121+
`animals.*` will listen to `animals.dog`, `animals.cat`, `animals.bird`, etc.
122+
`animals.#` will listen to `animals.dog`, `animals.dog.bark`, `animals.cat`, `animals.cat.meow`, etc.
123+
124+
```java
125+
@Configuration
126+
public class HandlerRegistryConfiguration {
127+
128+
@Bean
129+
public HandlerRegistry handlerRegistry(EventsHandler events) {
130+
return HandlerRegistry.register()
131+
.listenEvent("animals.*", events::handleEventA, Object.class/*change for proper model*/)
132+
.listenEvent("pets.#.any", events::handleEventA, Object.class/*change for proper model*/);
133+
}
134+
}
135+
```
136+
118137
## Example
119138

120139
You can see a real example at [samples/async/async-receiver-responder](https://github.com/reactive-commons/reactive-commons-java/tree/master/samples/async/async-receiver-responder)

docs/docs/reactive-commons/9-configuration-properties.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ This can be done by Spring Boot `application.yaml` or by overriding the [AsyncPr
1212
app:
1313
async:
1414
withDLQRetry: false # if you want to have dlq queues with retries you can set it to true, you cannot change it after queues are created, because you will get an error, so you should delete topology before the change.
15-
maxRetries: 10 # max message retries, used when withDLQRetry is enabled
16-
withDLQRetry: 1000 # interval for message retries, used when withDLQRetry is enabled
15+
maxRetries: -1 # -1 will be considered default value. When withDLQRetry is true, it will be retried 10 times. When withDLQRetry is false, it will be retried indefinitely.
16+
retryDelay: 1000 # interval for message retries, with and without DLQRetry
1717
listenReplies: true # if you will not use ReqReply patter you can set it to false
1818
createTopology: true # if your organization have restricctions with automatic topology creation you can set it to false and create it manually or by your organization process.
1919
delayedCommands: false # Enable to send a delayed command to an external target

0 commit comments

Comments
 (0)