public interface AQMessageProperties
When enqueuing a new message in a queue, you first need to retrieve a new instance of this interface by calling AQFactory.createAQMessageProperties()
. Fill the message properties and then call AQFactory.createAQMessage(props)
to create a new AQ message with props
being the message properties. Finally set the payload and then enqueue the message.
AQFactory.createAQMessageProperties
Modifier and Type | Interface | Description |
---|---|---|
static class |
AQMessageProperties.DeliveryMode |
|
static class |
AQMessageProperties.MessageState |
Modifier and Type | Field | Description |
---|---|---|
static int |
MESSAGE_NO_DELAY |
Possible value for setDelay.
|
static int |
MESSAGE_NO_EXPIRATION |
The message will never expire.
|
Modifier and Type | Method | Description |
---|---|---|
String |
getCorrelation() |
|
int |
getDelay() |
|
AQMessageProperties.DeliveryMode |
getDeliveryMode() |
After a dequeue operation, call this method to find out if the message was enqueued in a persistent manner or not.
|
int |
getDequeueAttemptsCount() |
Returns the number of attempts that have been made to dequeue the message.
|
Timestamp |
getEnqueueTime() |
Returns the time the message was enqueued.
|
String |
getExceptionQueue() |
|
int |
getExpiration() |
|
byte[] |
getPreviousQueueMessageId() |
The ID of the message in the last queue that generated this message.
|
int |
getPriority() |
|
AQAgent[] |
getRecipientList() |
|
AQAgent |
getSender() |
|
AQMessageProperties.MessageState |
getState() |
Returns the state of the message at the time of the dequeue.
|
String |
getTransactionGroup() |
For transaction-grouped queues, this identifies the transaction group of the message.
|
void |
setCorrelation(String correlation) |
Specifies the identification supplied by the producer for a message at enqueuing.
|
void |
setDelay(int delay) |
Specifies the number of seconds to delay the enqueued message.
|
void |
setExceptionQueue(String exceptionQueue) |
Specifies the name of the queue to which the message is moved to if it cannot be processed successfully.
|
void |
setExpiration(int seconds) |
Specifies the expiration of the message.
|
void |
setPriority(int priority) |
Specifies the priority of the message.
|
void |
setRecipientList(AQAgent[] agents) |
This parameter is only valid for queues which allow multiple consumers.
|
void |
setSender(AQAgent sender) |
Identifies the original sender of a message.
|
String |
toString() |
static final int MESSAGE_NO_DELAY
static final int MESSAGE_NO_EXPIRATION
int getDequeueAttemptsCount()
void setCorrelation(String correlation) throws SQLException
SQLException
String getCorrelation()
void setDelay(int delay) throws SQLException
SQLException
int getDelay()
Timestamp getEnqueueTime()
void setExceptionQueue(String exceptionQueue) throws SQLException
SQLException
String getExceptionQueue()
void setExpiration(int seconds) throws SQLException
SQLException
int getExpiration()
AQMessageProperties.MessageState getState()
void setPriority(int priority) throws SQLException
SQLException
int getPriority()
void setRecipientList(AQAgent[] agents) throws SQLException
SQLException
AQAgent[] getRecipientList()
void setSender(AQAgent sender) throws SQLException
SQLException
AQAgent getSender()
String getTransactionGroup()
byte[] getPreviousQueueMessageId()
AQMessageProperties.DeliveryMode getDeliveryMode()
Note that this is set at dequeue time by the driver. There is an enqueue option to enqueue a buffered message.