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 DAS using a JMS client that is subscribed to the Qpid broker.
Follow the steps below to set up the prerequisites before starting the configuration.
Configure WSO2 DAS by adding relevant libraries to support JMS transport.
Configure a sample client by adding relevant jars. See setting up JMS for JMS sample clients.
<DAS_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
Building the sample
Start the WSO2 DAS 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
- Creates event publishers named
- Hot deploys the
event.csvfile along with the event configuration xml.
Executing the sample
- Start WSO2 DAS with sample
0060configurations. For more information, see Starting sample CEP configurations.
Open another terminal and navigate to the
Run one of the following commands according to the type of the topic name of the messages to be consumed.
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 sends an event flow through the stream to the JMS publishers.
The events that are published by WSO2 DAS are loggeds in the JMS consumer console as follows.
Map formatted events:
Text formatted events: