Not able to send bulk messages to Solace MQ - jms

In my application we are using Solace MQ and use HermesJMS tool to send messages to MQ in the local environment.
When i try to send bulk messages to the MQ I get below mentioned Exception. I use Spring Integration code to consume message from the the Solace MQ
Caused by: com.solacesystems.jcsmp.transaction.RollbackException: Transaction '404' unexpectedly rolled back during commit attempt. (((Client name: ILCH-D889198/13740/#00020005 Local addr: 10.80.29.163:51052 Remote addr: appwpcuteai09.ntrs.com:55555) - ) com.solacesystems.jcsmp.JCSMPErrorResponseException: 503: Transaction Failure: The number of messages in the transaction exceeds the limit [Subcode:63])
at com.solacesystems.jcsmp.impl.transaction.TSState$StateCommitting.handleAsyncAdCtrl(TSState.java:528) ~[jcsmp-7.0.0.63.jar:?]
at com.solacesystems.jcsmp.impl.transaction.TransactedSessionImpl.handleControlMessage(TransactedSessionImpl.java:326) ~[jcsmp-7.0.0.63.jar:?]
at com.solacesystems.jcsmp.impl.transaction.TransactedSessionManager.dispatchAssuredCtrlMessage(TransactedSessionManager.java:91) ~[jcsmp-7.0.0.63.jar:?]
at com.solacesystems.jcsmp.impl.transaction.TransactedSessionManagerSmf.handleAsyncAssuredCtrlMessage(TransactedSessionManagerSmf.java:167) ~[jcsmp-7.0.0.63.jar:?]
is this exception related to some property in int-jms:message-driven-channel-adapter used from Spring integration or from Solace MQ properties. Please suggest.

The exception means that you are sending too many messages in a single transaction.
As of right now, Solace supports a maximum of 256 messages in a single transaction. Increasing the maximum is on Solace's feature candidate list, but not committed to a specific release yet.
For now, the only workaround is to reduce the number of messages in the transaction.

Related

Quarkus / Smallrye Reactive Messaging - message redelivery

I'm currently investigating the Smallrye Reactive Messaging integration in Quarkus.Sending and receiving messages is really simple and elegant at first glance.
But one thing which I didn't find out is: How to handle a re-delivery of messages?
Example: We receive a message and try to process it. Some exception (maybe a DB not available or an optimistic lock exception or something) happens.
In such a case I would throw an exception so that the message is not acknowledged. But currently I see no way how the message is redelivered.
I set-up a small dummy project to test this:
Quarkus
ActiveMQ Artemis
send a message (via Artemis console) into a queue
-- queue configured with max redelivery = 3
receive the message with Quarkus / Smallrye Reactive Messaging #Incoming annotation
throw exception in the #Incoming method
--> Message is removed from the Artemis queue
--> #Incoming method is only called once
If I shutdown the Quarkus App, the message can be seen again in the Artemis queue with redelivered flag set to true.
But I find no way how I can manage/configure a redelivery in the Smallrye Reactive Messaging so that this layer handles the redelivery of a message for n times and puts the message into a DLQ after the max retries.
Is there any way to do this?

How to configure DLQ for a failed message using Spring Boot jmsListener?

Please guide me as how to configure a DLQ for the failed message processing in Spring Boot JMS. I would like to send the failed messages to DLQ based on the error type. Ex, business error - send to DLQ, technical error - discard...
I found the solution. It should be through the JMS provider, in my case I had to configure a Backout queue for the listener queue and DLQ at the queue manager level

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/

Solace - Message delivery count

We are using Solace as messaging broker. How can I get the number of times a message is delivered from broker? In Jboss, there is a property called JMSXDeliveryCount. Is there anything similar in Solace?
The Solace JMS API is compliant with JMS1.1.
Unfortunately, JMSXDeliveryCount is an optional property in the JMS1.1 specification that is not implemented by the Solace JMS API.
For now, you can keep track of redelivered messages with JMSRedelivered, which does not provide the count.
If you are worried about application handling of "poisonous" messages - messages which cannot be consumed for some reason and need to be redelivered, you can make use of the "Max Redelivery" feature on the Solace endpoints. Messages will be moved to the Dead Message Queue or even configured to be discarded, when the message has been redelivered above the "Max Redelivery" count.
Support for JMSXDeliveryCount is in Solace's feature candidate list, and is likely to be implemented in a future release.

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.

Resources