This sample demonstrates how to publish Map and Text events via JMS transport. You consume the published events in WSO2 CEP using a JMS client which is subscribed to ActiveMQ broker.
Follow the steps below to set up the prerequisites before starting the configuration.
Install Apache ActiveMQ JMS event adapter.
- Issue the following command from the <
ACTIVEMQ_HOME>/bindirectory to start ActiveMQ.
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 ActiveMQ broker
Building the sample
Start the WSO2 CEP server with the sample configuration numbered 0059. For instructions, see Starting sample CEP configurations. This sample configuration creates the following:
- A stream with the ID
- Two event publishers named j
- Loads the events stored in the
<CEP_HOME>/samples/cep/artifacts/0059/eventsimulatorfiles/events.csvfile to the event simulator.
Executing the sample
Open another terminal and navigate to the
and run one of the the following commands according to the type of topic name of the messages suppose to consume
ant -Dbroker=activemq -DtopicName=topicMap
ant -Dbroker=activemq -DtopicName=topicText
It subscribes to the ActiveMQ 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 publisher.
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: