public class DMQManager extends Object
DMQManager
is made to stock the dead messages before sending
them to the dead message queue, only if such a queue is defined.Modifier and Type | Field and Description |
---|---|
private ClientMessages |
deadMessages |
private AgentId |
destDmqId |
static org.objectweb.util.monolog.api.Logger |
logger |
private AgentId |
senderId |
Constructor and Description |
---|
DMQManager(AgentId currentDestDmq,
AgentId senderId)
Creates a DMQManager.
|
DMQManager(AgentId specificDmq,
AgentId currentDestDmq,
AgentId senderId)
Creates a DMQManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addDeadMessage(Message mess,
short reason)
Stocks a dead message waiting to be sent to the DMQ.
|
void |
sendToDMQ()
Sends previously stocked messages to the appropriate DMQ.
|
private ClientMessages deadMessages
private AgentId destDmqId
private AgentId senderId
public static org.objectweb.util.monolog.api.Logger logger
public DMQManager(AgentId specificDmq, AgentId currentDestDmq, AgentId senderId)
specificDmq
is used in priority. If
null
, destination DMQ is used if it exists, else default DMQ
is used. If none exists, dead messages will be lost.specificDmq
- Identifier of the dead message queue to use in priority.currentDestDmq
- The DMQ of the destinationsenderId
- The id of the destination. This is used to avoid sending to
itself.public DMQManager(AgentId currentDestDmq, AgentId senderId)
currentDestDmq
- The DMQ of the destinationsenderId
- The id of the destination. This is used to avoid sending to
itself.public void addDeadMessage(Message mess, short reason)
mess
- The message to stockreason
- The reason explaining why the message has to be send to the DMQ.
It can be one of the following: EXPIRED
,
NOT_WRITEABLE
, UNDELIVERABLE
,
ADMIN_DELETED
, DELETED_DEST
,
QUEUE_FULL
or UNEXPECTED_ERROR
.public void sendToDMQ()
Copyright © 2016 ScalAgent D.T.. All Rights Reserved.