首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jboss EAP 5.1 - MDB与IBM Websphere MQ集成-处理的并发消息太少

Jboss EAP 5.1 - MDB与IBM Websphere MQ集成-处理的并发消息太少
EN

Stack Overflow用户
提问于 2014-10-18 11:07:44
回答 1查看 608关注 0票数 3

我已经尝试了很多Jboss参数,但是我没有成功地让我的MDB一次处理10个以上的并发消息。这不足以满足我的需求--我需要更多的并发消息处理。我已经完全想不出主意了。有人有什么建议吗?

我的MDB (将所有内容定义为一个方面域,但将其移动):

代码语言:javascript
复制
@MessageDriven(name = "Incoming Task MDB", activationConfig = {  
    @ActivationConfigProperty(propertyName = "messagingType", propertyValue = "javax.jms.MessageListener"),  
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),  
    @ActivationConfigProperty(propertyName = "destination", propertyValue = "TaskQueue"),  
    @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false") })  
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)  
@TransactionManagement(value = TransactionManagementType.BEAN)  
// @AspectDomain("Task Queue MDB")  JBOSS Specific annotation to inject the MQ server session at runtime  
@ResourceAdapter("wmq.jmsra.rar")  
@org.jboss.ejb3.annotation.DefaultActivationSpecs ({  
     @javax.ejb.ActivationConfigProperty(propertyName = "channel", propertyValue = "..."),  
     @javax.ejb.ActivationConfigProperty(propertyName = "hostName", propertyValue = "..."),  
    @javax.ejb.ActivationConfigProperty(propertyName = "queueManager", propertyValue = "..."),  
     @javax.ejb.ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),  
     @javax.ejb.ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),  
     @javax.ejb.ActivationConfigProperty(propertyName = "pollingInterval", propertyValue = "250"),  
     @javax.ejb.ActivationConfigProperty(propertyName = "rescanInterval", propertyValue = "250"),  
     @ActivationConfigProperty(propertyName="minSession",propertyValue="100"),  
     @ActivationConfigProperty(propertyName="maxSession",propertyValue="100") })  
@org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=100, timeout=10000)  
public final class IncomingTaskMDB extends TaskCompletionReportable implements MessageListener {  

wmq.jmsra.rar版本:

代码语言:javascript
复制
Specification-Title: J2EE Connector Architecture  
Specification-Version: 1.5  
Implementation-Title: WebSphere MQ Resource Adapter  
Implementation-Version: 7.0.1.3-k701-103-100812  
Implementation-Vendor: IBM Corporation  

在我的wmq.jmsra.rar中-我修改了ra.xml:

代码语言:javascript
复制
<resourceadapter>  
<resourceadapter-class>  
com.ibm.mq.connector.ResourceAdapterImpl  
</resourceadapter-class>  
<config-property>  
<config-property-name>connectionConcurrency</config-property-name>  
<config-property-type>java.lang.String</config-property-type>  
<config-property-value>100</config-property-value>  
</config-property>  
<config-property>  
<config-property-name>maxConnections</config-property-name>  
<config-property-type>java.lang.String</config-property-type>  
<config-property-value>100</config-property-value>  
</config-property>  

在我的ejb3-interceptors-aop.xml中:

代码语言:javascript
复制
   <domain name="Message Driven Bean" extends="Intercepted Bean" inheritBindings="true">  
      <bind pointcut="execution(public * *->*(..))">  
         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>  
         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>  
      </bind>  
      <!-- TODO: Authorization? -->  
      <bind pointcut="execution(public * *->*(..))">  
         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>  
         <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>  
         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>  
         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>  
         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>  
         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->  
         <stack-ref name="EJBInterceptors"/>  
      </bind>  
      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">  
         @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=100, timeout=10000)  
      </annotation>  

在standardjboss.xml中:

代码语言:javascript
复制
<invoker-proxy-binding>  
      <name>message-driven-bean</name>  
      <invoker-mbean>default</invoker-mbean>  
      <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>  
      <proxy-factory-config>  
        <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>  
        <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>  
        <CreateJBossMQDestination>false</CreateJBossMQDestination>  
        <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed -->  
        <MinimumSize>1</MinimumSize>  
        <MaximumSize>100</MaximumSize>  
        <KeepAliveMillis>30000</KeepAliveMillis>  
        <MaxMessages>1</MaxMessages>  
        <MDBConfig>  
          <ReconnectIntervalSec>10</ReconnectIntervalSec>  
          <DLQConfig>  
            <DestinationQueue>queue/DLQ</DestinationQueue>  
            <MaxTimesRedelivered>10</MaxTimesRedelivered>  
            <TimeToLive>0</TimeToLive>  
          </DLQConfig>  
        </MDBConfig>  
      </proxy-factory-config>  
    </invoker-proxy-binding>  
EN

回答 1

Stack Overflow用户

发布于 2016-09-29 03:14:45

使用注释来增加从wsmq库生成的会话。默认值为10。

代码语言:javascript
复制
@ActivationConfigProperty(propertyName = "maxPoolDepth", propertyValue = "100"),
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26435920

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档