MyChannels.Nirvana.Message Class Reference

The Message class represents the data published to or consumed from a Nirvana realm. More...

Inheritance diagram for MyChannels.Nirvana.Message:
MyChannels.Nirvana.IMessage

Public Member Functions

 Message ()
 Construct an empty event.
 
 Message (Properties properties, byte[] data)
 Construct an event using the specified MessageProperties and data payload.
 
 Message (Properties properties, byte[] data, string tag)
 Construct an event using the specified MessageProperties, data payload and tag.
 
 Message (Properties properties, String tag)
 Construct an event using the specified MessageProperties and tag.
 
 Message (String tag, byte[] data)
 Construct an event using a tag and data payload only.
 

Properties

string Destination [get]
 Return the name of the Destination (Topic, Queue) this Message was published to.
 
long Id [get]
 Return the unique number assigned to this Message by the Nirvana realm Server.
 
byte[] Payload [get]
 Return the payload within this Message.
 
bool Persistent [get, set]
 Indicate whether the Message is persistently stored on disk (Only supported by Topic / Queues of type Mixed or Persistent)
 
IProperties Properties [get]
 Return the Properties for this Message.
 
byte[] PublisherHost [get]
 Represents the host name or ip address of the publisher of this message.
 
byte[] PublisherName [get]
 Represents the subject of the publisher of this message.
 
bool Redelivered [get]
 Returns whether a Message has been redelivered.
 
int RedeliveryCount [get]
 Returns the number of times a message has been delivered / redelivered.
 
byte[] SubscriberHost [get, set]
 Sets the host name or ip address representing the consumers of this message.
 
IEnumerable< string > SubscriberNames [get, set]
 An enumeration of sessions that will be the only consumers of this message.
 
string Tag [get]
 Return the 'tag' associated with this Message.
 
TimeSpan Timestamp [get]
 Represents the timestamp when the server received this message from the publisher.
 
long TTL [get, set]
 Specify the TTL (time to live) of the Message being published (Only supported by Topic / Queues of type Mixed)
 
- Properties inherited from MyChannels.Nirvana.IMessage
string Destination [get]
 Return the name of the Destination (channel or queue) this Message was published to.
 
long Id [get]
 Return the unique number assigned to this Message by the Nirvana realm Server.
 
byte[] Payload [get]
 Return the payload within this Message.
 
bool Persistent [get, set]
 Specify the TTL (time to live) of the Message being published (Only supported by Topic / Queues of type Mixed)
 
IProperties Properties [get]
 Return the MessageProperties for this Message.
 
byte[] PublisherHost [get]
 Represents the host name or ip address representing the publisher of this message.
 
byte[] PublisherName [get]
 Represents the subject of the publisher of this message.
 
bool Redelivered [get]
 Returns whether a Message has been redelivered.
 
int RedeliveryCount [get]
 Returns the number of times a message has been delivered / redelivered.
 
byte[] SubscriberHost [get, set]
 Represents the host name or ip address representing the consumers of this message.
 
IEnumerable< string > SubscriberNames [get, set]
 An enumeration of sessions that will be the only consumers of this message.
 
string Tag [get]
 Return the 'tag' associated with this Message.
 
TimeSpan Timestamp [get]
 Represents the timestamp when the server received this message form the publisher.
 
long TTL [get, set]
 Specify the TTL (time to live) of the Message being published.
 

Detailed Description

The Message class represents the data published to or consumed from a Nirvana realm.

The Message class consists of 3 distinct parts:

1. The header
2. The properties
3. The payload of the event

The header object contains system specific attributes, set by the Nirvana Realm Server

The properties contain meta data, added by the user in key, value format.

The payload represents the actual data portion of the Message as a byte array.

In addition, a 'tag' can also be used as a high level identifier for each event

Constructor & Destructor Documentation

◆ Message() [1/4]

MyChannels.Nirvana.Message.Message ( String  tag,
byte[]  data 
)

Construct an event using a tag and data payload only.

Parameters
tagthe Message tag as provided for each Message
datathe payload data

◆ Message() [2/4]

MyChannels.Nirvana.Message.Message ( Properties  properties,
byte[]  data 
)

Construct an event using the specified MessageProperties and data payload.

Parameters
propertiesthe MessageProperties provided for each Message
datathe payload data

◆ Message() [3/4]

MyChannels.Nirvana.Message.Message ( Properties  properties,
byte[]  data,
string  tag 
)

Construct an event using the specified MessageProperties, data payload and tag.

Parameters
propertiesthe MessageProperties provided for each Message
datathe payload data
tagthe Message tag

◆ Message() [4/4]

MyChannels.Nirvana.Message.Message ( Properties  properties,
String  tag 
)

Construct an event using the specified MessageProperties and tag.

Parameters
propertiesthe MessageProperties provided for each Message
tagthe Message tag

Property Documentation

◆ Destination

string MyChannels.Nirvana.Message.Destination
get

Return the name of the Destination (Topic, Queue) this Message was published to.

Returns
The name of the Topic, Queue

Implements MyChannels.Nirvana.IMessage.

◆ Id

long MyChannels.Nirvana.Message.Id
get

Return the unique number assigned to this Message by the Nirvana realm Server.

Returns
The id of this Message

Implements MyChannels.Nirvana.IMessage.

◆ Payload

byte [] MyChannels.Nirvana.Message.Payload
get

Return the payload within this Message.

Returns
The binary payload for this Message

Implements MyChannels.Nirvana.IMessage.

◆ Properties

IProperties MyChannels.Nirvana.Message.Properties
get

Return the Properties for this Message.

Returns
The Properties, or meta data associated with this Message

Implements MyChannels.Nirvana.IMessage.

◆ SubscriberHost

byte [] MyChannels.Nirvana.Message.SubscriberHost
getset

Sets the host name or ip address representing the consumers of this message.

By setting this, only connections matching the host name or ip address will consume this event. Wildcard * are also supported, so you can have *.abc.com fore example

Implements MyChannels.Nirvana.IMessage.

◆ SubscriberNames

IEnumerable<string> MyChannels.Nirvana.Message.SubscriberNames
getset

An enumeration of sessions that will be the only consumers of this message.

By setting this, no other subscribers, either on a queue or channel will consume this event.

Implements MyChannels.Nirvana.IMessage.

◆ Tag

string MyChannels.Nirvana.Message.Tag
get

Return the 'tag' associated with this Message.

Returns
The tag associated with this message

Implements MyChannels.Nirvana.IMessage.