Class ExplicitExchange

java.lang.Object
interlok.rabbitmq.ExplicitExchange
All Implemented Interfaces:
Declaration.ExchangeDeclaration

@ComponentProfile(summary="Explicitly declare a RabbitMQ Exchange", since="4.3.0") public class ExplicitExchange extends Object implements Declaration.ExchangeDeclaration
Declaring an explicit exchange.

Depending on your RabbitMQ configuration you may wish to explicitly declare an exchange that is not the 'default exchange' when producing messages.

  • Constructor Details

    • ExplicitExchange

      public ExplicitExchange()
  • Method Details

    • declare

      public void declare(com.rabbitmq.client.Channel ch) throws Exception
      Description copied from interface: Declaration.ExchangeDeclaration
      Declare the exchange.
      Specified by:
      declare in interface Declaration.ExchangeDeclaration
      Parameters:
      ch - the channel to use to declare the exchange.
      Throws:
      Exception
    • withName

      public ExplicitExchange withName(String s)
    • withType

      public ExplicitExchange withType(com.rabbitmq.client.BuiltinExchangeType t)
    • withDurable

      public ExplicitExchange withDurable(Boolean b)
    • name

      public String name()
      Description copied from interface: Declaration.ExchangeDeclaration
      The name of the exchange that was declared.
      Specified by:
      name in interface Declaration.ExchangeDeclaration
    • setType

      public void setType(com.rabbitmq.client.BuiltinExchangeType type)
      The exchange type.
    • getType

      public com.rabbitmq.client.BuiltinExchangeType getType()
      The exchange type.
    • getName

      public String getName()
      The exchange name.
    • setName

      public void setName(String name)
      The exchange name.
    • getDurable

      public Boolean getDurable()
      Whether or not the exchange should survive a server restart.
    • setDurable

      public void setDurable(Boolean durable)
      Whether or not the exchange should survive a server restart.