The latest version for DAS is WSO2 Data Analytics Server 3.1.0. View documentation for the latest release.
WSO2 Data Analytics Server is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.

All docs This doc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
||
Skip to end of metadata
Go to start of metadata

Introduction

This sample demonstrates how to publish XML, JSON or custom Text events via HTTP transport. Custom events are events with custom mappings that does not adhere to the default event formats. For more information on event formats, see Event Formats. This sample does not do any processing on the outgoing event. Use log event publisher, and log the published event to verify if the messages have been properly published.

Prerequisites

Set up the prerequisites required for all samples.

Building the sample 

Start the WSO2 DAS server with the sample configuration numbered 0062. For instructions, see Starting sample CEP configurations.

This sample configuration does the following:

  • Changes the default Axis2 repo from  <DAS_HOME>/repository/deployment/server to <DAS_HOME>/samples/cep/artifacts/0062
  • Creates three streams with the following IDs:
    • org.wso2.event.transaction.stream:1.0.0
    • org.wso2.event.keyword.stream:1.0.0
    • org.wso2.event.message.stream:1.0.0
  • Loads the events-xml.csv, events-json.csv, events-text.csv and related configuration files so that the Event Simulator can be used to send events to the three different pre-configured event publishers.
  • Creates the following three event publishers to log the received messages via an HTTP servlet receiver:
    • httpXml - Publishes events in default XML event format
    • httpJson - Publishes events in default JSON event format
    • httpText - Publishes the event as a customized text message

Executing the sample

  1. Open another terminal, go to <DAS_HOME>/samples/cep/consumers/generic-log-service and run the following command:

        ant -Dsn=0062

    It builds the servlet web application that logs any HTTP traffic it receives. Events published by the http event publisher are sent to this web application and logged. 

  2. Log into the DAS Management Console. Click Tools tab => Event Simulator to open the Event Stream Simulator page. In the Event Stream Name field, select the required event stream. Then click Play for the required file in the Send multiple events section.
     

    The following streams are configured to publish the following event formats via the different pre-configured http event output adapters.

    • org.wso2.event.transaction.stream:1.0.0:XML - via httpXml event publisher
    • org.wso2.event.keyword.stream:1.0.0: JSON - via httpJson event publisher
    • org.wso2.event.message.stream:1.0.0 : Text - via httpText event publisher

    The events received by DAS are logged as follows in the DAS console by the generic-log-service web application.

  • No labels