春天MDP:轮询间隔? [英] Spring MDP: polling interval?

查看:222
本文介绍了春天MDP:轮询间隔?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个客户使用此模式:


  • Apache的骆驼和CXF JMS接收器

  • 这些内部使用Spring的MDP(消息驱动的POJO)来实现他们的信息接收器

  • 它们部署在IBM​​ WebSphere Application Server上7

  • 的队列管理器的IBM WebSphere MQ 6

  • 春季的MDP绑定到使用JNDI队列连接工厂队列管理器 - 为连接池和会话支持池

下面是这种消息接收机的一个例子,这一项是使用骆驼:

Here is an example of such message receiver, this one is using Camel:

<bean id="ibmmq" class="org.apache.camel.component.jms.JmsComponent">
    <property name="configuration" ref="jmsConfig"/>
</bean>

<!-- JNDI reference to the queue manager -->
<jee:jndi-lookup id="myTargetConnectionFactory" jndi-name="${mq.queueconnectionfactory}"/>

<bean id="jmsDestResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver"/>

<bean id="myConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
    <property name="targetConnectionFactory" ref="myTargetConnectionFactory"/>
    <property name="username" value="SOME_USER"/>
    <property name="password" value=""/>
</bean>

<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">

    <property name="connectionFactory" ref="${mq.connectionfactorybean}" />        
    <property name="destinationResolver" ref="jmsDestResolver" />        
    <property name="concurrentConsumers" value="1" />
    <property name="maxConcurrentConsumers" value="1" />

    <!--
        NOTE: If we try to use a cache without a transactionManager we get "Connection closed" errors
    -->
    <property name="cacheLevelName" value="CACHE_NONE" />
</bean>

问题:的WebSphere MQ的管理员报告MGET的啤酒数量()对队列管理器的请求。目前的假设是,这些接收器都在不断轮询新的消息渠道。

Problem: the WebSphere MQ administrators are reporting lager number of MGET() requests against the queue manager. The hypothesis at the moment is that those receiver are constantly polling the channel for new messages.

他们似乎并不存在这个问题与多边开发银行(消息驱动Bean)。是MDP异步实现真正轮询机制?如果是这样,有没有办法来限制前往队列管理器?也许增加轮询间隔?任何见解将是AP preciated。

They do not seem to have this problem with MDBs (message-driven beans). Is the MDP async implementation really a polling mechanism? If so, is there a way to limit the trips to the queue manager? Perhaps increasing the polling interval? Any insights would be appreciated.

推荐答案

我不知道CXF,但骆驼听众:

I am not sure about CXF, but for Camel listeners:

好像在JmsConfiguration默认JMS消费者的类型是违约。
的手段,它将从春天实施使用DefaultMessageListenerContainer。

It seems like a default JMS consumer in the JmsConfiguration is of type "Default". The means, it will implement a DefaultMessageListenerContainer from Spring.

从<一个href=\"http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/jms/listener/DefaultMessageListenerContainer.html\"相对=nofollow>的Javadoc

这是使用纯JMS客户端API,特别是一个MessageConsumer.receive环路(消息侦听器变种)调用

Message listener container variant that uses plain JMS client API, specifically a loop of MessageConsumer.receive() calls

接收呼叫将映射到MQ GET调用。

Receive calls would map to MQ GET calls.

有也是指定<一个选项href=\"http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/jms/listener/SimpleMessageListenerContainer.html\"相对=nofollow>消费,这是我猜的简单类型是你想要的。

There is also the option to specify a Simple type of consumer, which I guess is what you want.

消息侦听器()

我不知道这里,但春节文档表明,简单的消息监听器容器不支持XA交易。这可能是值得考虑的,因为你是一个应用服务器内部运行。

I am not sure here, but the Spring docs indicate that the simple message listener container does not support XA transactions. That might be something to consider, since you are running inside an application server.

这篇关于春天MDP:轮询间隔?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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