|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.amqp.rabbit.listener.BlockingQueueConsumer
public class BlockingQueueConsumer
Specialized consumer encapsulating knowledge of the broker connections and having its own lifecycle (start and stop).
Constructor Summary | |
---|---|
BlockingQueueConsumer(ConnectionFactory connectionFactory,
MessagePropertiesConverter messagePropertiesConverter,
ActiveObjectCounter<BlockingQueueConsumer> activeObjectCounter,
AcknowledgeMode acknowledgeMode,
boolean transactional,
int prefetchCount,
String... queues)
Create a consumer. |
Method Summary | |
---|---|
boolean |
commitIfNecessary(boolean locallyTransacted)
Perform a commit or message acknowledgement, as appropriate. |
com.rabbitmq.client.Channel |
getChannel()
|
String |
getConsumerTag()
|
Message |
nextMessage()
Main application-side API: wait for the next message delivery and return it. |
Message |
nextMessage(long timeout)
Main application-side API: wait for the next message delivery and return it. |
void |
rollbackOnExceptionIfNecessary(Throwable ex)
Perform a rollback, handling rollback exceptions properly. |
void |
start()
|
void |
stop()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BlockingQueueConsumer(ConnectionFactory connectionFactory, MessagePropertiesConverter messagePropertiesConverter, ActiveObjectCounter<BlockingQueueConsumer> activeObjectCounter, AcknowledgeMode acknowledgeMode, boolean transactional, int prefetchCount, String... queues)
Method Detail |
---|
public com.rabbitmq.client.Channel getChannel()
public String getConsumerTag()
public Message nextMessage() throws InterruptedException, com.rabbitmq.client.ShutdownSignalException
InterruptedException
- if an interrupt is received while waiting
com.rabbitmq.client.ShutdownSignalException
- if the connection is shut down while waitingpublic Message nextMessage(long timeout) throws InterruptedException, com.rabbitmq.client.ShutdownSignalException
timeout
- timeout in millisecond
InterruptedException
- if an interrupt is received while waiting
com.rabbitmq.client.ShutdownSignalException
- if the connection is shut down while waitingpublic void start() throws AmqpException
AmqpException
public void stop()
public String toString()
toString
in class Object
public void rollbackOnExceptionIfNecessary(Throwable ex) throws Exception
ex
- the thrown application exception or error
Exception
- in case of a rollback errorpublic boolean commitIfNecessary(boolean locallyTransacted) throws IOException
locallyTransacted
-
IOException
|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |