Class RabbitAccessor

    • Field Detail

      • logger

        protected final Log logger
        Logger available to subclasses.
    • Constructor Detail

      • RabbitAccessor

        public RabbitAccessor()
    • Method Detail

      • isChannelTransacted

        public boolean isChannelTransacted()
      • setChannelTransacted

        public void setChannelTransacted​(boolean transactional)
        Flag to indicate that channels created by this component will be transactional.
        Parameters:
        transactional - the flag value to set
      • setConnectionFactory

        public void setConnectionFactory​(ConnectionFactory connectionFactory)
        Set the ConnectionFactory to use for obtaining RabbitMQ Connections.
        Parameters:
        connectionFactory - The connection factory.
      • getConnectionFactory

        public ConnectionFactory getConnectionFactory()
        Returns:
        The ConnectionFactory that this accessor uses for obtaining RabbitMQ Connections.
      • createConnection

        protected Connection createConnection()
        Create a RabbitMQ Connection via this template's ConnectionFactory and its host and port values.
        Returns:
        the new RabbitMQ Connection
        See Also:
        ConnectionFactory.createConnection()
      • getConnection

        @Nullable
        protected Connection getConnection​(RabbitResourceHolder holder)
        Fetch an appropriate Connection from the given RabbitResourceHolder.
        Parameters:
        holder - the RabbitResourceHolder
        Returns:
        an appropriate Connection fetched from the holder, or null if none found
      • getChannel

        @Nullable
        protected com.rabbitmq.client.Channel getChannel​(RabbitResourceHolder holder)
        Fetch an appropriate Channel from the given RabbitResourceHolder.
        Parameters:
        holder - the RabbitResourceHolder
        Returns:
        an appropriate Channel fetched from the holder, or null if none found
      • convertRabbitAccessException

        protected java.lang.RuntimeException convertRabbitAccessException​(java.lang.Exception ex)