Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Here we are going to discuss about how we can send WSO2 events to Agent Broker via Custom Data Publishers. There are two main methods available to do this.

...

When publishing data in above mentioned ways, Before sending events we need to define the stream definition to send data.

All the values that are send in the event must match with the stream definition (Previous CEP versions) but our CEP version 2.1.0 supports to send arbitrary key-value pairs which are not defined in the stream.

Below we have discussed further regarding that.

Supporting arbitrary key-value pairs in WSO2 events 

...

When sending the arbitrary value, it needs to be send as Map data format and both key and value pair needs to be in String format.  

1. Creating the agent and datapublisher to publish the data

...

Note

Here when defining the key, we need to follow some rules

  1. If you want to define the key-value pair as a meta data, then follow the syntax eg : arbitraryData.put("meta.buyer","Joe");
  2. If you want to define the key-value pair as correlation data, then follow the syntax eg : arbitraryData.put("correlation.buyer","Joe");
  3. If you want to define the key-value pair as payload data, then follow the syntax eg : arbitraryData.put("buyer","Joe"); - No any prefix

Other than the above mention situations, you can't use dot(.) for key.

...

5. Publish the map with the event.

...