Constructor
# new Message(payload, timeSpan)
Initializes an instance of Message.
Name | Type | Default | Description |
---|---|---|---|
payload |
JSON | null | The actual data object of interest for subscribers, for example, Order. |
timeSpan |
TimeSpan | null | ExpirationTime of TimeSpan type after which the message is expired from the topic. This can also accept null value, which will ensure that the message is not expired from the topic. In case of no expiration time specified, null is considered as default. |
Methods
# (static) getNoExpiration() → {TimeSpan}
Get specifies TimeSpan.MaxValue for the message, so that it is not expired.
- Type
- TimeSpan
# getCreationTime() → {Date}
Get creation time in DateTime for the message.
- Type
- Date
# getExpirationTime() → {TimeSpan}
Get ExpirationTime of TimeSpan type after which the message is expired from the topic. This can also accept null value, which will ensure that the message is not expired from the topic. In case of no expiration time specified, null is considered as default.
- Type
- TimeSpan
# getMessageId() → {string}
Get auto generated ID for the message, as same messages can be stored on different topics.
- Type
- string
# getPayload() → {json}
The actual data object of interest for subscribers, for example, Order.
- Type
- json
# setCreationTime(value)
Set creation time in Date for the message.
Name | Type | Description |
---|---|---|
value |
Date | creation time in Date |
# setExpirationTime(value)
Set ExpirationTime of TimeSpan type after which the message is expired from the topic. This can also accept null value, which will ensure that the message is not expired from the topic. In case of no expiration time specified, null is considered as default.
Name | Type | Description |
---|---|---|
value |
TimeSpan | ExpirationTime of TimeSpan |
# setMessageId(value)
Set auto generated ID for the message, as same messages can be stored on different topics.
Name | Type | Description |
---|---|---|
value |
string | Auto generated ID for the message, as same messages can be stored on different topics. |