com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Sample 0004 - Simple Pass-through with Email & JMS

Introduction

This example demonstrates how to filter incoming event attributes and add them to a topic using simple pass-through with Email and JMS 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. Copy the ActiveMQ JMS related JARs referred in JMS Transport to <CEP_HOME>/repository/components/lib directory.
  3. Copy the following JARs from ActiveMQ distribution directory to <CEP_HOME>/samples/lib directory.
    • <ActiveMQ_HOME>/activemq-all-5.7.0.jar

    • <ActiveMQ_HOME>/lib/ geronimo-jms_1.1_spec-1.1.1.jar

    Start the ActiveMQ server before the CEP server starts.

  4. Uncomment the mail transport receiver configuration in <CEP_HOME>/repository/conf/axis2/axis2.xml file to receive events from email client. 

    <transportReceiver name="mailto" class="org.apache.axis2.transport.mail.MailTransportListener">
    </transportReceiver> 

Building the sample

Start the WSO2 CEP server with the sample configuration numbered 0004. 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/0004 (by default, the Axis2 repo is <CEP_HOME>/repository/deployment/server).

Executing the sample

  1. Open a new terminal, go to <CEP_HOME>/samples/consumers/jms and run the following command:

    ant topicConsumer -Dtopic=ServiceManagement (Since we are sending events from CEP to a topic called ServiceManagement

    It builds the sample jms consumer and executes it.

    Do not close this terminal. It is required to keep the server running and receiving events.

     

  2. Send an event from a email client with the following information: 

    To Address: wso2cep.demo@gmail.com
    Mail Subject: SOAPAction:urn:ServiceManagement
    Mail Content: Subscribe PizzaOffers to Johan for 20 days

    Note that ServiceManagement is the email subject mentioned in the eventbuilder of this sample. Mail subject has to be SOAPAction:urn:ServiceManagement. For example,

  3. See the output events received from the CEP via the terminal opened in step 1. Shown below is a console output in the consumer terminal with events sent to CEP:

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.