Class RabbitMQConsumer

java.lang.Object
org.wso2.carbon.inbound.endpoint.protocol.rabbitmq.RabbitMQConsumer
All Implemented Interfaces:
com.rabbitmq.client.Consumer

public class RabbitMQConsumer extends Object implements com.rabbitmq.client.Consumer
The actual tasks that perform message consuming
  • Constructor Details

  • Method Details

    • execute

      public void execute()
      Execute by the RabbitMQTask
    • handleConsumeOk

      public void handleConsumeOk(String consumerTag)
      Called when the consumer is registered by a call to any of the Channel.basicConsume(java.lang.String, com.rabbitmq.client.Consumer) methods.
      Specified by:
      handleConsumeOk in interface com.rabbitmq.client.Consumer
      Parameters:
      consumerTag - the consumer tag associated with the consumer
    • handleCancelOk

      public void handleCancelOk(String consumerTag)
      Called when the consumer is cancelled by a call to Channel.basicCancel(java.lang.String).
      Specified by:
      handleCancelOk in interface com.rabbitmq.client.Consumer
      Parameters:
      consumerTag - the consumer tag associated with the consumer
    • handleCancel

      public void handleCancel(String consumerTag) throws IOException
      Called when the consumer is cancelled for reasons other than by a call to Channel.basicCancel(java.lang.String). For example, the queue has been deleted. See handleCancelOk(java.lang.String) for notification of consumer cancellation due to Channel.basicCancel(java.lang.String).
      Specified by:
      handleCancel in interface com.rabbitmq.client.Consumer
      Parameters:
      consumerTag - the consumer tag associated with the consumer
      Throws:
      IOException
    • handleShutdownSignal

      public void handleShutdownSignal(String consumerTag, com.rabbitmq.client.ShutdownSignalException signal)
      Called when either the channel or the underlying connection has been shut down.
      Specified by:
      handleShutdownSignal in interface com.rabbitmq.client.Consumer
      Parameters:
      consumerTag - the consumer tag associated with the consumer
      signal - a ShutdownSignalException indicating the reason for the shut down
    • handleRecoverOk

      public void handleRecoverOk(String consumerTag)
      Called when a basic.recover-ok is received in reply to a basic.recover. All messages received before this is invoked that haven't been ack'ed will be re-delivered. All messages received afterwards won't be.
      Specified by:
      handleRecoverOk in interface com.rabbitmq.client.Consumer
      Parameters:
      consumerTag - the consumer tag associated with the consumer
    • handleDelivery

      public void handleDelivery(String consumerTag, com.rabbitmq.client.Envelope envelope, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body) throws IOException
      Called when a basic.deliver is received for this consumer.
      Specified by:
      handleDelivery in interface com.rabbitmq.client.Consumer
      Parameters:
      consumerTag - the consumer tag associated with the consumer
      envelope - packaging data for the message
      properties - content header data for the message
      body - the message body (opaque, client-specific byte array)
      Throws:
      IOException - if the consumer encounters an I/O error while processing the message
      See Also:
      • Envelope
    • close

      public void close()
      Return connection back to the pool when undeploying the listener proxy
    • getInboundName

      public String getInboundName()
    • setInboundName

      public void setInboundName(String inboundName)