如何延迟JMS消息发送? [英] How do I delay JMS Message sending?

查看:113
本文介绍了如何延迟JMS消息发送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何延迟JMS消息发送或不确定的时间?

How do I delay JMS Message sending or proceed uncertain time?

我正在使用Weblogic,如您所知,在JMS发送之后,接收方将异步处理消息,但是,这时或有时外部资源尚未准备好用于接收方,因此,我想使用一些检查逻辑延迟发送或处理消息.我想举一个例子:我将消息放入待处理队列中,然后经常检查资源可用性,然后再发送或继续处理消息?

I am using Weblogic, as you know, after JMS sending, the receiver will process the message asynchronously, but, at this time or sometimes the external resource are not ready for the receiver, therefore, I want to have some check logic to delay send or process the message. I guess for example: I put the message into pending queue then frequently check the resource availability, once it is then send or proceed the message?

每个人都知道Weblogic是否支持此方法或如何实现它?

Do everybody know does Weblogic support this or how to implement it?

推荐答案

通常为了延迟接收消息直到资源准备就绪,不调用connection.start()方法.这是逻辑:

Normally to delay receiving of the messages until the resources are ready, the connection.start() method is not invoked. Here is the logic:

  1. 接收器启动并建立连接并设置所有JMS资源.
  2. 未调用connection.start().
  3. 等待其他资源初始化
  4. 使用connection.start()启动JMs连接

您甚至可以使用此方法暂停消息侦听器接收的消息.这种技术在使用JMS的GUI工具中非常普遍.

You can even pause the messages to be received by the message listener using this method. This technique is very common in GUI tools that use JMS.

这篇关于如何延迟JMS消息发送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆