如何执行对于联合国确认JMS消息重新传递 [英] how to enforce the redelivery for un acknowledge jms message

查看:190
本文介绍了如何执行对于联合国确认JMS消息重新传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读<一个href=\"http://www.javaworld.com/article/2074123/java-web-development/transaction-and-redelivery-in-jms.html?page=2\" rel=\"nofollow\">http://www.javaworld.com/article/2074123/java-web-development/transaction-and-redelivery-in-jms.html?page=2

一般来说,承认一个特定的消息确认了会话接收所有邮件之前(在客户端确认模式)

"Generally, acknowledging a particular message acknowledges all prior messages the session receives" ( in Client acknowledgement mode )

消息传输不是自动的,但消息却在某些情况下重新传递

"Message redelivery is not automatic, but messages are redelivered under certain circumstances"

我的问题:


  1. 我怎么能保证每次我recive消息(但重用连接)?时间还有一个新的会话

  2. 如何强制执行未确认消息重新传递?

即时通讯使用这个CONFIGRATION:

Im using this configration :

<bean id="jmsConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory"
            lazy-init="true">
            <property name="queueManager" value="${queueManager}" />
            <property name="hostName" value="${hostName}" />
            <property name="transportType" value="${transportType}" />
            <property name="port" value="${port}" />
            <property name="channel" value="${channel}" />
            <property name="SSLCipherSuite" value="${SSLCipherSuite}" />
      </bean>
<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
    <property name="maxConnections" value="10"/>
    <property name="maximumActive" value="100"/>
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
</bean>
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="pooledConnectionFactory"/>
    <property name="transacted" value="false"/>
 </bean>

<bean id="mqNonJmsDestRes" class="calypsox.tk.util.NonJmsMQQueueDestinationResolver" />

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
      <property name="configuration" ref="jmsConfig" />
       <property name="acknowledgementModeName" value="CLIENT_ACKNOWLEDGE" />
       <property name="destinationResolver" ref="mqNonJmsDestRes" />
 </bean>

和我用骆驼处理器作为终点bean作为单

and I use camel processor as endpoint bean as singleton

推荐答案

您引用的文章是从2002年起所有基于MQ系统自那时以来,已经收到了很多的工作。在您AMQ PooledConnectionFactory有设置来控制您的连接最后他们被摧毁过了多久,以及如果你遇到一个错误,你应该做的。我建议你​​阅读到一些较新的文件,因为出现了很大的变化,在过去14年。所以有些事情变得容易多了。

That article you referenced is from 2002. All of the MQ based systems have received a lot of work since then. On your AMQ PooledConnectionFactory there are settings to control how long your connections last before they are destroyed and what you should do if you encounter an error. I recommend reading into some of the newer documentation since there has been a lot of changes in the last 14 years. So some things have become much easier.

您也可以检查到的ExceptionListener的org.apache.camel.component.jms.JmsComponent配置如何管理例外,甚至写自己如果当前选项不符合您的需求。

You can also check into the exceptionListener on "org.apache.camel.component.jms.JmsComponent" to configure how to manage exceptions and even write your own if the current options don't suit your needs.

这篇关于如何执行对于联合国确认JMS消息重新传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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