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 and Description |
|---|---|
static class |
AQMessageProperties.DeliveryMode |
static class |
AQMessageProperties.MessageState |
| Modifier and Type | Field and Description |
|---|---|
static int |
INVALID_SHARD_ID
Used in the context of the Shard Id hint to represent an invalid Shard.
|
static int |
MESSAGE_NO_DELAY
Possible value for setDelay.
|
static int |
MESSAGE_NO_EXPIRATION
The message will never expire.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.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.
|
java.sql.Timestamp |
getEnqueueTime()
Returns the time the message was enqueued.
|
java.lang.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() |
int |
getShardNum() |
AQMessageProperties.MessageState |
getState()
Returns the state of the message at the time of the dequeue.
|
java.lang.String |
getTransactionGroup()
For transaction-grouped queues, this identifies the transaction group of the
message.
|
void |
setCorrelation(java.lang.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(java.lang.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.
|
void |
setShardNum(int shardNum)
Specifies ShardID of the message.
|
java.lang.String |
toString() |
static final int MESSAGE_NO_DELAY
static final int MESSAGE_NO_EXPIRATION
static final int INVALID_SHARD_ID
int getDequeueAttemptsCount()
void setCorrelation(java.lang.String correlation)
throws java.sql.SQLException
java.sql.SQLExceptionjava.lang.String getCorrelation()
void setDelay(int delay)
throws java.sql.SQLException
java.sql.SQLExceptionint getDelay()
java.sql.Timestamp getEnqueueTime()
void setExceptionQueue(java.lang.String exceptionQueue)
throws java.sql.SQLException
java.sql.SQLExceptionjava.lang.String getExceptionQueue()
void setExpiration(int seconds)
throws java.sql.SQLException
java.sql.SQLExceptionint getExpiration()
AQMessageProperties.MessageState getState()
void setPriority(int priority)
throws java.sql.SQLException
java.sql.SQLExceptionint getPriority()
void setShardNum(int shardNum)
throws java.sql.SQLException
java.sql.SQLExceptionint getShardNum()
void setRecipientList(AQAgent[] agents) throws java.sql.SQLException
java.sql.SQLExceptionAQAgent[] getRecipientList()
void setSender(AQAgent sender) throws java.sql.SQLException
java.sql.SQLExceptionAQAgent getSender()
java.lang.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.
java.lang.String toString()
toString in class java.lang.Object