public class QueueingConsumerBasedImpl extends com.rabbitmq.client.QueueingConsumer implements MessageConsumer
| Modifier and Type | Class and Description |
|---|---|
static class |
QueueingConsumerBasedImpl.Builder |
protected class |
QueueingConsumerBasedImpl.MsgReceivingTask |
| Modifier and Type | Field and Description |
|---|---|
private int |
errorCount |
private ExecutorService |
executor |
private static org.slf4j.Logger |
LOGGER |
private static int |
MAX_MESSAGE_BUFFER_SIZE |
private String |
name |
private boolean |
oldFormatWarningPrinted |
protected RabbitQueue |
queue |
protected DataReceiver |
receiver
The
DataReceiver which is using this consumer. |
private TerminatableRunnable |
receiverTask |
private Thread |
receiverThread |
protected Map<String,DataReceiveState> |
streamStats |
| Constructor and Description |
|---|
QueueingConsumerBasedImpl(DataReceiver receiver,
RabbitQueue queue,
int maxParallelProcessedMsgs) |
QueueingConsumerBasedImpl(DataReceiver receiver,
RabbitQueue queue,
int maxParallelProcessedMsgs,
String name) |
| Modifier and Type | Method and Description |
|---|---|
static QueueingConsumerBasedImpl.Builder |
builder() |
protected TerminatableRunnable |
buildMsgReceivingTask(com.rabbitmq.client.QueueingConsumer consumer)
This factory method creates a runnable task that uses the given consumer to
receive incoming messages.
|
void |
close() |
void |
finishProcessing() |
int |
getErrorCount() |
int |
getOpenStreamCount() |
protected boolean |
handleMessage(com.rabbitmq.client.AMQP.BasicProperties properties,
byte[] body) |
protected boolean |
handleSimpleMessage(byte[] body) |
void |
increaseErrorCount() |
protected void |
processMessageData(byte[] messageData,
DataReceiveState state) |
void |
waitForTermination() |
handleCancel, handleDelivery, handleShutdownSignal, nextDelivery, nextDeliverygetChannel, getConsumerTag, handleCancelOk, handleConsumeOk, handleRecoverOkprivate static final org.slf4j.Logger LOGGER
private static final int MAX_MESSAGE_BUFFER_SIZE
protected DataReceiver receiver
DataReceiver which is using this consumer.private ExecutorService executor
protected Map<String,DataReceiveState> streamStats
protected RabbitQueue queue
private int errorCount
private TerminatableRunnable receiverTask
private Thread receiverThread
private boolean oldFormatWarningPrinted
private String name
public QueueingConsumerBasedImpl(DataReceiver receiver, RabbitQueue queue, int maxParallelProcessedMsgs)
public QueueingConsumerBasedImpl(DataReceiver receiver, RabbitQueue queue, int maxParallelProcessedMsgs, String name)
protected boolean handleMessage(com.rabbitmq.client.AMQP.BasicProperties properties,
byte[] body)
throws IOException
IOExceptionprotected boolean handleSimpleMessage(byte[] body)
throws IOException
properties - body - IOExceptionprotected void processMessageData(byte[] messageData,
DataReceiveState state)
public int getOpenStreamCount()
getOpenStreamCount in interface MessageConsumerpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void waitForTermination()
waitForTermination in interface MessageConsumerpublic void finishProcessing()
throws InterruptedException
finishProcessing in interface MessageConsumerInterruptedExceptionpublic void increaseErrorCount()
public int getErrorCount()
protected TerminatableRunnable buildMsgReceivingTask(com.rabbitmq.client.QueueingConsumer consumer)
consumer - the consumer that can be used to receive messagespublic static QueueingConsumerBasedImpl.Builder builder()
Copyright © 2017–2018. All rights reserved.