I have JMS messages sent to the IBM MQ queue if the remote client (I do not control the remote client) does not consume the message in a certain amount of time (say 1 minute) The message should expire (I have an Expire job, "MQ deletes the message" using setExplicitQosEnabled and setTimeToLive on the JMSTemplate), and the sender of the message (My SI Code) must be notified that the message was not delivered to the remote client so that the expired message can be redirected to another queue.
I'm not sure how to implement this template using Spring Integration, especially when messages are sent asynchronously and only correlated with return (MessageID → CorrelationID).
I thought I could have some form:
1) ErrorMessageExceptionTypeRouter, but I need a payload, so I can send the message again, and I'm not sure how to implement it (how to call back from MQ to JMSTemplate or Route to another Queue on Time out and have a secondary route listening to this queue and redirecting)
2) WireTap, but I think that this would mean blocking threads on the sender (request / response model) with a timer that monitors msg removal by the remote client. Again, I'm not sure how to implement this.
Any help on how to best implement the above is much appreciated.
:
MQ, JMSTemplate.receiveSelected(destination, messageSelector);, . , , . ( messageID , , TimeToLive). ( ) , . , IBM MQ , : JMSTemplate.receiveSelected(destination, messageSelector); :
org.springframework.jms.InvalidSelectorException: JMSWMQ2008: Failed to open MQ queue ‘MY.TEST.IN'.; nested exception is com.ibm.msg.client.jms.DetailedInvalidSelectorException: JMSWMQ2008: Failed to open MQ queue 'MY.TEST.IN'.
JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2459' ('MQRC_SELECTOR_SYNTAX_ERROR').
JMSTemplate.receive(destination); .