...
Here we will publish events using an JMS client to a JMS topic called AllStockQuotes and fired outputs of the bucket will be send to a JMS topic called FastMovingStockQuotes, which which will be received using another JMS client and log in console.
...
- Apache Ant to build & deploy the Sample & Service, and to run the client. See Installation Prerequisites for instructions on for instructions on installing Apache Ant.
Steps to configure the sample
...
- Install the WSO2 Complex Event Processor. See the Installation Guide for instructions.
- Now start the WSO2 Complex Event Processor. See Running the Product for instructions.
- Start WSO2 Message Broker with a port offset one (assuming setup is done on a single machine). See Running WSO2 MB for instructions.
Then configure WSO2 Message Broker as the JMS Broker for CEP server as described in Using WSO2 MB as A JMS Broker for WSO2 CEP Server.
Info When CEP connects to MB, the
wso2server.sh
file needs to be updated with the following:system property -Dqpid.dest_syntax=BURL \
- Copy the above bucket configuration to
<CEP_HOME>/repository/deployment/server/cepbuckets
folder. Note that we have used the JMS Broker "MBJmsBroker" created at step 4 in the bucket configuration. - Now the bucket will be deployed at the CEP side. Please check the logs to verify.
...
- In a command prompt, switch to the FastMovingStockQuoteReceiverService services directory:
<CEP_HOME>/ samples/services/FastMovingStockQuoteReceiverService
For example, in Linux:cd <CEP_HOME> /samples/services/FastMovingStockQuoteReceiverService
- From there, type ant. This will deploy the FastMovingStockQuoteReceiverService in CEP itself. You can follow the server logs to check whether FastMovingStockQuoteReceiverService.arr has been properly deployed. You will also be able to see the axis2 service in the services list.
Configuring receiver service
We need to Configure to configure the FastMovingStockQuoteReceiverService in order to receive the output events emitted by the bucket the bucket under the FastMovingStockQuotes topic. Here we will be creating FastMovingStockQuotes topic in the WSO2 Message Broker and subscribe FastMovingStockQuoteReceiverService on subscribe FastMovingStockQuoteReceiverService on that topic.
The steps are as follows:
- Sign In. Enter your user name and password to log on to the Message Broker Management Console.
- Click Add under the Topics menu in the Manage section of the left panel.
- Specify the topic name in the topic input text box. In this case, the topic name is "FastMovingStockQuotes" (the output topic). Click Add Topic. The topic is added to the server and you will be directed to the Topic Browser page.
- Once you click on the topic in the topic browser page, you will be able see four links. Click the Subscribe link and you will be directed to the Subscribe page.
Create subscription with the following details. Once you are done click Subscribe.
No Format topic : FastMovingStockQuotes (Output topic) subscription mode: Topic only subscription URL : http://localhost:9763/services/FastMovingStockQuoteService/getOMElement expiration Time : select a future date from calender
Once you click Subscribe, you will be directed to the Topic Browser page.
You can verify whether you have correctly subscribed to the topic by clicking the Details link of that topic in the topic browser page.
Once you click on that, you will be directed to the "topic details" page and there you will find all the subscriptions for that topic and its children (in this case it does not exists) and permission on that topic. Apart from that with the Publish section, you can publish a test XML message to that topic and check whether your subscription URL has been properly subscribed.
...