Skip to content

Commit 493e579

Browse files
authored
Merge pull request #296 from AxonIQ/enhancement/spring-config-samples
Replace @Autowired configuration samples for ConfigurerModule
2 parents b88091d + 589fd8c commit 493e579

File tree

3 files changed

+223
-154
lines changed

3 files changed

+223
-154
lines changed

axon-framework/events/event-processors/README.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,18 @@ public class AxonConfig {
175175
@Configuration
176176
public class AxonConfig {
177177
// ...
178-
@Autowired
179-
public void configureProcessingGroupErrorHandling(EventProcessingConfigurer processingConfigurer) {
180-
// To configure a default ...
181-
processingConfigurer.registerDefaultListenerInvocationErrorHandler(conf -> /* create listener error handler */)
182-
// ... or for a specific processing group:
183-
.registerListenerInvocationErrorHandler("my-processing-group", conf -> /* create listener error handler */);
178+
@Bean
179+
public ConfigurerModule processingGroupErrorHandlingConfigurerModule() {
180+
return configurer -> configurer.eventProcessing(
181+
processingConfigurer -> processingConfigurer.registerDefaultListenerInvocationErrorHandler(
182+
conf -> /* create listener error handler */
183+
)
184+
// ... or for a specific processing group:
185+
.registerListenerInvocationErrorHandler(
186+
"my-processing-group",
187+
conf -> /* create listener error handler */
188+
)
189+
);
184190
}
185191
}
186192
```
@@ -231,13 +237,16 @@ public class AxonConfig {
231237
```java
232238
@Configuration
233239
public class AxonConfig {
234-
// ...
235-
@Autowired
236-
public void configureProcessingGroupErrorHandling(EventProcessingConfigurer processingConfigurer) {
237-
// To configure a default ...
238-
processingConfigurer.registerDefaultErrorHandler(conf -> /* create error handler */)
239-
// ... or for a specific processor:
240-
.registerErrorHandler("my-processor", conf -> /* create error handler */);
240+
@Bean
241+
public ConfigurerModule processorErrorHandlingConfigurerModule() {
242+
return configurer -> configurer.eventProcessing(
243+
processingConfigurer -> processingConfigurer.registerDefaultErrorHandler(conf -> /* create error handler */)
244+
// ... or for a specific processor:
245+
.registerErrorHandler(
246+
"my-processor",
247+
conf -> /* create error handler */
248+
)
249+
);
241250
}
242251
}
243252
```

0 commit comments

Comments
 (0)