|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.rabbitmq.client.DefaultConsumer
com.rabbitmq.client.QueueingConsumer
public class QueueingConsumer
Convenience class: an implementation of Consumer with straightforward blocking semantics
| Nested Class Summary | |
|---|---|
static class |
QueueingConsumer.Delivery
Encapsulates an arbitrary message - simple "bean" holder structure. |
| Field Summary | |
|---|---|
java.util.concurrent.BlockingQueue<ValueOrException<QueueingConsumer.Delivery,ShutdownSignalException>> |
_queue
|
| Constructor Summary | |
|---|---|
QueueingConsumer(Channel ch)
|
|
QueueingConsumer(Channel ch,
java.util.concurrent.BlockingQueue<ValueOrException<QueueingConsumer.Delivery,ShutdownSignalException>> q)
|
|
| Method Summary | |
|---|---|
java.util.concurrent.BlockingQueue<ValueOrException<QueueingConsumer.Delivery,ShutdownSignalException>> |
getQueue()
Retrieve the underlying blocking queue. |
void |
handleDelivery(java.lang.String consumerTag,
Envelope envelope,
AMQP.BasicProperties properties,
byte[] body)
No-op implementation of Consumer.handleDelivery(java.lang.String, com.rabbitmq.client.Envelope, com.rabbitmq.client.AMQP.BasicProperties, byte[]). |
void |
handleShutdownSignal(java.lang.String consumerTag,
ShutdownSignalException sig)
No-op implementation of Consumer.handleShutdownSignal(java.lang.String, com.rabbitmq.client.ShutdownSignalException). |
QueueingConsumer.Delivery |
nextDelivery()
Main application-side API: wait for the next message delivery and return it. |
QueueingConsumer.Delivery |
nextDelivery(long timeout)
Main application-side API: wait for the next message delivery and return it. |
| Methods inherited from class com.rabbitmq.client.DefaultConsumer |
|---|
getChannel, getConsumerTag, handleCancelOk, handleConsumeOk |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.util.concurrent.BlockingQueue<ValueOrException<QueueingConsumer.Delivery,ShutdownSignalException>> _queue
| Constructor Detail |
|---|
public QueueingConsumer(Channel ch)
public QueueingConsumer(Channel ch,
java.util.concurrent.BlockingQueue<ValueOrException<QueueingConsumer.Delivery,ShutdownSignalException>> q)
| Method Detail |
|---|
public void handleShutdownSignal(java.lang.String consumerTag,
ShutdownSignalException sig)
DefaultConsumerConsumer.handleShutdownSignal(java.lang.String, com.rabbitmq.client.ShutdownSignalException).
handleShutdownSignal in interface ConsumerhandleShutdownSignal in class DefaultConsumerconsumerTag - the defined consumerTag (either client- or server-generated)sig - an exception object encapsulating the reason for shutdown
public void handleDelivery(java.lang.String consumerTag,
Envelope envelope,
AMQP.BasicProperties properties,
byte[] body)
throws java.io.IOException
DefaultConsumerConsumer.handleDelivery(java.lang.String, com.rabbitmq.client.Envelope, com.rabbitmq.client.AMQP.BasicProperties, byte[]).
handleDelivery in interface ConsumerhandleDelivery in class DefaultConsumerconsumerTag - the defined consumerTag (either client- or server-generated)envelope - packaging data for the messageproperties - content header data for the messagebody - the message body (opaque client-specific byte array)
java.io.IOException - if the consumer hits an I/O error while processing the message
public QueueingConsumer.Delivery nextDelivery()
throws java.lang.InterruptedException,
ShutdownSignalException
java.lang.InterruptedException - if an interrupt is received while waiting
ShutdownSignalException - if the connection is shut down while waiting
public QueueingConsumer.Delivery nextDelivery(long timeout)
throws java.lang.InterruptedException,
ShutdownSignalException
timeout - timeout in millisecond
java.lang.InterruptedException - if an interrupt is received while waiting
ShutdownSignalException - if the connection is shut down while waitingpublic java.util.concurrent.BlockingQueue<ValueOrException<QueueingConsumer.Delivery,ShutdownSignalException>> getQueue()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||