Skip to content

Commit

Permalink
lower number of retries if there is an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
david-blasby committed Jan 27, 2025
1 parent abc6350 commit f9b1c3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public ActiveMQConnectionFactory connectionFactory() {
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
factory.setBrokerURL(brokerUrl);
org.apache.activemq.RedeliveryPolicy redeliveryPolicy = factory.getRedeliveryPolicy();
redeliveryPolicy.setMaximumRedeliveries(3);
redeliveryPolicy.setMaximumRedeliveries(1);
redeliveryPolicy.setRedeliveryDelay(3000);
redeliveryPolicy.setInitialRedeliveryDelay(3000);
redeliveryPolicy.setMaximumRedeliveryDelay(5000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void createEventProcessingLoop(SpringRouteBuilder routeBuilder,
JacksonDataFormat jsonDefHarvesterConfig = new JacksonDataFormat(Event.class);

routeBuilder.errorHandler(routeBuilder.transactionErrorHandler()
.maximumRedeliveries(2)
.maximumRedeliveries(1)
.redeliveryDelay(1000));

routeBuilder.onException().onExceptionOccurred(new Processor() {
Expand All @@ -91,7 +91,7 @@ public void process(Exchange exchange) throws Exception {
logger.error("exception occurred", ex);
}
})
.bean(DatabaseUpdateService.class, "errorOccurred", BeanScope.Request).maximumRedeliveries(2)
.bean(DatabaseUpdateService.class, "errorOccurred", BeanScope.Request).maximumRedeliveries(1)
;

ChoiceDefinition choice = routeBuilder
Expand Down

0 comments on commit f9b1c3b

Please sign in to comment.