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 outgoing text events via email transport. This sample does not do any processing on the outgoing event. Events are generated using an input event file and the event simulator.

Prerequisites

Set up the prerequisites required for all samples.

Edit the mail transport sender configuration in <CEP_HOME>/repository/conf/output-event-adapters.xml file as required to send events to email client.

    <adapterConfig type="email">
        <property key="mail.smtp.from">abcd@gmail.com</property>
        <property key="mail.smtp.user">abcd</property>
        <property key="mail.smtp.password">xxxx</property>
        <property key="mail.smtp.host">smtp.gmail.com</property>
        <property key="mail.smtp.port">587</property>
        <property key="mail.smtp.starttls.enable">true</property>
        <property key="mail.smtp.auth">true</property>
        <!-- Thread Pool Related Properties -->
        <property key="maxThread">100</property>
        <property key="keepAliveTimeInMillis">20000</property>
        <property key="jobQueueSize">10000</property>
    </adapterConfig>

Building the sample 

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

  • A stream named org.wso2.event.sensor.stream:1.0.0.
  • An event publisher named name emailPublisher to log the received messages

Executing the sample

This builds the publishes the events in the <CEP_HOME>/samples/cep/artifacts/0064/eventsimulatorfiles/events.csv file to the emailPublisher endpoint.  

First go to the Event publishers and update existing emailPublisher and change email property for receiving mail address as shown below.

 

Then go to the event simulator and click play to send events contain in events.csv file

 

You view the receiver email should receive events as following screenshot.

 

 

  • No labels