Messages and Message Queues
As described earlier in this chapter, Platform works with Messages, where each is stored in a single MessageQueue. The following table outlines all fields for Message:
Table 16.2. Message Fields
Field |
Description |
ValueChainId |
Value Chain which owns the Queue. (KEY field) |
Sender |
String field which uniquely identifies the sender of the message. For example, could be "PROD.9495" for the "Production" stage of Value Chain 9495. (KEY field) |
Id |
String field which uniquely identifies this particular message for the given Sender. Thus Messages from "PROD.9495" and "PROD.100" could both reuse the same Id without colliding. Any attempt to enqueue a Message with the same Sender and Id as an existing Message will be rejected. (KEY field) |
OwningQueueEnterpriseName |
If the owning queue is VC-scoped, identifies that queue's owning enterprise. |
OwningQueueName |
Identifies the MessageQueue in which this Message resides. This must be a real MessageQueue (unlike the OutboundQueue/InboundQueue fields). |
OutboundQueueName |
For messages outbound from platform, this will match the OwningQueue. For messages inbound to platform, this will reference a queue in another Platform instance from which this message arrived, or in a case where the message was enqueued from a file or some other location, it is informational only and can be any value or null. |
OutboundQueueValueChainId |
Part of the key for the outbound queue ... see OutboundQueueName |
OutboundQueueEnterpriseName |
Part of the key for the outbound queue ... see OutboundQueueName |
OutboundInterface |
For messages outbound from platform, specifies the name of the outbound interface used to generate the message. For messages inbound to platform, this will reference an interface in another Platform instance which was be used to generate the message, or in a case where the message was enqueued from a file or some other location, it is informational only and can be any value or null. |
InboundQueueName |
For messages inbound to platform, this will match the OwningQueue. For messages outbound from platform, this will reference a queue in another Platform instance into which this may ultimately be enqueued, or in a case where the message will just be dumped to file or some other location, it is informational only and can be any value or null. |
InboundQueueValueChainId |
Part of the key for the inbound queue ... see InboundQueueName |
InboundQueueEnterpriseName |
Part of the key for the inbound queue ... see InboundQueueName |
InboundInterface |
For messages inbound to platform, specifies the name of the inbound interface to be used for processing. For messages outbound from platform, this will reference an interface in another Platform instance which will be used to process it, or in a case where the message will just be dumped to file or some other location, it is informational only and can be any value or null. |
PayloadRef |
All message payloads are stored in a message store. This property refers to a path in that store which can be used to retrieve the Message. |
ClientFileName |
For inbound Messages which originated from a file, specifies the original file name coming from the client. For outbound messages which may be converted to files, provides a recommended base name to use. |
RelatedMessageId/Sender |
Link to a related Message, e.g. error response will have link back to input message. |
CreationDate |
Date when the Message was created |
DequeueInitiated |
Date/time at which dequeue was initiated for the Message. Note that if a Message's dequeue is started but not completed, then DequeueInitiated will have a value, but DequeueCompleted will not. |
DequeueCompleted |
Date/time at which dequeue was completed (committed) for the Message. |
Note that the payload for a message is stored in the MessageStorageService. This is configured in the InstanceConfig and points to a filesystem that must be shared by all Platform nodes in the cluster. Note that it is also possible for multiple Platform instances to share the same MessageStorageService; this can provide some performance improvements. See P2PI Routing for details.
The following table outlines all fields on MessageQueue:
Table 16.3. MessageQueue Fields
Field |
Description |
ValueChainId |
Value Chain which owns the Queue. (KEY field) |
Name |
Unique name of the Queue within the ValueChain (KEY field) |
EnterpriseName |
Queues may optionally be associated with a particular enterprise for administrative purposes. Queues with a null owning enterprise are considered to be owned by the Value Chain as a whole. (optional KEY field) |
Paused |
When true, the queue acts as if it's empty to clients - dequeuing is not possible. Once it is re-enabled dequeueing will proceed normally. Note that you can still enqueue messages into paused queues, you just can't dequeue. |
ExclusiveConsumer |
When ExclusiveConsumer is true, the queue enforces strict ordering of processing based on the order in which they were enqueued; no Message shall be dequeued until the previous message has been fully processed (or all retries for the previous Message have failed, or the previous Message has timed out.) When ExclusiveConsumer is false, the queue does not enforce strict ordering. As many Messages can be dequeued and processed in parallel as there are consumers to the queue. Consumers must not make any assumptions about the order in which Messages will be dequeued relative to how they were enqueued. Please note that changing this property for a non-empty queue will only affect the behavior of Messages added after the property was changed. |
Classification |
Each queue is given a classification to specify how Messages should be handled when they are dequeued. Possible classifications are:
|