1

I'm currently working with Spring AMQP version 1.3.6.RELEASE and Spring Retry 1.1.2.RELEASE. According to the Spring AMQP documentation section 3.3.1 one can add retry capabilities by passing in a RetryTemplate.

Are there any existing capabilities to provide a RecoveryCallback<T> implementation? I was reviewing the RabbitTemplate.java implementation and I couldn't find any.

The use case I'm considering is that if a *Send() execution fails because the broker is down I'd like to implement my own custom logic.

I understand that I could wrap the convertAndSend() call in my own RetryTemplate implementation and implement a try { ... } catch (AmqpException e) { ... } but I did not want to go down that road if Spring AMQP provided a cleaner implementation.

Centinul
  • 874
  • 3
  • 10
  • 18

1 Answers1

0

You are correct: there is no such an ability right now.

Feel free to raise a JIRA issue and we'll address it soon.

Thanks.

And I think you go right way with a workaround: you really just use your own RetryTemplate instance with raw RabbitTemplate.convertAndSend invocation in the doWithRetry inline implementation.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118