public interface Header
Header
interface is the root interface of all OMS messages, and the most commonly used by OMS message
Message
.
The header contains fields used by the messaging system that describes the message's meta information, while the body contains the application data being transmitted.
As for the message header, OMS defines three kinds types: headers Header
ExtensionHeader
and
properties KeyValue
, with respect to flexibility in vendor implementation and user usage.
The header part is placed in the implementation classes of Message
.
Modifier and Type | Method and Description |
---|---|
String |
getBornHost()
|
long |
getBornTimestamp()
|
short |
getCompression()
|
int |
getDeliveryCount()
|
String |
getDestination()
|
short |
getDurability()
|
String |
getMessageId()
|
short |
getPriority()
|
Header |
setBornHost(String bornHost)
The
BORN_HOST header field contains the born host info of a message in client side. |
Header |
setBornTimestamp(long bornTimestamp)
The
BORN_TIMESTAMP header field contains the time a message was handed off to a Producer to be
sent. |
Header |
setCompression(short compression)
The field
COMPRESSION in headers represents the message body compress algorithm. |
Header |
setDeliveryCount(int deliveryCount)
The
DELIVERY_COUNT header field contains a number, which represents the count of the message delivery. |
Header |
setDestination(String destination)
The
DESTINATION header field contains the destination to which the message is being sent. |
Header |
setDurability(short durability)
The
DURABILITY header field contains the persistent level of a message, the vendor should guarantee the
reliability level for a message. |
Header |
setMessageId(String messageId)
The
MESSAGE_ID header field contains a value that uniquely identify each message sent by a Producer . |
Header |
setPriority(short priority)
The
PRIORITY header field contains the priority level of a message, a message with a higher priority
value should be delivered preferentially. |
Header setDestination(String destination)
DESTINATION
header field contains the destination to which the message is being sent.
When a message is set to the Queue
, then the message will be sent to the specified destination.
When a message is received, its destination is equivalent to the Queue
where the message resides in.
Header setMessageId(String messageId)
MESSAGE_ID
header field contains a value that uniquely identify each message sent by a Producer
. this identifier is generated by producer.Header setBornTimestamp(long bornTimestamp)
BORN_TIMESTAMP
header field contains the time a message was handed off to a Producer
to be
sent.
When a message is sent, BORN_TIMESTAMP will be set with current timestamp as the born timestamp of a message in client side, on return from the send method, the message's BORN_TIMESTAMP header field contains this value.
When a message is received its, BORN_TIMESTAMP header field contains this same value.
This filed is a long
value, measured in milliseconds.
Header setBornHost(String bornHost)
BORN_HOST
header field contains the born host info of a message in client side.
When a message is sent, BORN_HOST will be set with the local host info, on return from the send method, the message's BORN_HOST header field contains this value.
When a message is received, its BORN_HOST header field contains this same value.
Header setPriority(short priority)
PRIORITY
header field contains the priority level of a message, a message with a higher priority
value should be delivered preferentially.
OMS defines a ten level priority value with 1 as the lowest priority and 10 as the highest, and the default priority is 5. The priority beyond this region will be ignored.
OMS does not require or provide any guarantee that the message should be delivered in priority order strictly, but the vendor should provide a best effort to deliver expedited messages ahead of normal messages.
If PRIORITY field isn't set explicitly, use 5
as the default priority.
Header setDurability(short durability)
DURABILITY
header field contains the persistent level of a message, the vendor should guarantee the
reliability level for a message.
OMS defines two modes of message delivery:
Header setDeliveryCount(int deliveryCount)
DELIVERY_COUNT
header field contains a number, which represents the count of the message delivery.Header setCompression(short compression)
COMPRESSION
in headers represents the message body compress algorithm. vendors are free to
choose the compression algorithm, but must ensure that the decompressed message is delivered to the user.String getDestination()
String getMessageId()
long getBornTimestamp()
String getBornHost()
short getPriority()
short getDurability()
int getDeliveryCount()
short getCompression()
Copyright © 2017–2020 OpenMessaging. All rights reserved.