Class Address


  • public class Address
    extends java.lang.Object
    Represents an address for publication of an AMQP message. The AMQP 0-8 and 0-9 specifications have an unstructured string that is used as a "reply to" address. There are however conventions in use and this class makes it easier to follow these conventions, which can be easily summarised as:
     (exchange)/(routingKey)
     
    Here we also the exchange name to default to empty (so just a routing key will work if you know the queue name).
    Author:
    Mark Pollack, Mark Fisher, Dave Syer, Artem Bilan, Gary Russell
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String AMQ_RABBITMQ_REPLY_TO
      Use this value in RabbitTemplate#setReplyAddress(String) to explicitly indicate that direct reply-to is to be used.
    • Constructor Summary

      Constructors 
      Constructor Description
      Address​(java.lang.String address)
      Create an Address instance from a structured String with the form
      Address​(java.lang.String exchangeName, java.lang.String routingKey)
      Create an Address given the exchange name and routing key.
    • Field Detail

      • AMQ_RABBITMQ_REPLY_TO

        public static final java.lang.String AMQ_RABBITMQ_REPLY_TO
        Use this value in RabbitTemplate#setReplyAddress(String) to explicitly indicate that direct reply-to is to be used.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Address

        public Address​(java.lang.String address)
        Create an Address instance from a structured String with the form
         (exchange)/(routingKey)
         
        .
        Parameters:
        address - a structured string.
      • Address

        public Address​(java.lang.String exchangeName,
                       java.lang.String routingKey)
        Create an Address given the exchange name and routing key. This will set the exchange type, name and the routing key explicitly.
        Parameters:
        exchangeName - The exchange name.
        routingKey - The routing key.
    • Method Detail

      • getExchangeName

        public java.lang.String getExchangeName()
      • getRoutingKey

        public java.lang.String getRoutingKey()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object