Class AmqpDistribution
- java.lang.Object
-
- org.objectweb.joram.mom.dest.amqp.AmqpDistribution
-
- All Implemented Interfaces:
DistributionHandler
public class AmqpDistribution extends Object implements DistributionHandler
Distribution handler for the AMQP distribution bridge.
-
-
Field Summary
Fields Modifier and Type Field Description private StringamqpQueueprivate booleanamqpQueueAutoDeleteprivate booleanamqpQueueDurableprivate booleanamqpQueueExclusiveprivate booleanamqpQueuePassiveprivate LinkedHashMap<String,com.rabbitmq.client.Channel>channelsprivate List<String>connectionNamesprivate static booleanDEBUGprivate longlastUpdateprivate static Loggerloggerprivate static StringQUEUE_AUTODELETE_PROPTrue if we are declaring an autodelete queue (server will delete it when no longer in use).private static StringQUEUE_DURABLE_PROPTrue if we are declaring a durable queue (the queue will survive a server restart).private static StringQUEUE_EXCLUSIVE_PROPTrue if we are declaring an exclusive queue (restricted to this connection).private static StringQUEUE_NAME_PROPthe name of the queue to declareprivate static StringQUEUE_PASSIVE_PROPTrue if we are declaring a queue passively; i.e., check if it exists.private static StringROUTING_PROPprivate static StringUPDATE_PERIOD_PROPprivate longupdatePeriod
-
Constructor Summary
Constructors Constructor Description AmqpDistribution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this handler and releases any system resources associated to it.voiddistribute(Message fullMessage)Distributes the given message outside of the JORAM server.voidinit(Properties properties, boolean firstTime)Configures the handler with the given properties.
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
QUEUE_NAME_PROP
private static final String QUEUE_NAME_PROP
the name of the queue to declare- See Also:
- Constant Field Values
-
QUEUE_PASSIVE_PROP
private static final String QUEUE_PASSIVE_PROP
True if we are declaring a queue passively; i.e., check if it exists. Default value is true.- See Also:
- Constant Field Values
-
QUEUE_EXCLUSIVE_PROP
private static final String QUEUE_EXCLUSIVE_PROP
True if we are declaring an exclusive queue (restricted to this connection). Default value is false.- See Also:
- Constant Field Values
-
QUEUE_DURABLE_PROP
private static final String QUEUE_DURABLE_PROP
True if we are declaring a durable queue (the queue will survive a server restart). Default value is true.- See Also:
- Constant Field Values
-
QUEUE_AUTODELETE_PROP
private static final String QUEUE_AUTODELETE_PROP
True if we are declaring an autodelete queue (server will delete it when no longer in use). Default value is false.- See Also:
- Constant Field Values
-
UPDATE_PERIOD_PROP
private static final String UPDATE_PERIOD_PROP
- See Also:
- Constant Field Values
-
ROUTING_PROP
private static final String ROUTING_PROP
- See Also:
- Constant Field Values
-
channels
private LinkedHashMap<String,com.rabbitmq.client.Channel> channels
-
amqpQueue
private String amqpQueue
-
amqpQueuePassive
private boolean amqpQueuePassive
-
amqpQueueExclusive
private boolean amqpQueueExclusive
-
amqpQueueDurable
private boolean amqpQueueDurable
-
amqpQueueAutoDelete
private boolean amqpQueueAutoDelete
-
lastUpdate
private long lastUpdate
-
updatePeriod
private long updatePeriod
-
-
Method Detail
-
init
public void init(Properties properties, boolean firstTime)
Description copied from interface:DistributionHandlerConfigures the handler with the given properties.- Specified by:
initin interfaceDistributionHandler- Parameters:
properties- The initial set of properties.
-
distribute
public void distribute(Message fullMessage) throws Exception
Description copied from interface:DistributionHandlerDistributes the given message outside of the JORAM server.- Specified by:
distributein interfaceDistributionHandler- Parameters:
fullMessage- the message to distribute- Throws:
Exception- if the message could not be distributed. The message will be forwarded to a DMQ, if any.
-
close
public void close()
Description copied from interface:DistributionHandlerCloses this handler and releases any system resources associated to it. There will be no subsequent call to this handler after it has been closed.- Specified by:
closein interfaceDistributionHandler
-
-