We are using Spring-Boot and Apache camel to connect to IBM MQ. We need to set expiry in MQMessages so that if we do not get any response , the message should expire in 60 sec. We have added header like below :
setHeader(WMQConstants.WMQ_EXPIRY, constant(600));
But the header is being added like :
<usr>
<breadcrumbId>ID-ff9c1ce374f9-1544430870241-0-2</breadcrumbId>
<expiry dt='i4'>60000</expiry>
it is not adding to MQMD header and while browsing the message it is showing the expiry value as "-1" i.e the message will never expire.
Could you please tell me how to set MQMD header in Apache Camel?
Looking at the Camel JMS manual and having successfully used IBM MQ message expiry via Spring JMS template, you probably have to set the Camel options explicitQosEnabled=true and timeToLive=60000 for a 60 seconds time-to-live.
Related
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.
I have a web application that will launch a message (say start processing) on the MQ message queue. I have a consumer and the producer configuration defined using the Camel Spring DSL. I want to push a message from a web application and only that session and client should get the response. Could I use the jsessionid and maybe some other random message id to set the message so only that client will get the response?
E.g. Imagine Camel Spring DSL xml configuration:
<route id="webRequestToInRoute">
<to uri="activemq:queue:inbox :::: here I want to getJsessionId() as the message ... name?"/>
</route>
More importantly, what are ways that I can communicate between the browser to the camel rest service to the JMS route, mainly to pull the status?
Web app session publishes message
set JMSReplyTo header on the message to: temp-queue://ORDER.$jSessionId
setup a consumer on temp-queue://ORDER.$jSessionId
send to -> queue://PROCESS.ORDER
On the REST service
Consume from queue://PROCESS.ORDER
Do stuff with message
Publish response to temp-queue://ORDER.$jSessionId
Once there are no longer messages, consumers or producers the broker will automatically delete the temp-queue, so there is no clean-up necassary
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)
I am trying to send jms message with JMeter (Publisher or Point-to-point), but I am not able to send JMSType.
If I put it to JMS properties with name JMSType it finishes with error:
Response message: The property name 'JMSType' is illegal since it starts with JMS
By default Jmeter does not include any JMS implementation jars in its distribution. This must be downloaded from the JMS provider and put in the lib directory of Jmeter.
I have tested this in Jmeter 2.9 and 2.13. You can set JMS header properties including JMSType in the JMS properties tab and publish a message successfully without any errors.
So the answer is no it is not possible. I've changed it in jMeter sources for me. It is probably specific for queue vendors. Any of them allow setting properties as text property the others requires to set it directly to message as there is the JMSType parameter and when you try to set the string 'JMS*' parameter tou got exception.
When sending (InOnly) JMS messages with Apache Camel, can I read back the different JMS headers that might have been set automatically on the message, when it was sent?
from("foo:bar")
.to(ExchangePattern.InOnly,"jms:queue:whatever")
.log("msg id set = ${in.header.JMSMessageId}");
I just can't figure out how to send the message "one way" but keeping the sent JMS message as "in" message in the route afterwards.
Background:
I know that I can present some values, but it would be easier if they where set by the actual JMS implementation. For instance, in this case, I want to work with WebSphere SIBus, WebSphere MQ and ActiveMQ. It's best to rely on WebSphere MQs internal message id format, because it will only index certain message formats. It might be similar aspects on the WebSphere SIBus implementation.
This feature is available starting at 2.10.3 and 2.11.0.