What can be the reason of this problem?
Connection, Session were closed at the end.
I use WebLogic as JMS Broker. And I didn't find autodelete after receive option in JMS Queue configuration.
Related
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/
I'm trying to subscribe to a topic using durable and shared enabled, so that multiple instance can be connected to a topic to increase the scalability.
However, only the first instance getting connected without any errors, the second instance message listener keeps throwing the below error messages. I checked with my Webmethods counterpart and he found that the client state was disabled and that's why second listener was not able to connect using the same subscription name.
Can someone throw light on this issue please.
18:14:15,050 WARN
[org.springframework.jms.listener.DefaultMessageListenerContainer]
(DefaultMessageListenerContainer-145) Setup of JMS message listener
invoker failed for destination 'topicName' - trying to recover. Cause:
[BRM.10.2209] JMS: Durable subscription
"connectionFactory##subscriptionName" is in use.
The message
JMS: Durable subscription "connectionFactory##subscriptionName" is in use.
typically hints at a misconfiguration of your Topic on Broker. Please check (with MWS) that the Topic really has "Shared State=true“:
Then make sure your Connection Factory has a „Connection Factory Client ID“ set:
And finally you should set the following JVM setting:
-Dcom.webmethods.jms.clientIDSharing=true
Relating to this question (JMS Connection Pooling in Message Listener), i'm currently trying to build a session pool upon a pool of connections that i'd created earlier.
I had managed to create a pool of JMS Connections and when i run it with my Producers and Consumers, they work fine. The Consumers is registered with a Message Listener to retrieve messages from the MQ.
However when i implemented the session pool, the message listener just stop working. The producers can send message out without problem, but the message listener never fired off.
The following code is the create code in the JmsSessionObjectFactory:
Connection connection = Application.getInstance().getConnectionPool().borrowObject();
Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
Application.getInstance().getConnectionPool().returnObject(connection);
Is that the correct way to implement the factory creation for a session? Or my concept of session pooling with the connection pool is wrong?
Appreciate any advice. Thank you.
Is there a way I can set some properties to disable DLQ for a queue from the client configuration. I use SpringJMS for configuring my listeners.
I looked at
http://activemq.apache.org/message-redelivery-and-dlq-handling.html but that looks to be on the ActiveMQ Server side. Can I set something like IndividualDeadLetterStrategy for connectionFactory or listenercontainer? In my case, just disabling it from the client for all messages sent from that client would do.
No, this is a Broker side configuration and cannot be tweaked from the client end.
ActiveMQ pushes messages into DLQ only if you are throwing an error from Message Listeners. So you can catch the exceptions and avoid pushing to DLQ
Can anyone please explain me what is the impact of Session.AUTO_ACKNOWLEDGE for ActiveMQ JMS configurations
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
I believe by default ActiveMQ is set to auto acknowledge messages. This just means that when a message arrives it will automatically acknowledge that the message arrived. It is the same thing as calling .acknowledge() from the JMS object.
One reason to turn auto-acknowledge off is if you built a server and lets say you are processing each JMS Message and are doing some sort of DB transaction. If the transaction fails you would want the JMS message to be re-sent so you can fix your error and process it again. So in this sense you would only acknowledge the JMS object only after processing.