WSO2 SP upgrading from DAS

102 Views Asked by At

I am trying to upgrade from WSO2 DAS to SP; which involves rewriting the event flow definition with Siddhi SQL script.

my object is that all changes be restricted within Siddhi SQL script(thus within SP).

I am using DAS as a simple "Message Broker" in a micro service context.

as shown in the diagram:

enter image description here

there are three(3) micro services: A, B, C; service A calls service B, and C.

service A issues an "wso2event" with the wso2 data agent;

the event is received by a receiver (type="wso2event") in the DAS;

two(2) publishers (eventAdapterType="soap") were used to form two SOAP messages and published respectively to service B and C

below are my artifacts definitions:

stream:

{
  "name": "ip3c",
  "version": "1.0.0",
  "nickName": "ip3c.receiverservice.senderservice.follow",
  "description": "follow event from receiver to sender and userevent",
  "metaData": [
    {
      "name": "sender",
      "type": "STRING"
    }
  ],
  "correlationData": [
    {
      "name": "host",
      "type": "STRING"
    }
  ],
  "payloadData": [
    {
      "name": "message",
      "type": "STRING"
    }
  ]
}

receiver:

<?xml version="1.0" encoding="UTF-8"?>
<!-- gbb2.receiverservice.follow -->
<eventReceiver name="gbb2" statistics="disable"
               trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
    <from eventAdapterType="wso2event">
        <property name="receiving.events.duplicated.in.cluster">false</property>
    </from>
    <mapping customMapping="disable" type="wso2event"/>
    <to streamName="ip3c" version="1.0.0"/>
</eventReceiver>

publisher 1:

<?xml version="1.0" encoding="UTF-8"?>
<!-- pnbu.senderservice.follow -->
<eventPublisher name="pnbu" statistics="disable"
                trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
    <from streamName="ip3c" version="1.0.0"/>
    <mapping customMapping="enable" type="xml">
        <inline>
            <sen:follow  xmlns:sen="http://gubnoi.com/SenderService/">
                <sender>{{meta_sender}}</sender>
                <host>{{correlation_host}}</host>
                <message>{{message}}</message>
            </sen:follow>
        </inline>
    </mapping>   
    <to eventAdapterType="soap">
        <property name="soapHeaders">SOAPAction: http://gubnoi.com/SenderService/follow</property>
        <property name="url">http://sender.gubnoi.com:10102/services/SenderService/</property>
    </to>
</eventPublisher>

publisher 2:

<?xml version="1.0" encoding="UTF-8"?>
<!-- tvzh.userevent.receiverfollow -->
<eventPublisher name="tvzh" statistics="disable"
                trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
    <from streamName="ip3c" version="1.0.0"/>
    <mapping customMapping="enable" type="xml">
        <inline>
            <use:save xmlns:use="http://gubnoi.com/UserEvents/">
                <title>u5khurw3</title>
                <obj>{{meta_sender}}</obj>
                <host>{{correlation_host}}</host>
                <bucket>{{message}}</bucket>
            </use:save>
        </inline>
    </mapping>   
    <to eventAdapterType="soap">
        <property name="soapHeaders">SOAPAction: http://gubnoi.com/UserEvents/save</property>
        <property name="url">http://userevents.gubnoi.com:10304/services/UserEvents/</property>
    </to>
</eventPublisher>

I searched around, and could not find any useful examples.

Can anyone please give any help

thanks

1

There are 1 best solutions below

0
Chiran Fernando On

WSO2 Stream Processor has a documentation on upgrading from a previous release. You can refer the documentation to create siddhi artifact from your streams, receivers and publishers.