Event Routing

Event processing Agents receive messages sent by other Agents or by Native-Object Triggers and Actions.

Often, HTTP agents are responsible for the ingres of data into your Contextual tenant and either store the incoming data into an object-type record, or send it directly to an Event Agent.

Since there can be multiple instances of a single Agent, the Contextual messaging service automatically partitions the the messages for a specific agent based on the number of agent instances that are running. Events (messages) can then be automatically allocated to a specific partition based on a "key" which is a specific property of the event. This partitioning allows you to ensure that all "related events" can be processed in the same order in which they were received, based on the partition key.

However if no partition key is specified, then messages will be randomly distributed across the available agent instances.

For example, if an event is triggered by an object-type trigger for each record update, you could use the record 'id' (primary key) as the partition key, thus ensuring that all of the events for a specific record are processed in the order in which they were triggered, even if there are many agent instances running. By using the 'id' as the partition key, all of the events for a specific record would be processed by the same agent instance, and since Event agents only process one message at a time, order of processing is ensured.

Similarly, if one agent sends a message to another agent using the "Send To Agent" node, the partition key can also be specified as a property of the node, allowing the flow developer to ensure proper processing order.

Last updated