Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Working with Monitoring process : Multiple events in a single message : MapMessage with multiple events
 

MapMessage with multiple events

If you want to send a single event in a MapMessage, then you must add all the data elements to the MapMessage with pre-decided keys. If you want to send multiple or bulk events as part of a single message, then the message must contain one key containing a byte array value. The byte array will be a List<Map<String,Map<String,Object>>> as mentioned in ObjectMessage with multiple events.
To send multiple or bulk events as part of one MapMessage:
1. Create a Map for each message containing the event payload. Refer to Table 31 for more details about event payload properties.
2. Create another Map for event properties. Refer to Table 32 for more details about event properties.
3. Add the payload (data) Map and header (properties) Map to a Map with keys EVENT_DATA and EVENT_PROPERTIES keys respectively.
4. Add all these event Maps containing header and payload (one Map per event) to a List.
5. Put this List on the MapMessage as bytes (using setBytes()) with key as EVENT_LIST. The byte array in the message will be an object of type List<Map<String,Map<String,Object>>>.
6. Set the boolean property BULK_MESSAGE with value as 'true' or 'false' for this message. If BP Server does not find this property or if its value is set to 'false', then BP Server handles it as a single event message otherwise it handles it as a multi-event message.