Class RepublishMessageRecovererWithConfirms

java.lang.Object
org.springframework.amqp.rabbit.retry.RepublishMessageRecoverer
org.springframework.amqp.rabbit.retry.RepublishMessageRecovererWithConfirms
All Implemented Interfaces:
MessageRecoverer

public class RepublishMessageRecovererWithConfirms extends RepublishMessageRecoverer
A RepublishMessageRecoverer supporting publisher confirms and returns.
Since:
2.3.3
Author:
Gary Russell
  • Constructor Details

    • RepublishMessageRecovererWithConfirms

      public RepublishMessageRecovererWithConfirms(RabbitTemplate errorTemplate, CachingConnectionFactory.ConfirmType confirmType)
      Use the supplied template to publish the messsage with the provided confirm type. The template and its connection factory must be suitably configured to support the confirm type.
      Parameters:
      errorTemplate - the template.
      confirmType - the confirmType.
    • RepublishMessageRecovererWithConfirms

      public RepublishMessageRecovererWithConfirms(RabbitTemplate errorTemplate, String errorExchange, CachingConnectionFactory.ConfirmType confirmType)
      Use the supplied template to publish the messsage with the provided confirm type to the provided exchange with the default routing key. The template and its connection factory must be suitably configured to support the confirm type.
      Parameters:
      errorTemplate - the template.
      confirmType - the confirmType.
      errorExchange - the exchange.
    • RepublishMessageRecovererWithConfirms

      public RepublishMessageRecovererWithConfirms(RabbitTemplate errorTemplate, String errorExchange, String errorRoutingKey, CachingConnectionFactory.ConfirmType confirmType)
      Use the supplied template to publish the messsage with the provided confirm type to the provided exchange with the provided routing key. The template and its connection factory must be suitably configured to support the confirm type.
      Parameters:
      errorTemplate - the template.
      confirmType - the confirmType.
      errorExchange - the exchange.
      errorRoutingKey - the routing key.
  • Method Details

    • setConfirmTimeout

      public void setConfirmTimeout(long confirmTimeout)
      Set the confirm timeout; default 10 seconds.
      Parameters:
      confirmTimeout - the timeout.
    • doSend

      protected void doSend(@Nullable String exchange, String routingKey, Message message)
      Description copied from class: RepublishMessageRecoverer
      Send the message.
      Overrides:
      doSend in class RepublishMessageRecoverer
      Parameters:
      exchange - the exchange or null to use the template's default.
      routingKey - the routing key.
      message - the message.