Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Open a new terminal, go to <CEP_HOME>/samples/consumers/generic-log-service and run the command below. It builds the sample log service web app and deploys in the webapps repository that is relevant to the sample.

    Code Block
    ant -DsampleNo=0105
  2. See the logs in CEP server when logger service is deploying. For example,

    Image Removed
    After deployment, the Web app is able to receive messages sent from the CEP server. Go to the management console and select the Try this service option . (Main --> Services )
    Image Removed

  3. Then you will redirected to a UI shown below, then change the endpoint and body as shown below and click on send.
    Image Removed

    Endpoint - http://10.100.0.44:9763/services/SoapInputAdaptor/ATMTransactionStats
    Body - Event 1

    Code Block
    <body>
    	<atmdata:ATMTransactionStatsStream xmlns:atmdata="http://samples.wso2.org/">
    		<atmdata:ATMTransactionStat>
    		<atmdata:CardNo>ED936784773</atmdata:CardNo>
    		<atmdata:CardHolderName>Mohan</atmdata:CardHolderName>
    		<atmdata:AmountWithdrawed>80</atmdata:AmountWithdrawed>
    		<atmdata:TransactionTime>PDT 11:00</atmdata:TransactionTime>
    		<atmdata:Location>Newyork</atmdata:Location>
    		<atmdata:BankName>Bank of Newyork</atmdata:BankName>
    		<atmdata:AccountNo>8957836745</atmdata:AccountNo>
    		<atmdata:CardHolderMobile>9667339388</atmdata:CardHolderMobile>
    		</atmdata:ATMTransactionStat>
    	</atmdata:ATMTransactionStatsStream>
    </body>
  4. Similarly send the following ATM stat events as well through the try it feature.

    Event 2

    Code Block
    <body>
    	<atmdata:ATMTransactionStatsStream xmlns:atmdata="http://samples.wso2.org/">
    		<atmdata:ATMTransactionStat>
    		<atmdata:CardNo>BC78946623</atmdata:CardNo>
    		<atmdata:CardHolderName>John</atmdata:CardHolderName>
    		<atmdata:AmountWithdrawed>1000</atmdata:AmountWithdrawed>
    		<atmdata:TransactionTime>PDT 01:00</atmdata:TransactionTime>
    		<atmdata:Location>California</atmdata:Location>
    		<atmdata:BankName>Bank of Wonder</atmdata:BankName>
    		<atmdata:AccountNo>PDT 12:00</atmdata:AccountNo>
    		<atmdata:CardHolderMobile>94729327932</atmdata:CardHolderMobile>
    		</atmdata:ATMTransactionStat>
    	</atmdata:ATMTransactionStatsStream>
    </body>

    Event 3

    Code Block
    <body>
    	<atmdata:ATMTransactionStatsStream xmlns:atmdata="http://samples.wso2.org/">
    		<atmdata:ATMTransactionStat>
    		<atmdata:CardNo>GH679893232</atmdata:CardNo>
    		<atmdata:CardHolderName>Tom</atmdata:CardHolderName>
    		<atmdata:AmountWithdrawed>900</atmdata:AmountWithdrawed>
    		<atmdata:TransactionTime>PDT 02:00</atmdata:TransactionTime>
    		<atmdata:Location>Texas</atmdata:Location>
    		<atmdata:BankName>Bank of Greenwich</atmdata:BankName>
    		<atmdata:AccountNo>783233422</atmdata:AccountNo>
    		<atmdata:CardHolderMobile>98434345532</atmdata:CardHolderMobile>
    		</atmdata:ATMTransactionStat>
    	</atmdata:ATMTransactionStatsStream>
    </body>

    Event 4

    Code Block
    <body>
    	<atmdata:ATMTransactionStatsStream xmlns:atmdata="http://samples.wso2.org/">
    		<atmdata:ATMTransactionStat>
    		<atmdata:CardNo>ED936784773</atmdata:CardNo>
    		<atmdata:CardHolderName>Mohan</atmdata:CardHolderName>
    		<atmdata:AmountWithdrawed>15000</atmdata:AmountWithdrawed>
    		<atmdata:TransactionTime>PDT 03:00</atmdata:TransactionTime>
    		<atmdata:Location>Newyork</atmdata:Location>
    		<atmdata:BankName>Bank of Newyork</atmdata:BankName>
    		<atmdata:AccountNo>8957836745</atmdata:AccountNo>
    		<atmdata:CardHolderMobile>9667339388</atmdata:CardHolderMobile>
    		</atmdata:ATMTransactionStat>
    	</atmdata:ATMTransactionStatsStream>
    </body>

    From the terminal opened when starting the CEP server, you can see the processed events which emitted by CEP.

    For example, given below is part of the console output of the consumer when sending events through Try-it service. 

    Image RemovedNow go to <CEP_HOME>/samples/producers/http and execute the following command.

    Code Block
    ant -Durl=http://localhost:9763/endpoints/packageArrivalsHTTPReceiver -DfilePath=../../artifacts/0105/arrivalEvents.txt


    This reads the arrivalEvents.txt file which contains a few sample arrival events and then sends it to the url given.

  5. Then execute the following command:

    Code Block
    ant -Durl=http://localhost:9763/endpoints/packageDeliveryHTTPReceiver -DfilePath=../../artifacts/0105/deliveryEvents.txt

    This reads the deliveryEvents.txt file which contains some sample delivery events and then sends it tot the url given.

  6. After 2 minutes, we can see the outputs on the console as follows.

    Image Added