简体   繁体   English

如何使用Apache Camel在IBM MQ消息头中设置到期时间

[英]how to set expiry in IBM MQ message header using Apache Camel

We are using Spring-Boot and Apache camel to connect to IBM MQ. 我们正在使用Spring-Boot和Apache骆驼来连接到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. 我们需要在MQMessages中设置到期时间,以便如果没有收到任何响应,则该消息应在60秒内到期。 We have added header like below : 我们添加了如下标题:

setHeader(WMQConstants.WMQ_EXPIRY, constant(600)); 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" ie the message will never expire. 它没有添加到MQMD标头中,并且在浏览消息时显示的到期值为“ -1”,即消息永不过期。

Could you please tell me how to set MQMD header in Apache Camel? 您能否告诉我如何在Apache Camel中设置MQMD标头?

查看Camel JMS手册,并已通过Spring JMS模板成功使用IBM MQ消息到期,您可能必须将Camel选项设置为liveQosEnabled explicitQosEnabled=truetimeToLive=60000 ,生存时间为60秒。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM