我们有一个javax.ejb.TimedObject像这样将消息排队到 MDB...
ctx = new InitialContext();
QueueConnectionFactory qCF = (QueueConnectionFactory) ctx
.lookup("java:comp/env/jms/queueconnfactory");
Queue q = (Queue) ctx.lookup("java:comp/env/jms/queue");
conn = qCF.createQueueConnection();
session = conn.createQueueSession(true,
Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(q);
TextMessage txtMsg = session.createTextMessage();
txtMsg.setLongProperty(JobMonitorUtil.JOB_REFERENCE_ID, filingId);
txtMsg.setLongProperty(JobMonitorUtil.JOB_ID, jobId);
txtMsg.setLongProperty(JobMonitorUtil.JOB_RUN_SID, jobRunSId);
sender.send(txtMsg);
session.close();
conn.close();
当我调试这个(在 Weblogic 10.3.1.0 上)时,我越过了 sender.sent(txtMsg) 行,我希望我的 onMessage 断点几乎立即被击中。直到我让 ejbTimeout 运行(实际上是当我退出 TimerImpl.timerExpired 时),它才达到我的断点。消息队列位于生成消息的同一台服务器上。
对我来说,这似乎很奇怪。
- MDB 消息不是异步发送的吗?
- 这可能是配置问题还是它应该如何工作?