WebSphere和Rollback消息

时间:2017-07-10 14:11:44

标签: java java-ee-6 websphere-8

请您澄清以下问题。如果Message Driven Bean无法处理消息,是否可以将消息返回到队列。我的代码喜欢:

public void onMessage(Message message) {
        try {
           doSomethingWithMessage(message)  
         } catch (QueueListenerUtilException e) {
            LOG.error("Could not process given message try to rollback transaction");
            mdc.setRollbackOnly();
            throw e;
        }
        LOG.debug("Sending message has been started");

      this.simCntrlUtil.writeToQueue(answer, message, msgProp);
        LOG.info(" onMessage has been completed");
    }

我认为如果bean抛出RuntimeException,则事务将被回滚,超时后将再次传递。在服务器日志中,我看到消息 “由于setRollbackOnly()被称为”

,因此资源回滚

但是超时后消息不再发送。我认为相应的选项是在WebSphere配置中设置的。

这个

重复邮件失败时自动停止端点  启用

顺序失败的消息阈值

100

重试失败之间的延迟

10000  毫秒

事务由容器管理(我没有更改dedault初始化) 能帮助我理解一下:为什么我再也看不到消息了?

提前谢谢

0 个答案:

没有答案