Class RabbitMQConsumer

  • All Implemented Interfaces:
    MessageConsumer

    public class RabbitMQConsumer
    extends Object
    implements MessageConsumer
    The message consumer responsible for read a message from the queue and set it into the message context
    • Constructor Detail

      • RabbitMQConsumer

        public RabbitMQConsumer​(RabbitMQStore store)
    • Method Detail

      • ack

        public boolean ack()
        Acknowledge the message upon successful backend invocation
        Specified by:
        ack in interface MessageConsumer
        Returns:
        whether message is successfully acknowledge or not
      • cleanup

        public boolean cleanup()
        Cleanup the Connection and it's related resources
        Specified by:
        cleanup in interface MessageConsumer
        Returns:
        whether cleanup successful or not
      • isAlive

        public boolean isAlive()
        Check availability of connectivity with the message store
        Specified by:
        isAlive in interface MessageConsumer
        Returns:
        true if connection available, false otherwise.
      • setAlive

        public void setAlive​(boolean isAlive)
        Set availability of connectivity with the message store
        Specified by:
        setAlive in interface MessageConsumer
        Parameters:
        isAlive - connection availability.
      • getId

        public String getId()
        Get ID of this RabbitMQ consumer
        Specified by:
        getId in interface MessageConsumer
        Returns:
        the ID
      • setId

        public void setId​(int id)
        Set ID of this RabbitMQ consumer
        Specified by:
        setId in interface MessageConsumer
        Parameters:
        id - ID
      • setConnection

        public void setConnection​(com.rabbitmq.client.Connection connection)
        Set the Connection object
        Parameters:
        connection - a Connection object
      • setChannel

        public void setChannel​(com.rabbitmq.client.Channel channel)
        Set the Channel object
        Parameters:
        channel - a Channel object
      • setQueueName

        public void setQueueName​(String queueName)
        Set the queue name
        Parameters:
        queueName - the queue name