简体   繁体   English

如何在 weblogic 10.3 服务器上延迟 JMS 消息

[英]how to delay JMS message in spring on weblogic 10.3 server

I want to delay message delivery by certain time which will be different for each message.我想将消息传递延迟特定时间,这对于每条消息都会有所不同。

I referred weblogic 10.3 WLMessage documentation which recommends using javax.jms.Message.getIntProperty("JMS_BEA_DeliveryTime") .我提到了推荐使用javax.jms.Message.getIntProperty("JMS_BEA_DeliveryTime") weblogic 10.3 WLMessage 文档

However I'm unable to figure out how do I set JMS_BEA_DeliveryTime as INTEGER .但是我无法弄清楚如何将JMS_BEA_DeliveryTime设置为INTEGER I was expecting it to be long .我期待它会long

I'm unable to find out any documentation about this attribute JMS_BEA_DeliveryTime to undesratand how to set and use it.我无法找到有关此属性JMS_BEA_DeliveryTime任何文档来解释如何设置和使用它。 Can anybody give example about how to set the desired delivery time or link to documenation of use of this attribute.任何人都可以举例说明如何设置所需的交付时间或链接到使用此属性的文档。

My code looks like typical use of Spring JMS template:我的代码看起来像 Spring JMS 模板的典型用法:

 jmsTemplate.send(destination, new MessageCreator() {
                public Message createMessage(Session session) throws JMSException {
                  TextMessage message = session.createTextMessage(textMessage);
                  return message;
                }
            });

I was wondering if it is possible to set header for delivery time before returning message.我想知道是否可以在返回消息之前设置传递时间的标头。

很好的文章,其中包含为不同的 JMS 提供程序延迟交付的示例,包括 WL。

Well there is this page which states那么有这个页面说明

JMS Delivery Time: The earliest absolute time at which 
                   a message can be delivered to a consumer.

It should be trivial to set with Message.setIntProperty(...) , there is not much mention as to what the time actually constitutes though, although I did find this article which suggests milliseconds from now.使用Message.setIntProperty(...)设置应该很简单,虽然我确实发现这篇文章建议从现在开始几毫秒,但没有太多提及时间实际构成的内容

Hope that helps.希望有帮助。

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

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