public abstract class QueueConsumer
extends com.rabbitmq.client.DefaultConsumer
| Constructor and Description |
|---|
QueueConsumer(String queueName,
com.rabbitmq.client.Channel channel,
ConsumerRegistry registry) |
| Modifier and Type | Method and Description |
|---|---|
long |
getLastUsed() |
String |
getQueueName() |
String |
getRegisteredConsumerTag() |
void |
handleCancel(String consumerTag) |
void |
handleCancelOk(String consumerTag) |
void |
handleConsumeOk(String consumerTag) |
void |
handleDelivery(String consumerTag,
com.rabbitmq.client.Envelope env,
com.rabbitmq.client.AMQP.BasicProperties props,
byte[] body) |
void |
handleShutdownSignal(String consumerTag,
com.rabbitmq.client.ShutdownSignalException e) |
void |
setRegisteredConsumerTag(String consumerTag) |
void |
setUnregistering() |
abstract void |
simpleHandle(String body)
This method processes the message which comes from rabbitMQ and contains the business logic for each consumer.
|
public QueueConsumer(String queueName, com.rabbitmq.client.Channel channel, ConsumerRegistry registry)
public abstract void simpleHandle(String body) throws IOException
In case that any exception is thrown within this message, the corresponding message will NOT be acknowledged in rabbitMQ
and therefore simpleHandle(String) will be called with the same message again.
Only in case that the exception is a JsonMappingException, the message will be acknowledge in rabbitMQ and will
not processed again.
body - The pure message in json format which comes from rabbitMQIOException - An exception which causes that the message will NOT be acknowledge in rabbitMQpublic String getQueueName()
public String getRegisteredConsumerTag()
public void setRegisteredConsumerTag(String consumerTag)
public void setUnregistering()
public long getLastUsed()
public void handleDelivery(String consumerTag, com.rabbitmq.client.Envelope env, com.rabbitmq.client.AMQP.BasicProperties props, byte[] body) throws IOException
handleDelivery in interface com.rabbitmq.client.ConsumerhandleDelivery in class com.rabbitmq.client.DefaultConsumerIOExceptionpublic void handleConsumeOk(String consumerTag)
handleConsumeOk in interface com.rabbitmq.client.ConsumerhandleConsumeOk in class com.rabbitmq.client.DefaultConsumerpublic void handleCancelOk(String consumerTag)
handleCancelOk in interface com.rabbitmq.client.ConsumerhandleCancelOk in class com.rabbitmq.client.DefaultConsumerpublic void handleCancel(String consumerTag)
handleCancel in interface com.rabbitmq.client.ConsumerhandleCancel in class com.rabbitmq.client.DefaultConsumerpublic void handleShutdownSignal(String consumerTag, com.rabbitmq.client.ShutdownSignalException e)
handleShutdownSignal in interface com.rabbitmq.client.ConsumerhandleShutdownSignal in class com.rabbitmq.client.DefaultConsumerCopyright © 2020 LeanIX GmbH. All rights reserved.