Class AmqpAcquisition
- java.lang.Object
-
- org.objectweb.joram.mom.dest.amqp.AmqpAcquisition
-
- All Implemented Interfaces:
AcquisitionDaemon
public class AmqpAcquisition extends Object implements AcquisitionDaemon
Acquisition daemon for the AMQP acquisition bridge.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAmqpAcquisition.AmqpConsumerprivate static classAmqpAcquisition.ConnectionUpdaterDaemon used to periodically update the pool of connections known by the acquisition destinations.
-
Field Summary
Fields Modifier and Type Field Description private StringamqpQueueThe name of the foreign AMQP queue.private booleanamqpQueueAutoDeleteprivate booleanamqpQueueDurableprivate booleanamqpQueueExclusiveprivate booleanamqpQueuePassiveprivate Map<String,com.rabbitmq.client.Channel>channelsprivate booleanclosingprivate List<String>connectionNamesIf routing prop has been set, it defines a list of connection to use.private static AmqpAcquisition.ConnectionUpdaterconnectionUpdaterprivate static booleanDEBUGprivate 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 ReliableTransmittertransmitterprivate static StringUPDATE_PERIOD_PROP
-
Constructor Summary
Constructors Constructor Description AmqpAcquisition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidstart(Properties properties, ReliableTransmitter transmitter)Tells the daemon to start with the given properties.voidstop()Tells the daemon to stop.voidupdateConnections(List<LiveServerConnection> connections)Create a new AMQP consumer for each connection available.
-
-
-
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
-
connectionUpdater
private static AmqpAcquisition.ConnectionUpdater connectionUpdater
-
transmitter
private ReliableTransmitter transmitter
-
connectionNames
private List<String> connectionNames
If routing prop has been set, it defines a list of connection to use.
-
amqpQueue
private String amqpQueue
The name of the foreign AMQP queue.
-
amqpQueuePassive
private boolean amqpQueuePassive
-
amqpQueueExclusive
private boolean amqpQueueExclusive
-
amqpQueueDurable
private boolean amqpQueueDurable
-
amqpQueueAutoDelete
private boolean amqpQueueAutoDelete
-
closing
private volatile boolean closing
-
-
Method Detail
-
start
public void start(Properties properties, ReliableTransmitter transmitter)
Description copied from interface:AcquisitionDaemonTells the daemon to start with the given properties.- Specified by:
startin interfaceAcquisitionDaemon- Parameters:
properties- The initial set of properties.transmitter- a transmitter used to transmit retrieved messages to the MOM reliably.
-
stop
public void stop()
Description copied from interface:AcquisitionDaemonTells the daemon to stop. Any system resources previously allocated must be released.- Specified by:
stopin interfaceAcquisitionDaemon
-
updateConnections
public void updateConnections(List<LiveServerConnection> connections)
Create a new AMQP consumer for each connection available.
-
-