rockyPeoplesChamp
rockyPeoplesChamp

Reputation: 661

JAVA jms queue with JNDI configuration, message not read after 15 mins idle

JMS queue has been configured using jndi with jms server and is credentials/connection pool driven. We are observing an issue while using the queue. When we receive continuous messages in queue, listener application is able to read messages instantly but upon a delay(idle time) between two message of 15 mins, messages are not read from queue(even if more number of new messages are added to queue, which can be seen in jms admin console).

If listener application is restarted or jms server is restarted, queue messages are read. Jboss version is JBoss 4.3.0.GA_CP10 (build: SVNTag=JBPAPP_4_3_0_GA_CP10 date=201107201825)

Please let me know, JMS server jndi configuration changes that might help to solve the problem. Initial thought is to add following attributes to JMS server configuration that will do retry.

Will an upgrade in jboss messaging(JBM) or jboss remoting(JBRM) will help, if so kindly share how can I check the current version of them and where can I find service pack/upgrade/patch and will it be compatible with my version of jboss.

Reference URL: https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/4.3/html/Messaging_User_Guide/conf.connectionfactory.html

<attribute name="MaxRetryChangeRate">-1</attribute>
<attribute name="RetryChangeRateInterval">3000</attribute>

Please find below configurations JMS Server JNDI configuration:

<mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
  name="jboss.messaging.connectionfactory:service=ClusteredConnectionFactory"
  xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
  <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
  <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=sslbisocket</depends>
  <depends>jboss.messaging:service=PostOffice</depends>

  <attribute name="JNDIBindings">
     <bindings>
        <binding>/ClusteredConnectionFactory</binding>
        <binding>/ClusteredXAConnectionFactory</binding>
        <binding>java:/ClusteredConnectionFactory</binding>
        <binding>java:/ClusteredXAConnectionFactory</binding>
     </bindings>
  </attribute>

  <attribute name="SupportsFailover">true</attribute>
  <attribute name="SupportsLoadBalancing">true</attribute>      
  <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>  
  <attribute name="DisableRemotingChecks">true</attribute>
  <attribute name="MinTimeoutProcessTime">5000</attribute>
</mbean>

Application spring configuration:

<jms:listener-container connection-factory="jmsConnectionFactory" destination-resolver="jmsDestinationResolver" acknowledge="auto" client-id="xyz" >
  <jms:listener destination="destination" ref="listener" method="onMessage" id="listener" />         
</jms:listener-container>

<bean id="listener" class="package.Listener" ></bean> 

<bean id="jmsDestinationResolver" class="org.springframework.jms.support.destination.BeanFactoryDestinationResolver" />

<bean id="destination" class="org.springframework.jndi.JndiObjectFactoryBean">
  <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
  </property>
  <property name="jndiName" value="${jms.destination}" />
</bean>

<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
  <property name="targetConnectionFactory" ref="cachedConnectionFactory" />
  <property name="username" value="${jms.userName}" />
  <property name="password" value="${jms.password}"  />
</bean>

<bean id="cachedConnectionFactory" class="package.CachedConnectionFactory">
  <constructor-arg index="0" ref="nativeConnectionFactory" />
  <constructor-arg index="1" value="2" />
  <constructor-arg index="2" value="60000" />
</bean>

<bean id="nativeConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
  <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
  </property>
  <property name="jndiName" value="${clusteredConnectionFactory}" />
</bean>

<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
  <property name="environment">
    <props>
      <prop key="java.naming.provider.url">${url}</prop>
      <prop key="java.naming.factory.url.pkgs">org.jnp.interfaces:org.jboss.naming</prop>
      <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
    </props>
  </property>
</bean>

Upvotes: 1

Views: 515

Answers (0)

Related Questions