This sample demonstrates how to publish JSON events via SMS transport. This sample does not do any processing on the outgoing event. Events are generated using an input event file and an SMSC simulator.
Follow the steps below to complete the prerequisites before starting the configuration.
Add the following configuration under Transport Outs section in the
<DAS_HOME>/repository/conf/axis2/axis2_client.xmlfile, to enable SMS transport.
Configure WSO2 DAS by adding relevant jars to support the SMS transport.
Building the sample
Start the WSO2 DAS server with the sample configuration numbered 0065. For instructions, see Starting sample CEP configurations. This sample configuration creates the following.
- An event stream named
- An event publisher named
smsEventPublisherto fetch events from the configured receiver email address.
- Load the events stored in the
<DAS_HOME>/samples/cep/artifacts/0065/eventsimulatorfiles/events.csvfile to the Event Simulator.
Executing the sample
Follow the steps below to execute the sample
Add the following name-value pairs to
users.txtfile.Enter the value of the systemId parameter defined in the above SMS transport sender configuration as the value of the name parameter in the below list. Please note that white spaces aren't removed from neither attribute name and it's value,
i.e. "name=peter" and "name= peter" define two different users, "peter" and " peter".
- Start SMSC Simulator by executing the following command:
java -cp smscsim.jar:../../lib/smpp.jar
- In the simulator console where the command runs:
- Enter 1 for the prompt to start simulation.
Enter 2775 as the port number (this port is equal to the port defined in the SMS transport sender configuration.)
Starting listener... startedlog is displayed on the console, the SMSC simulator is ready to accept messages as shown below.
Start the WSO2 DAS server with the sample configuration numbered 0065. For instructions, see Starting sample CEP configurations.
- Click Tools, and then click Event Simulator.
- Click Play on the corresponding event stream as shown below, to send the events in the
<DAS_HOME>/samples/cep/artifacts/0058/eventsimulatorfiles/events.csvfile to the publisher.
You view the JSON events that are published by the DAS server in the logs of the simulator as shown below.
Enter 5 to view the list of messages published from WSO2 DAS as shown below.