2012-11-06 66 views
1

我正在使用jboss-5.1來部署消息驅動bean,該消息驅動bean用於訂閱來自第三方隊列的消息。用戶隊列中的待處理消息

大約16條消息被髮送到該隊列,但它們仍然在我們的用戶隊列中等待處理。我重新啓動了服務器,並且隨時可以選擇消息。

儘管我已經分析過,但我認爲maxsizemaxsession可能會影響它,因爲它們都是15.但我不明白是否存在某個實際問題,它是如何通過重新啓動得到解決的。

日誌處於錯誤模式。我沒有得到完整的堆棧跟蹤。

這是錯誤日誌的片段。

[2012-10-30 17:01:00,228] [MQQueueAgent (GQH1_PLANNING_MDM_001)] 
[ERROR] STDERR: 2012.10.30 17:01:00 MQJMS1023E rollback failed 

[2012-10-30 17:01:00,228] [exceptionDelivery0] [WARN ] 
org.jboss.resource.adapter.jms.inflow.JmsActivation: Failure in jms activation 
[email protected]([email protected] 
destination=remotewsmq/NOTIFICATION_PLANNING_MDM_001.SUBQ 
destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=RemoteWSMQJMSProvider 
user=null maxMessages=1 minSession=1 maxSession=5 keepAlive=60000 useDLQ=false) 

GQH1_PLANNING_MDM_001:用於訂閱的隊列的名稱。

我用來配置MDB屬性的文件如下。

1.ejb3攔截器-aop.xml文件

<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=15, timeout=10000) 
     </annotation> 
    </domain> 

2.standardjboss.xml

<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>15</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> 

    <activation-config-property> 
     <activation-config-property-name>maxSession</activation-config-property-name> 
     <activation-config-property-value>15</activation-config-property-value> 
    </activation-config-property> 

3.jms-ds.xml中

<?xml version="1.0" encoding="UTF-8"?> 

<connection-factories> 

    <!-- ==================================================================== --> 
    <!-- JMS Stuff               --> 
    <!-- ==================================================================== --> 

    <!-- 
     The JMS provider loader. Currently pointing to a non-clustered ConnectionFactory. Need to 
     be replaced with a clustered non-load-balanced ConnectionFactory when it becomes available. 
     See http://jira.jboss.org/jira/browse/JBMESSAGING-843. 
    --> 
    <mbean code="org.jboss.jms.jndi.JMSProviderLoader" 
      name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider"> 
     <attribute name="ProviderName">DefaultJMSProvider</attribute> 
     <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute> 
     <attribute name="FactoryRef">java:/XAConnectionFactory</attribute> 
     <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute> 
     <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute> 
    </mbean> 

    <!-- JMS XA Resource adapter, use this to get transacted JMS in beans --> 
    <tx-connection-factory> 
     <jndi-name>JmsXA</jndi-name> 
     <xa-transaction/> 
     <rar-name>jms-ra.rar</rar-name> 
     <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> 
     <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property> 
     <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property> 
     <max-pool-size>20</max-pool-size> 
     <security-domain-and-application>JmsXARealm</security-domain-and-application> 
     <depends>jboss.messaging:service=ServerPeer</depends> 
    </tx-connection-factory> 

</connection-factories> 

請幫忙。

回答

1

根據錯誤,交易ROLLBACK調用失敗。失敗後,隊列管理員可能會將這些消息保存在一個非常出色的工作單元中。重新啓動服務器將關閉連接,隊列管理器將在此時代表應用程序回滾事務。重新啓動時,應用程序將創建一個新的UOW並檢索消息。

查看WebSphere MQ的隊列管理器錯誤日誌和全局錯誤日誌以確定錯誤是否由資源短缺引起。可能需要增加隊列管理器事務日誌的大小或調整事務參數(如MAXUOW)。

您可能還需要更新MQ客戶端版本或隊列管理器版本。根據this Technote,WebSphere MQ JMS類自6.0.2.3更新以修復導致MQJMS1023E錯誤的錯誤。如果您需要更新客戶端版本,則可以免費下載,格式爲SupportPac MQC75。一個新的客戶端能夠與任何後臺隊列管理器一起運行。升級完成後,該應用將受益於新客戶端代碼的錯誤修復和性能增強功能,並提供適用於與其連接的隊列管理器版本的API功能。當前安裝了哪個版本的WebSphere MQ JMS客戶端?當前安裝了什麼版本的WebSphere MQ隊列管理器?

+0

這個MAXUOW適用於jboss嗎?如果是的話,你知道一種方法來設置它。在我們的例子中,一旦我們收到一條消息,我們只是提交它。所以如果發生了一些問題,我們根本就不處理它。所以不存在交易失敗的問題。 – dev

+0

以我的理解,這可能是原因。 – dev

+0

當一批JMS消息以預取的數量傳遞給MDB時,每個JMS消息都將從該池中分配一個實例,並通過onMessage函數將其傳遞給該實例。如果消息預取超過此池的最大大小,則消息將等待MDB實例。如果從消息傳遞到調用onMessage的時間超過任何消息的池超時,將引發EJBException。對於大預取和長平均onMessage時間,隊列末尾的消息將開始失敗。 但我不明白,重新啓動服務器可能更改? – dev

2

如果偵聽器沒有嘗試重新連接,則可能是掛起的消息導致其失敗。

相關問題