1

If I have a distributed CEP setup with a JMS broker as the primary input.

Now if we tell our client application to send event to Topic X, the events will be distributed to each node in the CEP cluster, as each one will be listening on same Topic X. Will this lead to duplication of results (lets say if I am counting certain data field, now since each node is receiving duplicate data, will my count be double of actual value if I have a 2 node cluster)

Can the CEP work off a JMS Queue instead of a Topic ? This way which ever node gets the event data first will consume the message off the Queue ? Does WSO2 CEP support JMS Queues ?

Community
  • 1
  • 1
Rajiv Patil
  • 129
  • 8

1 Answers1

2

No, currently (CEP 2.0.1) does not have support to receive events from JMS queue. But if this is your requirement then you can write your own CEP addeptor(broker) to receive events from a queue and push that to CEP.

To create a custom broker

Create an appropriate Broker Type by extending org.wso2.carbon.broker.core.BrokerType and an appropriate Broker Type Factory by extending the org.wso2.carbon.broker.core.BrokerTypeFactory from the jar org.wso2.carbon.broker.core-4.0.5.jar

Then to configure that broker with the CEP create a file called "broker.xml" at wso2cep-2.0.1/repository/conf and add the following XML: <brokerTypes xmlns="http://wso2.org/carbon/broker"> <brokerType class="<<class reference>>" /> ... </brokerTypes>

Find a detail documentation on creating a custom broker at http://suhothayan.blogspot.com/2013/02/writing-custom-broker-for-wso2-cep.html

suho
  • 912
  • 6
  • 12
  • Will the procedure for custom broker be any different for wsocep 2.0.0 ? We are working with 2.0.0 in our current setup – Rajiv Patil Jan 29 '13 at 05:39
  • Hi I have implemented the Custom Broker and the Factory and added the broker.xml with following entries in conf. But after this, I get null point exception in BrokerManagerAdminServer at line 149. . Please advise – Rajiv Patil Feb 01 '13 at 11:54
  • @RajivPatil I have improved the answer, you will be able to make this work with WSO2CEP 2.1.0, which will be released in a week. – suho Feb 18 '13 at 18:55