Distributed WSO2 CEP - wso2

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 ?

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

Related

Acknowledging message receipt with Amazon MQ and Lambda functions

I have a Lambda function that's triggered by Amazon MQ running ActiveMQ.
I would like my Lambda function to acknowledge receipt of the message once it has been processed so that ActiveMQ can remove it from the queue or topic.
I can't find any relevant documentation on AWS that tells me how I'm supposed to send that acknowledgement back, or how ActiveMQ will know when a consumer has successfully processed a message.
Any ideas?
If Lambda is using the OpenWire JMS client as noted in their documentation then it must be using one of the acknowledgement modes provided by JMS (i.e. AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE). However, I don't see any indication in the documentation which mode they're using and any way it can be changed. Therefore my guess is that they're using AUTO_ACKNOWLEDGE since that's usually what integration frameworks, etc. use by default. If that's true then there's nothing your Lambda function needs to do. The message will be acknowledged automatically by the OpenWire JMS client.

Messages are not automatically moved to dead letter channel (DLC) - broker - wso2 ei

Im using WSO2 EI 6.1.1 with Message Broker, and trying to create message queue with message store and message process with an endpoint.
When I shutdown my endpoint, the message processor is deactivated and the messages stay in the queue and they are not moved to DLC.
What should I do to make it work ?
Thanks,
Faris Shomou
This is the expected behavior with message processor / message store :
A scheduled message processor will try to send the message until the
delivery is successfull (and offers you a way to implement guaranteed
delivery pattern)
A sampling message processor will send the message
in a non reliable way (it can be lost)
If you want to manage a JMS transaction and have the message to go in DLQ, use a jms inbound endpoint or jms proxy and set required parameters (transport.jms.SessionTransacted, transport.jms.SessionAcknowledgement : have a look to wso2 documentation https://docs.wso2.com/display/EI611/JMS+Transactions)
Message store / processor is used to implements Dead letter channel EIP : the jms store host the dead message and you don't want it to be moved elsewhere

wso2esb persistence message store

exist in WSO2-ESB a mechanism to save the messages in a persistent manner and handle the send retry in the event of a serious error (eg server crash) ?
Thank you
Gordon
You just have to use a Message Store plugged on a JMS Broker (a "JMS Message Store" that will use a JMS Queue) and a Message Processor that will dequeue messages from the store.
"store" mediator will be used inside a mediation to store a Message in the store
See https://docs.wso2.org/display/ESB481/Message+Stores
and https://docs.wso2.org/display/ESB481/Message+Processors

WSO2 CEP output event adaptor error

I am new to WSO2 CEP
I have created the entire flow to read the JMS message and split it using Text formatter. The problem is that when I try to push messages into the queue, it is not able to reach the the output event adaptor. I have a mysql event adaptor and configured it into my event formatter but I keep getting the below message in my log
[2014-02-13 21:20:06,347] ERROR - {ReceiverGroup} No receiver is reachable at reconnection, can't publish the events
[2014-02-13 21:20:06,352] ERROR - {AsyncDataPublisher} Reconnection failed for for tcp://localhost:7661
Can someone help me understand what is this tcp://localhost:7661 is all about
Regards
Subbu
tcp://localhost:7661 is the default port to which Thrift(WSO2 events are published). It seems a default event formatter has been created and trying to publish events to that port.
Can you check your list of event formatters and ensure that no event formatters of type WSO2Event are created. This event formatter might be automatically created if you set an exported stream to be 'pass-through' when creating the execution plan.
You can enable event tracing[1] and monitor to determine exactly upto which point the event is coming in your configured flow.
[1] http://docs.wso2.org/display/CEP300/CEP+Event+Tracer
HTH,
Lasantha

Can we Consume the Messages using wso2esb Jms

I am using wso2esb4.7.0 and ActiveMQ 5.8.0 versions
i followed wso2esb docs they provided store and forward message store policy
But i dont want store i just want to consume those messages which is already has been store
by my client application i wish to pool that messages for every 5 sec
Is it possible in wso2esb jms using ActiveMq
will you write sample code of proxy
<messageProcessor name="Duplicate5" class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" messageStore="Duplicate" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="interval">1000</parameter>
<parameter name="message.processor.reply.sequence">fault</parameter>
</messageProcessor>
i tried with this but its not working
To pull messages from the queue, you need to use JMS transport..Check JMS proxy for the samples..
The message store persists the messages in the form of serializable Java objects. This might contain certain underlying information(E.g.: Properties) which is not visible in the message when you view message details in the ActiveMQ console. The message processor uses such information stored by the store when processing the message. Therefore, as far as I understand, the message store and message processor should be used together if you want to make things functional.
If you're straightaway storing the received messages in ActiveMQ queue, you might have to configure the message consumer manually. Check this usecase [1].
And also look in to this blogpost example to get an idea [2].
[1] http://docs.wso2.org/wiki/display/ESB470/ESB+as+a+JMS+Consumer
[2] http://nuwanwimalasekara.blogspot.com/2013/04/jms-proxy-service-using-wso2-esb.html
Hope this helps.
You can not use the Message-processor alone, You must have combination of Message Store and message processor. if you want to understand the behavior of the Message Store and Message processor refer the blog some time back.
If you want to use listen/pull from the JMS using ESB you have to use ESB as a JMS Consumer. Please refer further on document to implementation detail.