WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.
||
Skip to end of metadata
Go to start of metadata

Introduction

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.

Prerequisites

Follow the steps below to complete the prerequisites before starting the configuration.

  1. Add the following configuration under Transport Outs section in the <CEP_HOME>/repository/conf/axis2/axis2_client.xml file, to enable SMS transport.

    <axisconfigname="AxisJava2.0">
       ... 
       <transportSender class="org.apache.axis2.transport.sms.SMSSender" name="sms">        
            <parameter name="systemType"></parameter>
            <parameter name="systemId">cep1</parameter>
            <parameter name="password">cep123</parameter>
            <parameter name="host">localhost</parameter>
            <parameter name="port">2775</parameter>
            <parameter name="phoneNumber">CEP1</parameter>
        </transportSender>
        ...
    </axisconfig>
  2. Configure WSO2 CEP by adding relevant jars to support SMS transport.

Building the sample 

Start the WSO2 CEP server with the sample configuration numbered 0065. For instructions, see Starting sample CEP configurations. This sample configuration creates the following. 

  • An event stream named org.wso2.event.sensor.stream:1.0.0.
  • An event publisher named smsEventPublisher  to fetch events from the configured receiver email address  
  • Load the events stored in the <CEP_HOME>/samples/cep/artifacts/0065/eventsimulatorfiles/events.csv file to the event simulator.

Executing the sample

Follow the steps below to execute the sample. This sample uses Logica SMSC Simulator to receive messages. To start messaging simulator clone this repository and follow ReadMe to build it.

  1. Navigate to build/jar directory in SMSC Simulator repository. The folder must contain following two files.
    smscsim.jar
    users.txt

  2. Add the following name-value pairs to users.txt file. 

    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".
    name=cep1
    password=cep123
    timeout=unlimited
  3. Start SMSC Simulator by executing the following command: java -cp smscsim.jar:../../lib/smpp.jar com.logica.smscsim.Simulator
  4. 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.)

    When the Starting listener... started log is displayed on the console, the SMSC simulator is ready to accept messages as shown below
    logs of starting the SMSC simulator
  5. Start the WSO2 CEP server with the sample configuration numbered 0065. For instructions, see Starting sample CEP configurations.

  6. Click Tools, and then click Event Simulator.
  7. Click Play on the corresponding event stream as shown below, to send the events in the <CEP_HOME>/samples/cep/artifacts/0058/eventsimulatorfiles/events.csv file to the publisher.
     
    You view the JSON events that are published by the CEP server in the logs of the simulator as shown below.

    Enter 5 to view the list of messages published from WSO2 CEP as shown below.
  • No labels