Class ChannelInitializer

  • All Implemented Interfaces:
    io.micronaut.context.event.BeanCreatedEventListener<ChannelPool>, java.util.EventListener

    public abstract class ChannelInitializer
    extends java.lang.Object
    implements io.micronaut.context.event.BeanCreatedEventListener<ChannelPool>
    A base class to extend from to do initialization work with a channel before any consumers or producers are created.
    Since:
    1.1.0
    • Constructor Detail

      • ChannelInitializer

        public ChannelInitializer()
    • Method Detail

      • initialize

        @Deprecated
        public void initialize​(com.rabbitmq.client.Channel channel)
                        throws java.io.IOException
        Deprecated.
        Do any work with a channel.
        Parameters:
        channel - The channel to use
        Throws:
        java.io.IOException - If any error occurs
      • initialize

        public void initialize​(com.rabbitmq.client.Channel channel,
                               java.lang.String name)
                        throws java.io.IOException
        Do any work with a channel.
        Parameters:
        channel - The channel to use
        name - The name of the channel pool, like configured under `rabbitmq.servers`
        Throws:
        java.io.IOException - If any error occurs
      • onCreated

        public ChannelPool onCreated​(io.micronaut.context.event.BeanCreatedEvent<ChannelPool> event)
        Specified by:
        onCreated in interface io.micronaut.context.event.BeanCreatedEventListener<ChannelPool>