Class ChannelInitializer

java.lang.Object
io.micronaut.rabbitmq.connect.ChannelInitializer
All Implemented Interfaces:
io.micronaut.context.event.BeanCreatedEventListener<ChannelPool>, EventListener

public abstract class ChannelInitializer extends 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
Author:
James Kleeh
  • Constructor Details

    • ChannelInitializer

      public ChannelInitializer()
  • Method Details

    • initialize

      public void initialize(com.rabbitmq.client.Channel channel, String name) throws 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:
      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>