This sample demonstrates how to publish custom Map and JSON events via JMS transport. Custom events are events with custom mappings that does not adhere to the default event formats. For more information on event formats, see Event Formats . You consume the published events in CEP using aJMS client which is subscribed to Qpid broker.
Follow the steps below to set up the prerequisites before starting the configuration.
Configure WSO2 CEP by adding relevant libraries to support JMS transport
Configure sample client by adding relevant jars. See setting up JMS for JMS sample clients.
<CEP_HOME>/repository/conf/jndi.propertiesfile and register a connection factory named
TopicConnectionFactoryby entering the following in the
register some connection factoriessection. And add the topics to be sent to the Qpid broker.
Start Qpid Broker with ./qpid-server start command by navigating to <QPID-BROKER_HOME>/bin.
Building the sample
Start the WSO2 CEP server with the sample configuration numbered 0060. For instructions, see Starting sample CEP configurations. This sample configuration does the following:
- Changes the default Axis2 repo from
- Creates a stream with id
- Create event publishers named
- Hot deploys the
event.csvfile along with event configuration xml.
Executing the sample
- Start WSO2 CEP with sample 0060 configurations. For more information, see Starting sample CEP configurations.
Open another terminal, go to
and run one of the the following commands according to the type of topic name of the messages suppose to consume
ant -Dbroker=qpid -DtopicName=topicMap
ant -Dbroker=qpid -DtopicName=topicJSON
It subscribes to the Qpid broker under the mentioned topic name.
event.csvfile deployed using the Event Simulator. This will send an event flow through the stream to the JMS publishers.
You can see the events getting published by CEP by the logs in the jms consumer console.
for Map formatted events:
for Text formatted events: