Receiving messages from WSO2 Message Broker with Process Server - jms

I successfully configured WSO2 Message Broker as a JMS server. I have configured WSO2 ESB to send messages to a queue, and I can see this queue get created in MB with messages.
Now, I want to consume those messages with Process Server and kick off a BPEL process. I have added the required libraries to components/lib in both ESB and BPS, and have created an identical jndi.properties in both. The URL for both ESB and BPEL is:
jms:/newMLECaseQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=queue
I have tested a similar configuration with ActiveMQ, and there BPEL succesfully picked up the messages. In MB it does not seem to work, while the logging mentions that JMS started to listen:
Started to listen on destination : newMLECaseQueue of type queue for service newMLECaseQueue {org.apache.axis2.transport.jms.JMSListener}
What can be wrong here?

It appears that each queue must be registered using jndi.properties: when adding the queue with the line:
queue.newMLECaseQueue = newMLECaseQueue
it all started to work.

Related

Spring Rabbit mq Listner complete the process even if is killed

I have integrated rabbitmq in a spring application.In my application i am doing indexing on solr using rabbit mq.
On my every queue i have set only one listner.
I want to stop the listner on message progess.But the problem is that when i am going to stop the listner by registry.stop the rabbit mq ui and logs showing that the listner is stopped. but the message on which it works sucessfully index on solr.
As per my knowledge after killing the listner, the message also not going to further process.
That's not correct. It just stops to consume more messages from the queue. Currently in-flight messages are processed gracefully. Why would one want do not do that? You would lose the data which was consumed and acknowledged on the broker.

How to automatically read/receive message from solace queue when application started?

I want to automatically read/receive messages from solace queue/topic if any message produced or published when my application is up. So is there any method in solace which can open connection automatically if there is any message available in Queue/Topic.
So is there any method in solace which can open connection automatically if there is any message available in Queue/Topic
This is not possible for JMS.
JMS applications initiate a connection to the broker and receive messages over the locally initiated connection.
The only way to do what you want is to use REST instead of JMS.
When a REST consumer is configured, the Solace event broker will initiate a HTTP connection to the application.
A sample can be found here:
https://solace.com/samples/solace-samples-rest-messaging/publish-subscribe/

Send Active MQ messages throught Camel that were sent to a AMQ topic while Camel was down

I have configured an Active MQ server that puts messages to a determined topic, in that moment a configured Camel server take this message and send it by a route to another server, the issue happens when Camel server is down and the Active MQ still continues putting messages in the topic and when Camel starts these past messages are not read by Camel, is there any way to configure Camel to start and read past messages from this Active MQ Server?
Its ActiveMQ / JMS questions. Take a look at durable topics
http://activemq.apache.org/how-do-durable-queues-and-topics-work.html

wso2 ESB - Proxy - WebSphere MQ Input, WebSphere MQ Output - Without Message Loss

I am after the wso2 configuration/source code for a wso2 ESB proxy that can read from a WebSphere MQ Queue and write to a WebSphere MQ Queue. One way, no response.
We need reliability, i.e. the message can never be lost. No matter what the failure scenario. For any failures writing to the output queue, the message should be rolled-back to the input queue (this probably means the message should be read from the input queue using a transaction and/or client acknowledgement mode).
Examples of failures are:
Output queue full, MQRC 2053
Output queue does not exist, MQRC 2085
Output queue put inhibited
Output queue max msg size smaller than the size of the message to be sent.
Application does not have authority to send to output queue, MQRC 2035
Ideally we are trying to do this using just a wso2 ESB proxy, not a wso2 message store or wso2 message processor. Please clarify if this is possible to do using only the wso2 esb proxy, and not the other components. If this is not possible, please provide full configuration using the message store and message processor.
I am able to create a wso2 proxy to read from WebSphere MQ and write to WebSphere MQ, however in any of the failure scenarios above we lose messages.
Update at 1 June 2015: wso2 support have replicated this issue and are looking into supplying a fix/solution. I am using wso2 ESB 4.8.1.
In your proxy definition, add thoses parameters :
<parameter name="transport.jms.SessionAcknowledgement">CLIENT_ACKNOWLEDGE</parameter>
<parameter name="transport.jms.SessionTransacted">true</parameter>
In it's faultSequence : add this property :
<property name="SET_ROLLBACK_ONLY" value="true" scope="axis2"/>
You must not use "send" mediator in your inSequence, because it works asynchronously and the inSequence ends before the outSequence receive the response (or before the faultSequence receive the fault) : as soon as the inSequence ends, if property "SET_ROLLBACK_ONLY" has not been set, dequeue of the message is committed !
You can use "call" mediator. Property "ClientApiNonBlocking" can be usefull in some cases. You can use "filter" mediator after "call" mediator in your inSequence to analyse the response and decide to rollback the transaction setting "SET_ROLLBACK_ONLY" property.

How to add re delivery delay in WSO2 Message Broker like ActiveMQ

I have successfully configured the WSO2 Message Broker with my WSO2 ESB. I have also implemented successfully the JMS Transactions. It means that if there is an error in Service Normal Flow, Message will be rolledback.
Problem:
Previously i have configured the ActiveMq with my ESB. In that Setup i have a configuration in {ESB_HOME}/repository/conf/axis2/axis2.xml. This configuration donates the "Re-delivery Delay". This time is used to tell the MessageBroker(ActiveMQ) that when you are attempting to redeliver the message, you have to wait for this time before trying again.
<parameter name="redeliveryPolicy.redeliveryDelay" locked="true">1200000</parameter>
WSO2 Message Broker:
I want to achieve the same result in WSO2 Message Broker. I think it had to do with some configuration in {MB_HOME}/repository/conf/advanced/andes-config.xml. But i am unable to find that particular configuration setting anywhere in Message Broker.
Note: I am using WSO2 ESB 4.8.1 and WSO2 Message Broker 2.2.0.
What i want to achieve:
My goal is that i should be able to tell WSO2 Message Broker like ActiveMQ that you must take this much time before trying to re-deliver the message.
As I know it cannot be done like this in case of WSO2 MB. You have to setup a message store and a message processor guarding on that message store. And when you have a message processor it can be configured with interval and max delivery attempts.
https://docs.wso2.com/display/IntegrationPatterns/Dead+Letter+Channel
http://charith.wickramaarachchi.org/2012/05/another-message-redelivery-pattern-with.html
http://wso2.org/library/articles/2011/10/implementing-store-forward-messaging-patterns-wso2esb-part-1
http://wso2.com/library/articles/2011/12/implementing-store-forward-messaging-patterns-wso2esb-part-2/
(Alternatively, you can setup the maxAckWaitTime, it means it will wait at least 'maxAckWaitTime' seconds between two redelivery attempts)

Resources