Is there any default retention period for messages on MQ Topic. In case consumer/client is not putting Expiry in MQ Header.
Related
I am using ActiveMQ Artemis 2.10 and JMS Client 1.1 client.
If I used the multicast routing type on my address and needed durable subscriptions, how do I achieve load balancing on the consumer side?
With ActiveMQ 5 it would be virtual destinations.
It is unclear how a consumer side load-balancing could be achieved with ActiveMQ Artemis 7.2 and JMS Client 1.1 client when consuming off durable subscriptions on a topic.
In the example above:
Each of the consumers would set the clientId (client123 and client456) in the example, but this would mean there can be only one instance of client123 consuming from client123.topic.foo.
My current understanding is that ActiveMQ Artemis 2.10 and JMS Client 1.1 client implies you cannot have load balancing on topics, would that be correct?
The only option seems to be ActiveMQ Artemis 2.10 and JMS Client 2.0 which allows you to create Shared Durable subscriptions, would that be correct?
Is there a 3rd option?
My current understanding is that Active MQ Artemis 7.2 and JMS Client 1.1 client implies you cannot have load balancing on topics, would that be correct?
No.
The only option seems to be Active MQ Artemis 7.2 and JMS Client 2.0 which allows you to create Shared Durable subscriptions, would that be correct?
No.
Is there a 3rd option?
Yes. You can use the durable subscription's fully qualified queue name with a JMS consumer. As noted in the JMS-to-core mapping document, a JMS topic is mapped to a core address and a subscription on that JMS topic is mapped to a core queue on the core address. In the case of a durable JMS subscription the name of that queue follows the pattern "<clientID>.<subscriptionName>". Here's some example code to demonstrate:
ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://127.0.0.1:61616");
Connection connection1 = cf.createConnection();
connection1.setClientID("myClientID");
Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = new ActiveMQTopic("myTopic");
MessageConsumer consumer1 = session1.createDurableSubscriber(topic, "mySubscriptionName");
Connection connection2 = cf.createConnection();
Session session2 = connection2.createSession();
Destination destination = new ActiveMQQueue("myTopic::myClientID.mySubscriptionName");
MessageConsumer consumer2 = session2.createConsumer(destination);
// Send 2 messages
MessageProducer producer = session1.createProducer(topic);
producer.send(session1.createMessage());
producer.send(session1.createMessage());
producer.close();
// Receive the first message with the first consumer
connection1.start();
Message message1 = consumer1.receive();
consumer1.close();
// Receive the second message with the second consumer
connection2.start();
Message message2 = consumer2.receive();
consumer2.close();
To say it another way...
Since JMS 1.1 doesn't explicitly allow shared durable subscriptions then you can't horizontally scale applications using createDurableSubscriber on the same topic with the same client identifier and subscription name. However, you can scale horizontally if one application uses createDurableSubscriber and all the others simply consume directly from the underlying subscription queue using its "fully qualified queue name" (which is derived from the client identifier and subscription name used when it was first created using createDurableSubscriber).
I have a wsadmin command to get list of JMS providers for all scope level
AdminJMS.listJMSProviders()
The above code is going to have the below output
['"WebSphere MQ JMS Provider(cells/redhatserverNode01Cell/nodes/redhatserverNode01/servers/server1|resources.xml#builtin_mqprovider)"',
'"WebSphere MQ JMS Provider(cells/redhatserverNode01Cell/nodes/redhatserverNode01|resources.xml#builtin_mqprovider)"',
'"WebSphere MQ JMS Provider(cells/redhatserverNode01Cell|resources.xml#builtin_mqprovider)"',
'sample(cells/redhatserverNode01Cell/nodes/redhatserverNode01/servers/server1|resources.xml#JMSProvider_1487316020150)']
what my question is
How to get JMS providers for particular scope
The above output displays all provider except default MQ messaging provider, how to get Default MQ messaging provider as well
I can't help you with displaying the default JMS provider, but you can use AdminConfig.list to filter by scope,
wsadmin>print AdminConfig.list('JMSProvider', '*cells/myCell/nodes/myNode/servers/server1*')
"WebSphere MQ JMS Provider(cells/myCell/nodes/myNode/servers/server1|resources.xml#builtin_mqprovider)"
wsadmin>print AdminConfig.list('JMSProvider', '*cells/myCell/nodes/myNode|*')
"WebSphere MQ JMS Provider(cells/myCell/nodes/myNode|resources.xml#builtin_mqprovider)"
wsadmin>print AdminConfig.list('JMSProvider', '*cells/myCell|*')
"WebSphere MQ JMS Provider(cells/myCell|resources.xml#builtin_mqprovider)"
We have IBM Websphere MQ 8.0 supporting JMS 2.0 .
Is there a way to set the delivery delay for a message, other than using JMS template's set delivery delay?
Specifically, in a message header , like in active MQ.
WebSphere MQ 8.0 does support delivery delay.
Here is the official doc page for JMS 2.0 delivery delay.
I don't think Websphere MQ supports delayed delivery, but I have not examined the version 8 docs.
I typically implement delayed delivery by storing the logical message in a DB and scheduling the send using a persistent scheduler like Quartz.
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.
In WAS console, on the Queues page, there is an option called 'Target Client' and the options are MQ and JMS. Now MQ i understand is websphere MQ, but what is JMS? Any JMS provider other than Websphere MQ? Because in my case the target is actually websphere MQ but i have selected JMS here and it still works fine.
Target client defines how the message will intepreted by the receiving application.
If you choose MQ, then a RFH2 header will be added with MQ specific info otherwise JMS info will be added (jms_bytes, jms_text etc..).
IBM has some info about it