public class RabbitMQConsumer extends Object implements com.rabbitmq.client.Consumer
Constructor and Description |
---|
RabbitMQConsumer(RabbitMQConnectionFactory rabbitMQConnectionFactory,
Properties properties,
RabbitMQInjectHandler injectHandler) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Return connection back to the pool when undeploying the listener proxy
|
void |
execute()
Execute by the
RabbitMQTask |
String |
getInboundName() |
void |
handleCancel(String consumerTag)
Called when the consumer is cancelled for reasons other than by a call to
Channel.basicCancel(java.lang.String) . |
void |
handleCancelOk(String consumerTag)
Called when the consumer is cancelled by a call to
Channel.basicCancel(java.lang.String) . |
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. |
void |
handleDelivery(String consumerTag,
com.rabbitmq.client.Envelope envelope,
com.rabbitmq.client.AMQP.BasicProperties properties,
byte[] body)
Called when a basic.deliver is received for this consumer.
|
void |
handleRecoverOk(String consumerTag)
Called when a basic.recover-ok is received in reply to a basic.recover.
|
void |
handleShutdownSignal(String consumerTag,
com.rabbitmq.client.ShutdownSignalException signal)
Called when either the channel or the underlying connection has been shut down.
|
void |
setInboundName(String inboundName) |
public RabbitMQConsumer(RabbitMQConnectionFactory rabbitMQConnectionFactory, Properties properties, RabbitMQInjectHandler injectHandler)
public void execute()
RabbitMQTask
public void handleConsumeOk(String consumerTag)
Channel.basicConsume(java.lang.String, com.rabbitmq.client.Consumer)
methods.handleConsumeOk
in interface com.rabbitmq.client.Consumer
consumerTag
- the consumer tag associated with the consumerpublic void handleCancelOk(String consumerTag)
Channel.basicCancel(java.lang.String)
.handleCancelOk
in interface com.rabbitmq.client.Consumer
consumerTag
- the consumer tag associated with the consumerpublic void handleCancel(String consumerTag) throws IOException
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)
.handleCancel
in interface com.rabbitmq.client.Consumer
consumerTag
- the consumer tag associated with the consumerIOException
public void handleShutdownSignal(String consumerTag, com.rabbitmq.client.ShutdownSignalException signal)
handleShutdownSignal
in interface com.rabbitmq.client.Consumer
consumerTag
- the consumer tag associated with the consumersignal
- a ShutdownSignalException
indicating the reason for the shut downpublic void handleRecoverOk(String consumerTag)
handleRecoverOk
in interface com.rabbitmq.client.Consumer
consumerTag
- the consumer tag associated with the consumerpublic void handleDelivery(String consumerTag, com.rabbitmq.client.Envelope envelope, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body) throws IOException
handleDelivery
in interface com.rabbitmq.client.Consumer
consumerTag
- the consumer tag associated with the consumerenvelope
- packaging data for the messageproperties
- content header data for the messagebody
- the message body (opaque, client-specific byte array)IOException
- if the consumer encounters an I/O error while processing the messageEnvelope
public void close()
public String getInboundName()
public void setInboundName(String inboundName)
Copyright © 2020 WSO2. All rights reserved.