org.axonframework.eventhandling.amqp
Class AMQPMessage

java.lang.Object
  extended by org.axonframework.eventhandling.amqp.AMQPMessage

public class AMQPMessage
extends Object

Representation of an AMQP Message. Used by AMQP Based Terminals to define the settings to use when dispatching an Event to an AMQP Message Broker.

Since:
2.0
Author:
Allard Buijze

Constructor Summary
AMQPMessage(byte[] body, String routingKey)
          Creates an AMQP Message with given body and routingKey, which is not mandatory and non-immediate and has no additional properties.
AMQPMessage(byte[] body, String routingKey, com.rabbitmq.client.AMQP.BasicProperties properties, boolean mandatory, boolean immediate)
          Creates an AMQPMessage.
 
Method Summary
 byte[] getBody()
          Returns the body of this message
 com.rabbitmq.client.AMQP.BasicProperties getProperties()
          Returns the additional properties to dispatch this Message with
 String getRoutingKey()
          Returns the Routing Key this message should be dispatched with
 boolean isImmediate()
          Whether to dispatch this message using the "immediate" flag
 boolean isMandatory()
          Whether to dispatch this message using the "mandatory" flag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMQPMessage

public AMQPMessage(byte[] body,
                   String routingKey)
Creates an AMQP Message with given body and routingKey, which is not mandatory and non-immediate and has no additional properties.

Parameters:
body - The body of the message
routingKey - The routing key of the message

AMQPMessage

public AMQPMessage(byte[] body,
                   String routingKey,
                   com.rabbitmq.client.AMQP.BasicProperties properties,
                   boolean mandatory,
                   boolean immediate)
Creates an AMQPMessage. The given parameters define the properties returned by this instance.

Parameters:
body - The body of the message
routingKey - The routing key of the message
properties - The properties defining AMQP specific characteristics of the message
mandatory - Whether the message is mandatory (i.e. at least one destination queue MUST be available)
immediate - Whether the message must be delivered immediately (i.e. a Consumer must be connected and capable of reading the message right away).
Method Detail

getBody

public byte[] getBody()
Returns the body of this message

Returns:
the body of this message

getRoutingKey

public String getRoutingKey()
Returns the Routing Key this message should be dispatched with

Returns:
the Routing Key this message should be dispatched with

getProperties

public com.rabbitmq.client.AMQP.BasicProperties getProperties()
Returns the additional properties to dispatch this Message with

Returns:
the additional properties to dispatch this Message with

isMandatory

public boolean isMandatory()
Whether to dispatch this message using the "mandatory" flag

Returns:
whether to dispatch this message using the "mandatory" flag

isImmediate

public boolean isImmediate()
Whether to dispatch this message using the "immediate" flag

Returns:
whether to dispatch this message using the "immediate" flag


Copyright © 2010-2016. All Rights Reserved.