public interface IMessage
Modifier and Type | Method and Description |
---|---|
IMessage |
createCopy()
Creates a shallow copy of this message.
|
byte[] |
getBody()
Deprecated.
Message body need not just a byte array. Replaced by
getMessageBody() |
String |
getContentType()
Gets the content type of this message.
|
String |
getCorrelationId()
Gets a correlation identifier.
|
String |
getDeadLetterSource()
Gets the name of the queue or subscription that this message was enqueued on, before it was deadlettered.
|
long |
getDeliveryCount()
Gets the number of the times this message was delivered to clients.
|
Instant |
getEnqueuedTimeUtc()
Gets the instant at which this message was enqueued in Azure Service Bus.
|
Instant |
getExpiresAtUtc()
Gets the instant at which this message will expire.
|
String |
getLabel()
Gets the application specific message label.
|
Instant |
getLockedUntilUtc()
Gets the instant at which the lock of this message expires.
|
UUID |
getLockToken()
Gets the lock token for the current message.
|
MessageBody |
getMessageBody()
Gets the body of this message.
|
String |
getMessageId()
Gets the Id of this message.
|
String |
getPartitionKey()
Gets the partition key for sending a message to a partitioned entity.
|
Map<String,Object> |
getProperties()
Gets the map of user application properties of this message.
|
String |
getReplyTo()
Gets the address of an entity to send replies to.
|
String |
getReplyToSessionId()
Gets or sets a session identifier augmenting the
ReplyTo address. |
Instant |
getScheduledEnqueuedTimeUtc()
Deprecated.
Replaced by
getScheduledEnqueueTimeUtc() |
Instant |
getScheduledEnqueueTimeUtc()
Gets the scheduled enqueue time of this message.
|
long |
getSequenceNumber()
Gets the unique number assigned to a message by Service Bus.
|
String |
getSessionId()
Gets the session identifier for a session-aware entity.
|
Duration |
getTimeToLive()
Gets the duration before this message expires.
|
String |
getTo()
Gets the "to" address.
|
String |
getViaPartitionKey()
Gets the partition key for sending a message to a entity via another partitioned transfer entity.
|
void |
setBody(byte[] body)
Deprecated.
Message body need not just a byte array. Replaced by
setMessageBody(MessageBody) |
void |
setContentType(String contentType)
Sets the content type of this message.
|
void |
setCorrelationId(String correlationId)
Sets a correlation identifier.
|
void |
setLabel(String label)
Sets an application specific message label.
|
void |
setMessageBody(MessageBody body)
Sets the body of this message.
|
void |
setMessageId(String messageId)
Sets the Id of this message.
|
void |
setPartitionKey(String partitionKey)
Sets a partition key for sending a message to a partitioned entity
|
void |
setProperties(Map<String,Object> properties)
Sets the map of user application properties of this message.
|
void |
setReplyTo(String replyTo)
Sets the address of an entity to send replies to.
|
void |
setReplyToSessionId(String replyToSessionId)
Gets or sets a session identifier augmenting the
ReplyTo address. |
void |
setScheduledEnqueuedTimeUtc(Instant scheduledEnqueueTimeUtc)
Deprecated.
Replaced by
setScheduledEnqueueTimeUtc(Instant) |
void |
setScheduledEnqueueTimeUtc(Instant scheduledEnqueueTimeUtc)
Sets the scheduled enqueue time of this message.
|
void |
setSessionId(String sessionId)
Sets the session identifier for a session-aware entity.
|
void |
setTimeToLive(Duration timeToLive)
Sets the duration of time before this message expires.
|
void |
setTo(String to)
Sets the "to" address.
|
void |
setViaPartitionKey(String viaPartitionKey)
Sets a via-partition key for sending a message to a destination entity via another partitioned entity
|
long getDeliveryCount()
String getMessageId()
void setMessageId(String messageId)
messageId
- Id of this messagegetMessageId()
Duration getTimeToLive()
getEnqueuedTimeUtc
. When not set explicitly, the
assumed value is the DefaultTimeToLive set for the respective queue or topic.
A message-level TimeToLive value cannot be longer than the entity's DefaultTimeToLive
setting and it is silently adjusted if it does.void setTimeToLive(Duration timeToLive)
timeToLive
- Time to Live duration of this messagegetTimeToLive()
String getContentType()
void setContentType(String contentType)
contentType
- content type of this messagegetContentType()
Instant getExpiresAtUtc()
TimeToLive
property.
This property is computed from EnqueuedTimeUtc
+TimeToLive
.Instant getLockedUntilUtc()
DeliveryCount
is incremented and the message is again available for retrieval. This property is read-only.Instant getEnqueuedTimeUtc()
@Deprecated Instant getScheduledEnqueuedTimeUtc()
getScheduledEnqueueTimeUtc()
@Deprecated void setScheduledEnqueuedTimeUtc(Instant scheduledEnqueueTimeUtc)
setScheduledEnqueueTimeUtc(Instant)
scheduledEnqueueTimeUtc
- the instant at which this message should be enqueued in Azure Service BusgetScheduledEnqueueTimeUtc()
Instant getScheduledEnqueueTimeUtc()
void setScheduledEnqueueTimeUtc(Instant scheduledEnqueueTimeUtc)
scheduledEnqueueTimeUtc
- the instant at which this message should be enqueued in Azure Service BusgetScheduledEnqueueTimeUtc()
long getSequenceNumber()
String getSessionId()
void setSessionId(String sessionId)
sessionId
- session id of this messagegetSessionId()
@Deprecated byte[] getBody()
getMessageBody()
@Deprecated void setBody(byte[] body)
setMessageBody(MessageBody)
body
- body of this messagegetBody()
MessageBody getMessageBody()
void setMessageBody(MessageBody body)
body
- body of this messagegetMessageBody()
Map<String,Object> getProperties()
void setProperties(Map<String,Object> properties)
properties
- the map of user application properties of this messagegetProperties()
String getCorrelationId()
void setCorrelationId(String correlationId)
correlationId
- correlation Id of this messagegetCorrelationId()
String getTo()
void setTo(String to)
to
- To property value of this messageString getReplyTo()
void setReplyTo(String replyTo)
replyTo
- ReplyTo property value of this messagegetReplyTo()
String getLabel()
void setLabel(String label)
label
- Label property value of this messagegetLabel()
String getReplyToSessionId()
ReplyTo
address.
This value augments the ReplyTo information and specifies which SessionId should be set
for the reply when sent to the reply entity.void setReplyToSessionId(String replyToSessionId)
ReplyTo
address.replyToSessionId
- ReplyToSessionId property value of this messageString getPartitionKey()
SessionId
property overrides this value.void setPartitionKey(String partitionKey)
partitionKey
- partition key of this messagegetPartitionKey()
String getViaPartitionKey()
getPartitionKey()
and ensures that
messages are kept together and in order as they are transferred.void setViaPartitionKey(String viaPartitionKey)
viaPartitionKey
- via-partition key of this messagegetViaPartitionKey()
String getDeadLetterSource()
UUID getLockToken()
IMessage createCopy()
Copyright © 2019 Microsoft Corporation. All rights reserved.