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

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

Related

Exceptional Cases In wso2 Message Broker

I am using wso2 message broker as a message brokering system in my project. Before using wso2 message broker, I want to explore exceptional cases related to wso2 message broker queue/topic -
How many messages queue/topic can store if consumer is down and publisher is continuously sending message to queue/topic ?
What will happen if queue/topic is not available and publisher is trying to post message in queue/topic?
What is the maximum size of message queue/topic can store ? Is it configurable ?
What is the JSON message format of wso2 message broker?
Can consumer sends response to publisher after getting message from queue/topic ? If yes, How ?
What is the duration of queue/topic session timeout ? Is it configurable ?
Please find answers below.
How many messages queue/topic can store if consumer is down and publisher is continuously sending message to queue/topic ?
This depends on how much space is allocated for MB server. The messages are persisted into the DB.
What will happen if queue/topic is not available and publisher is
trying to post message in queue/topic?
Message Broker will not accept the messages. Will simply drop them.
What is the maximum size of message queue/topic can store ? Is it
configurable ?
There is no defined limit. But MB is tested with upto 10MB messages. But the performance degrades drastically as the message size grows.
What is the JSON message format of wso2 message broker?
There is no such thing.
Can consumer sends response to publisher after getting message from
queue/topic ? If yes, How ?
This is not actually supported by AMQP. In AMQP the publisher and the subscriber is decoupled. SO through WSO2 MB you cannot get this done.
What is the duration of queue/topic session timeout ? Is it
configurable ?
This can be set from the client side when connection is made.

WSO2 ESB scheduled message forwarding processor becomes inactive after reaching max delivery attempt

I tried to follow this link , and I did it step by step for four time, for the first 3 times I used WSO2 MB as a broker, and the last time I tried Apache ActiveMQ but the problem is, when I shut down SimpleQuoteService server and send messages to the proxy via SoapUI , they accumulate in my queue and my scheduled message forwarding processor becomes inactivated after reaching max delivery attempts but WSO2-ESB documentation is sayinq :
"To test the failover scenario, shut down the JMS broker(i.e., the original message store) and send a few messages to the proxy service.
You will see that the messages are not sent to the back-end since the original message store is not available. You will also see that the messages are stored in the failover message store."
Anyone to explain?!!!
You can disable deactivating the message processor setting "max.delivery.drop" parameter to 'Enabled'. It will drop the message after max delivery attempts without deactivating the processor. See here for docs(definitions) of these parameters.

Does Message Sampling Processor in WSO2 ESB support reliable messaging

In WSO2ESB the message sampling processor de-queues the messages from the queue and forward it to a sequence where we can do transformation to the request and send to the back - end. And
The main purpose of using MSMP is for archiving guaranteed delivery, or in other words, to archive reliable messaging. [Source]
But when we use Message Sampling Processor it just forward the message to sequence and the processor doesn't know whether the message successfully delivered to the back end (using send | call mediator) or the processor knows this and restore the message in the queue?
I tried this scenario using JMS-Message Store (WSO2MB) and what I found is, message get lost when the back end service is down.
Message Sampling processor does not support reliable messaging[1]. For reliable messaging you will have to use Message Forwarding processor[2]
[1] - https://docs.wso2.com/display/ESB481/Message+Sampling+Processor
[2] - https://docs.wso2.com/display/ESB481/Message+Forwarding+Processor

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

Distributed WSO2 CEP

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