/
Sample 0005 - Simple Pass-through with WS-Event-Local & Email
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Sample 0005 - Simple Pass-through with WS-Event-Local & Email

Introduction

This sample demonstrates how to filter incoming event attributes sent out from CEP to an email client using simple pass-through with WS-Event-Local and Email event adapters. Because we do not use any execution plan here, there is no Siddhi query.

Prerequisites

  1. See Prerequisites in CEP Samples Setup page.
  2. Uncomment the mail transport sender configuration as follows in <CEP_HOME>/repository/conf/axis2/axis2_client.xml file to send events to email client. 

    	<transportSender name="mailto"
                         class="org.apache.axis2.transport.mail.MailTransportSender">
            <parameter name="mail.smtp.from">wso2cep.demo@gmail.com</parameter>
            <parameter name="mail.smtp.user">wso2cep.demo</parameter>
            <parameter name="mail.smtp.password">wso2cep@123</parameter>
            <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
            <parameter name="mail.smtp.port">587</parameter>
            <parameter name="mail.smtp.starttls.enable">true</parameter>
            <parameter name="mail.smtp.auth">true</parameter>
        </transportSender> 

    See Output Email Event Adapter for values of the properties.

Building the sample

  1. Start the WSO2 CEP server with the sample configuration numbered 0005. For instructions, see Starting sample CEP configurations. This sample configuration does the following:
    • Creates <CEP_HOME>/repository/conf/stream-manager-config.xml file, which is used to create the stream definitions for the sample.
    • Points the default Axis2 repo to <CEP_HOME>/sample/artifacts/0005 (by default, the Axis2 repo is <CEP_HOME>/repository/deployment/server).
  2. Note that an axis2 service is created and deployed in server start-up.

Executing the sample

  1. Since your consumer is an email client, set the values for email address in the event formatter of this sample (by default, the email is sent to wso2cep.demo@gmail.com).

  2. Open another terminal, go to <CEP_HOME>/samples/producers/pizza-shop and run the command below.

    It builds and runs the pizza order producer, which sends sample pizza order information to the CEP server.

    ant pizzaOrderClient -Dservice=WSEventLocalAdaptorService -Dtopic=PizzaOrder
  3. On this terminal output, see the events sent. For example,

  4. See the output events received from the CEP via the email client.

    Notice a WARN log in CEP, which appears because an event sent by the producer is in a wrong format (this is intentionally added to check whether default values are picked by CEP itself).

    Shown below is a screenshot of the email client when receiving events from CEP.

Related content

Sample 0005 - Simple Pass-through with HTTP & Email
Sample 0005 - Simple Pass-through with HTTP & Email
More like this
Sample 0004 - Simple Pass-through with Email & JMS
Sample 0004 - Simple Pass-through with Email & JMS
More like this
Sample 0004 - Simple Pass-through with Email & JMS
Sample 0004 - Simple Pass-through with Email & JMS
More like this
Sample 0064 - Publishing Text Events via Email Transport
Sample 0064 - Publishing Text Events via Email Transport
More like this
Sample 0015 - Receiving Text Events via Email Transport
Sample 0015 - Receiving Text Events via Email Transport
More like this
Sample 0015 - Receiving Text Events via Email Transport
Sample 0015 - Receiving Text Events via Email Transport
More like this
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.