chibenwa commented on code in PR #2414:
URL: https://github.com/apache/james-project/pull/2414#discussion_r1766769631
##########
mailet/amqp/src/main/java/org/apache/james/transport/mailets/AmqpForwardAttribute.java:
##########
@@ -154,7 +156,13 @@ public void init() throws MailetException {
.map(type ->
ExchangeSpecification.exchange(exchange).type(type))
.orElse(ExchangeSpecification.exchange(exchange));
- sender.declareExchange(exchangeSpecification).block();
+ sender.declareExchange(exchangeSpecification)
+ .onErrorResume(error -> error instanceof
ShutdownSignalException && error.getMessage().contains("reply-code=406,
reply-text=PRECONDITION_FAILED"),
+ error -> {
+ LOGGER.warn("Exchange `{}` already exists but with
different configuration. Ignoring this error. \nError message: {}", exchange,
error.getMessage());
+ return Mono.empty();
+ })
Review Comment:
Please have it tested:
- create an exchange with different settings
- Start the mailet (throwns the exception here)
- And process a mail and ensure the mail gets well processed
On principle looks great in practice last time I tried the entire session
was F... up... So I want to see it running before approving it...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]