Class BasicConsumer

java.lang.Object
com.adaptris.core.AdaptrisMessageWorkerImp
com.adaptris.core.AdaptrisMessageConsumerImp
interlok.rabbitmq.BasicConsumer
All Implemented Interfaces:
com.adaptris.core.AdaptrisComponent, com.adaptris.core.AdaptrisMessageConsumer, com.adaptris.core.AdaptrisMessageWorker, com.adaptris.core.ComponentLifecycle, com.adaptris.core.ComponentLifecycleExtension, com.adaptris.core.MessageEventGenerator, com.adaptris.core.StateManagedComponent

@ComponentProfile(summary="Basic consumer for RabbitMQ", recommended=RabbitMqConnection.class, tag="amqp, rabbitmq", since="4.3.0") public class BasicConsumer extends com.adaptris.core.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.

  • Constructor Details

    • BasicConsumer

      public BasicConsumer()
  • Method Details

    • prepare

      public void prepare() throws com.adaptris.core.CoreException
      Throws:
      com.adaptris.core.CoreException
    • start

      public void start() throws com.adaptris.core.CoreException
      Throws:
      com.adaptris.core.CoreException
    • stop

      public void stop()
    • withQueue

      public BasicConsumer withQueue(String s)
    • consumeLocationKey

      public String consumeLocationKey()
    • newThreadName

      protected String newThreadName()
      Overrides:
      newThreadName in class com.adaptris.core.AdaptrisMessageConsumerImp
    • withEnvelopeHandler

      public BasicConsumer withEnvelopeHandler(Translator.EnvelopeHandler h)
    • withPropertiesHandler

      public BasicConsumer withPropertiesHandler(Translator.BasicPropertiesHandler h)
    • getQueue

      public String getQueue()
      The queue to consume from.
    • setQueue

      public void setQueue(String queue)
      The queue to consume from.
    • getEnvelopeHandler

      public Translator.EnvelopeHandler getEnvelopeHandler()
      How to handle the Delivery#getEnvelope().

      If not explicitly configured, then the envelope associated with the incoming message is ignored.

    • setEnvelopeHandler

      public void setEnvelopeHandler(Translator.EnvelopeHandler envelopeHandler)
      How to handle the Delivery#getEnvelope().

      If not explicitly configured, then the envelope associated with the incoming message is ignored.

    • getPropertiesHandler

      public Translator.BasicPropertiesHandler getPropertiesHandler()
      How to handle the Delivery#getProperties().

      If not explicitly configured, then any properties associated with the incoming message are ignored

    • setPropertiesHandler

      public void setPropertiesHandler(Translator.BasicPropertiesHandler propertiesHandler)
      How to handle the Delivery#getProperties().

      If not explicitly configured, then any properties associated with the incoming message are ignored