Receiving JSON Events via JMS
Purpose:
This application demonstrates how to configure ESB Streaming Integrator Tooling to receive events to the SweetProductionStream
via Jms transport in Json format using default mapping and log the events in LowProductionAlertStream
to the output console.
Prerequisites:
- Setup ActiveMQ
- Download
activemq-client-5.x.x.jar
(http://central.maven.org/maven2/org/apache/activemq/activemq-client/5.9.0/activemq-client-5.9.0.jar)
- Download
apache-activemq-5.x.x-bin.zip
(http://archive.apache.org/dist/activemq/apache-activemq/5.9.0/apache-activemq-5.9.0-bin.zip)
- ActiveMQ
activemq-client-5.x.x.jar
lib to be added and converted to OSGI (See Note: To convert ActiveMQ lib to OSGI).
- Unzip the
apache-activemq-5.x.x-bin.zip
and copy the following ActiveMQ libs in apache-activemq-5.x.x/lib
to {WSO2SIHome}/samples/sample-clients/lib
and {WSO2SIHome}/lib
.
- hawtbuf-1.9.jar
- geronimo-j2ee-management_1.1_spec-1.0.1.jar
- geronimo-jms_1.1_spec-1.1.1.jar
- Save this sample.
- If there is no syntax error, the following message is shown on the console:
Siddhi App ReceiveJMSInJsonFormat successfully deployed.
Note:
To convert ActiveMQ lib to OSGI,
1. Navigate to {WSO2SIHome}/bin and run the following command:
* For Linux:
./icf-provider.sh org.apache.activemq.jndi.ActiveMQInitialContextFactory <Downloaded Jar Path>/activemq-client-5.x.x.jar <Output Jar Path>
* For Windows:
./icf-provider.bat org.apache.activemq.jndi.ActiveMQInitialContextFactory <Downloaded Jar Path>\activemq-client-5.x.x.jar <Output Jar Path>
* Provide privileges if necessary using chmod +x icf-provider.(sh|bat)
.
* Also, this will register the InitialContextFactory
implementation according to the OSGi JNDI spec.
2. If converted successfully then it will create 'activemq-client-5.x.x' directory in the