Package interlok.rabbitmq
Class BasicConsumer
java.lang.Object
com.adaptris.core.AdaptrisMessageWorkerImp
com.adaptris.core.AdaptrisMessageConsumerImp
interlok.rabbitmq.BasicConsumer
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisMessageConsumer,AdaptrisMessageWorker,ComponentLifecycle,ComponentLifecycleExtension,MessageEventGenerator,StateManagedComponent
@ComponentProfile(summary="Basic consumer for RabbitMQ",
recommended=RabbitMqConnection.class,
tag="amqp, rabbitmq",
since="4.3.0")
public class BasicConsumer
extends AdaptrisMessageConsumerImp
Connects to a RabbitMQ Queue and consumes messages.
This is the simplest way to consume a message from RabbitMQ.
Any BasicProperties will be copied as metadata based on the Translator.BasicPropertiesBuilder implementation specified. The default
is always to ignore incoming properties.
-
Field Summary
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionHow to handle theDelivery#getEnvelope().How to handle theDelivery#getProperties().getQueue()The queue to consume from.protected Stringvoidprepare()voidsetEnvelopeHandler(Translator.EnvelopeHandler envelopeHandler) How to handle theDelivery#getEnvelope().voidsetPropertiesHandler(Translator.BasicPropertiesHandler propertiesHandler) How to handle theDelivery#getProperties().voidThe queue to consume from.voidstart()voidstop()Methods inherited from class com.adaptris.core.AdaptrisMessageConsumerImp
changeState, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentStateMethods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueIDMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueIdMethods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactoryMethods inherited from interface com.adaptris.core.ComponentLifecycle
close, initMethods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Constructor Details
-
BasicConsumer
public BasicConsumer()
-
-
Method Details
-
prepare
- Throws:
CoreException
-
start
- Throws:
CoreException
-
stop
public void stop() -
withQueue
-
consumeLocationKey
-
newThreadName
- Overrides:
newThreadNamein classAdaptrisMessageConsumerImp
-
withEnvelopeHandler
-
withPropertiesHandler
-
getQueue
The queue to consume from. -
setQueue
The queue to consume from. -
getEnvelopeHandler
How to handle theDelivery#getEnvelope().If not explicitly configured, then the envelope associated with the incoming message is ignored.
-
setEnvelopeHandler
How to handle theDelivery#getEnvelope().If not explicitly configured, then the envelope associated with the incoming message is ignored.
-
getPropertiesHandler
How to handle theDelivery#getProperties().If not explicitly configured, then any properties associated with the incoming message are ignored
-
setPropertiesHandler
How to handle theDelivery#getProperties().If not explicitly configured, then any properties associated with the incoming message are ignored
-