Message collectors provide the facility to collect messages coming from one or more sources and process them as a batch.
For example, when a doctor needs to see a patient's medical information, their system sends a request to Rhapsody. Behind-the-scenes, Rhapsody can request patient information from many different systems, each using different communication protocols such as HL7, XML or database queries. Rhapsody can then wait for all systems to respond, combine all the patient information into a single record and send it back to the doctor's system as a single message.
When a collector collects the messages, they are all delivered in a single batch to the filter the collector is attached to. If this filter does not combine them into a single message, then multiple output messages are generated and their order is no longer guaranteed.
Typically, the following filters are used in conjunction with a message collector (though not all message collector types are necessarily applicable to every filter):
- Mapper filter - maps multiple input messages into a single message. The filter takes many inputs, and produces a single output. This happens by running the main map code multiple times, once for each input message. Each time, the output message is saved from the previous run, and set as the output message. In this way, multiple passes of the message can generate an output with information from both parties. Refer to Many-to-one Mapping Using Mapper Filter for details.
- Batch \ De-batch filter - concatenates messages into a single batched message, and de-batches a batched message.
- JavaScript filter - the default script loops over an input collection of messages. If there is a collector, this may have more than one message in the collection. This can be handled by looping, or explicitly indexing the first and second message in the input collection. The JavaScript filter can opt to output single or multiple messages.
- XSLT Stylesheet filter - can operate on multiple messages: if in XML format, the messages are concatenated together, with the document tag removed from the bottom of all but the last, and from the top of all but the first; if in EDI format, the filter operates on the 'virtual' XML document for the EDI message; if a mixture, then the virtual document is concatenated with a real XML document.
- HIPAA 4010 Rebatcher filter - re-batches HIPAA messages.
Rhapsody provides the following message collector types:
Input Collation
The Input Collation message collector is used to hold back the Rhapsody engine from processing messages until a message has been received from each of the inputs specified by the Collation Order. This property also determines the order that the messages are processed, once this condition is met.
Property |
Description |
---|---|
Collection Order |
Sets the order in which messages are collected before processing occurs. |
Match Property |
Allows a property to be set within an incoming message, which identifies that message as part of a group to be collected before processing occurs. In order to guarantee the identifier used to identify the message set is unique, avoid generating the identifier from the message itself, for example from the |
Message Set Timeout |
Specifies the minimum guaranteed hold time after which message collection is considered incomplete and the messages are sent to the Timeout Destination. A Timeout value of |
Timeout Units |
Specifies the unit of time before timeout:
|
Timeout Destination |
Specifies the location to which messages that are part of an incomplete collection are sent, once the timeout period is reached:
|
Message Set
The Message Set message collector is used to hold back the Rhapsody engine from processing messages until all messages in a message set are collected together. A message set is typically generated by a filter that splits messages.
For example, the Batch / De-batch filter generates the properties required for message set collection. Each message contains a message set identifier (so multiple sets can be simultaneously collected), and a position in the message set (for example, position 4 of 9). When all messages have been collected into the set, they are sent to the filter.
Property |
Description |
---|---|
Set Identifier Property |
Specifies the property whose value each message uses to identify the message set it belongs to. In order to guarantee the identifier used to identify the message set is unique, avoid generating the identifier from the message itself, for example from the If the message set does not already have a unique identifier, then generate one externally by, for example, using the |
Total Count Property |
Specifies the property whose value each message uses to identify the total number of messages in its message set. This is required so the collector knows when it has all the messages in the collection. |
Index Base |
Determines how the index properties are used to sort the message set for collation:
|
Index Property |
Specifies the message property that contains the index of the message in the set. |
Message Set Timeout |
Specifies the minimum guaranteed hold time after which message collection is considered incomplete and message processing occurs. |
Timeout Units |
Specifies the unit of time before timeout:
|
Timeout Destination |
Specifies the location to which messages that are part of an incomplete collection are sent, once the timeout period is reached:
|
Message Set Trigger
The Message Set Trigger message collector is used to hold back the Rhapsody engine from processing messages until all messages with indexes less than the trigger message have arrived. A message set is typically generated by a filter that splits messages.
Property |
Description |
---|---|
Set Identifier Property |
Specifies the property whose value each message uses to identify the message set it belongs to. In order to guarantee the identifier used to identify the message set is unique, avoid generating the identifier from the message itself, for example from the |
Trigger Message Property |
Specifies the message property to trigger on. When a message is received and this property is present, the corresponding message set is released once all messages with indexes less than the trigger message have arrived. |
Index Base |
Determines how the index properties are used to sort the message set for collation:
If you require a complete set of ordered messages, then the messages need to be numbered with an index property which can either be zero- or one-based. When an index property is used, the incoming messages are simply sorted according to their index property, and when all the messages with an index property less than that of the trigger message, the set is considered complete and will be released in order. If there is no index then the ordering and completeness cannot be guaranteed. |
Index Property |
Specifies the message property that contains the index of the message in the set. |
Message Set Timeout |
Specifies the minimum guaranteed hold time after which message collection is considered incomplete and message processing occurs. |
Timeout Units |
Specifies the unit of time before timeout:
|
Timeout Destination |
Specifies the location to which messages that are part of an incomplete collection are sent, once the timeout period is reached:
|
Property
The Property message collector is used to hold and collate messages using a collection property.
Property |
Description |
---|---|
Collection Property |
Selects the collection property on which messages are collated. In order to guarantee the identifier used to identify the message set is unique, avoid generating the identifier from the message itself, for example from the |
Total Count Property | Selects the name of the message property that contains the total number of messages that are expected in the collection. If this configuration is configured, then it must be present on the first message collected in each group. If the first message is either missing this property or it is invalid (in other words, it is not a positive integer), then the message is sent to the error queue. This property is not examined on the second and subsequent messages within a collection group. The collection is deemed complete when either the timeout occurs or the expected number of messages are received. If this optional configuration property is not configured, then the collector keeps collecting messages until the configured timeout is reached. The messages are then sent to the configured Timeout Destination. |
Message Set Timeout |
Specifies the minimum guaranteed hold time after which message collection is considered incomplete and message processing occurs. |
Timeout Units |
Specifies the unit of time before timeout:
|
Timeout Destination |
Specifies the location to which messages that are part of an incomplete collection are sent, once the timeout period is reached:
If the Total Count Property configuration property is not set, this message collector will always timeout. When that occurs the collected messages are always sent to the configured Timeout Destination. |
Size and/or Time
The Size and/or Time message collector is used to hold back the Rhapsody engine from processing messages until their combined size reaches the value identified by the Message Set Size properties. Message collections that do not reach this size will be still processed once the timeout values have been reached.
Property |
Description |
---|---|
Message Set Size Count |
Specifies the size the file must grow to until processing occurs. When this configuration property is set to zero, there is no size limit and therefore messages are collected until a timeout occurs. |
Message Set Size Unit |
Specifies the units of the size the file must reach before processing occurs:
|
Message Set Timeout |
Specifies the minimum guaranteed hold time after which message collection is considered incomplete and message processing occurs. |
Timeout Units |
Specifies the unit of time before timeout:
|
Timeout Destination |
Specifies the location to which messages that are part of an incomplete collection are sent, once the timeout period is reached:
If the Message Set Size Count configuration property is set to zero, this message collector always timeouts. When that occurs the collected messages are always sent to the configured Timeout Destination. |
Timed Hold
The Timed Hold message collector is unique in that it does not collect messages together, but rather delays the processing of each message for a minimum guaranteed hold time. In other words, this type of collection does not release a collection of messages into a filter.
In practice, the actual hold time can be longer than the guaranteed hold time because an internal timeout task releases messages that have been in the collector longer than their configured hold time or timeout. The running frequency of the task is as follows:
- If the configured timeout is less than 5 minutes, then it runs every 15 seconds.
- If the configured timeout is less than 1 hour, then it runs every minute.
- Otherwise, it runs every 10 minutes.
The Timed Hold message collector does not batch the messages into a single message when used in conjunction with the Batch \ De-batch filter. In this scenario, when a timed out message is released by the collector, all other messages that have been collected with it are released at the same time as individual messages. If you want to batch all messages that arrive within a certain time interval using the Batch \ De-batch filter, use the Size and/or Time message collector instead and set its Message Set Timeout property as required.
Property |
Description |
---|---|
Message Set Timeout |
Specifies the minimum guaranteed hold time after which message collection is considered incomplete and message processing occurs. |
Timeout Units |
Specifies the unit of time before timeout:
|
Timeout Destination |
Specifies the location to which messages that are part of an incomplete collection are sent, once the timeout period is reached.
|
Trigger Message
The Trigger message collector is used to collect up a number of messages until a trigger message is received. When this trigger is received, all collected messages are released simultaneously.
Property |
Description |
---|---|
Property to trigger collection release |
Specifies the message property that triggers the collection release. When a message is received, with any value in this property, the collection is released. |
Message Set Timeout |
Specifies the minimum guaranteed hold time after which message collection is considered incomplete and message processing occurs. |
Timeout Units |
Specifies the unit of time before timeout:
|
Timeout Destination |
Specifies the location to which messages that are part of an incomplete collection are sent, once the timeout period is reached:
|