Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  • Data Publisher
  • AsyncDataPublisher
  • Load Balancing DataPublisher
Info
titleInforInfo

For more information on data publishers, refer to this article in WSO2 library: http://wso2.org/library/articles/2012/07/creating-custom-agents-publish-events-bamcep.

...

Note

Note the following rules when defining the key:

  1. To define the key-value pair asmeta as meta data, follow the syntax arbitraryData.put("meta.buyer","Joe");
  2. To define the key-value pair as correlation data, follow the syntax arbitraryData.put("correlation.buyer","Joe");
  3. To define the key-value pair as payload data, follow the syntax arbitraryData.put("buyer","Joe"); - No prefix.

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

...

Code Block
languagejava
linenumberstrue
Event eventOne = new Event(streamId, System.currentTimeMillis(), new Object[]{"external"}, null,
                                   new Object[]{"IBM", 45, 2500},arbitraryData);

dataPublisher.publish(eventOne);
Info
titleInfo

To receive arbitrary values in the CEP, bucket needs to be configured properly but it does not need any special configuration. We need to follow same approach which we are using for Tuple mapping.

  1. If we are defining a key-value pair as meta data then it needs to be configured as meta data in the input mapping of the bucket.
  2. If we are defining a key-value pair as correlation data then it needs to be configured as correlation data in the input mapping of the bucket.
  3. If we are defining a key-value pair as payload data then it needs to be configured as payload data in the input mapping of the bucket.

Example: If we defining the key-value as meta data then,

Image Added