Class RabbitQueueFactoryImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private com.rabbitmq.client.Connection connection  
    • Constructor Summary

      Constructors 
      Constructor Description
      RabbitQueueFactoryImpl​(com.rabbitmq.client.Connection connection)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      com.rabbitmq.client.Channel createChannel()
      This method opens a channel using the established connection to RabbitMQ.
      RabbitQueue createDefaultRabbitQueue​(String name)
      This method opens a channel using the established connection to RabbitMQ and creates a new queue using the given name and the following configuration: The channel number is automatically derived from the connection. The queue is not durable. The queue is not exclusive. The queue is configured to be deleted automatically. No additional queue configuration is defined.
      RabbitQueue createDefaultRabbitQueue​(String name, com.rabbitmq.client.Channel channel)
      This method uses the given channel and creates a new queue using the given name and the following configuration: The queue is not durable. The queue is not exclusive. The queue is configured to be deleted automatically. No additional queue configuration is defined.
      com.rabbitmq.client.Connection getConnection()
      Returns the Connection to the RabbitMQ broker used internally.
    • Field Detail

      • connection

        private final com.rabbitmq.client.Connection connection
    • Constructor Detail

      • RabbitQueueFactoryImpl

        public RabbitQueueFactoryImpl​(com.rabbitmq.client.Connection connection)
    • Method Detail

      • createDefaultRabbitQueue

        public RabbitQueue createDefaultRabbitQueue​(String name)
                                             throws IOException
        Description copied from interface: RabbitQueueFactory
        This method opens a channel using the established connection to RabbitMQ and creates a new queue using the given name and the following configuration:
        • The channel number is automatically derived from the connection.
        • The queue is not durable.
        • The queue is not exclusive.
        • The queue is configured to be deleted automatically.
        • No additional queue configuration is defined.
        Specified by:
        createDefaultRabbitQueue in interface RabbitQueueFactory
        Parameters:
        name - name of the queue
        Returns:
        RabbitQueue object comprising the Channel and the name of the created queue
        Throws:
        IOException - if a communication problem during the creation of the channel or the queue occurs
      • getConnection

        public com.rabbitmq.client.Connection getConnection()
        Description copied from interface: RabbitQueueFactory
        Returns the Connection to the RabbitMQ broker used internally.
        Specified by:
        getConnection in interface RabbitQueueFactory
        Returns:
        the Connection to the RabbitMQ broker used internally
      • createDefaultRabbitQueue

        public RabbitQueue createDefaultRabbitQueue​(String name,
                                                    com.rabbitmq.client.Channel channel)
                                             throws IOException
        Description copied from interface: RabbitQueueFactory
        This method uses the given channel and creates a new queue using the given name and the following configuration:
        • The queue is not durable.
        • The queue is not exclusive.
        • The queue is configured to be deleted automatically.
        • No additional queue configuration is defined.
        Specified by:
        createDefaultRabbitQueue in interface RabbitQueueFactory
        Parameters:
        name - name of the queue
        channel - the Channel that will be used to generate the queue
        Returns:
        RabbitQueue object comprising the Channel and the name of the created queue
        Throws:
        IOException - if a communication problem during the creation of the channel or the queue occurs
      • createChannel

        public com.rabbitmq.client.Channel createChannel()
                                                  throws IOException
        Description copied from interface: RabbitQueueFactory
        This method opens a channel using the established connection to RabbitMQ. The channel number is automatically derived from the connection.
        Specified by:
        createChannel in interface RabbitQueueFactory
        Returns:
        the newly created Channel
        Throws:
        IOException - if a communication problem during the creation of the channel