Hi,

We have also an other broker (same very simple config master/slave on SAN)
for an other app, with a queue and only one consumer that is configured with
Camel (see config below), and this consumer also stop consuming messages,
thus they say stuck in the queue.

I used pretty much all the options I could find to avoid this problem but
with no luck:
jms.prefetchPolicy.all=1
jms.dispatchAsync=false
jms.useAsyncSend=false


So two differents type consumers (Spring DMLC and Camel) but the same
problem... and no more ideas :-)



<beans
   xmlns="http://www.springframework.org/schema/beans";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
   http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd";>

  <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
    <route>
      <from uri="weblogic:queue:ToActiveMQ"/>
      <transacted ref="PROPAGATION_REQUIRED"/>
      <to uri="activemq:queue:from.weblogic"/>
    </route>

    <route>
      <from uri="activemq:queue:to.weblogic"/>
      <transacted ref="PROPAGATION_REQUIRED"/>
      <to uri="weblogic:queue:FromActiveMQ"/>
    </route>
  </camelContext>

  <bean id="PROPAGATION_REQUIRED"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
    <property name="transactionManager" ref="activemqTransactionManager"/>
    <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
  </bean>

  <bean id="weblogic" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory"
ref="weblogicCachedConnectionFactory"/>
    <property name="destinationResolver" ref="weblogicDestinationResolver"/>
    <property name="deliveryPersistent" value="true"/>
    <property name="transacted" value="true"/>
  </bean>

  <bean id="weblogicDestinationResolver"
class="org.springframework.jms.support.destination.JndiDestinationResolver">
    <property name="jndiTemplate" ref="remoteJndi" />
  </bean>

  <bean id="weblogicCachedConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory">
    <property name="targetConnectionFactory"
ref="weblogicConnectionFactory"/>
    <property name="reconnectOnException" value="true"/>
  </bean>

  <bean id="weblogicConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="remoteJndi" />
    <property name="jndiName" value="weblogic.jms.ConnectionFactory" />
  </bean>

  <bean id="remoteJndi" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
      <props>
        <prop
key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
        <prop key="java.naming.provider.url">t3://host:7004</prop>
      </props>
    </property>
  </bean>

  <bean id="activemqTransactionManager"
class="org.springframework.jms.connection.JmsTransactionManager">
    <property name="connectionFactory" ref="amqCachedConnectionFactory" />
  </bean>

  <bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent" >
    <property name="connectionFactory" ref="amqCachedConnectionFactory"/>
    <property name="transacted" value="true"/>
  </bean>

  <bean id="amqCachedConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory">
    <property name="targetConnectionFactory" ref="amqConnectionFactory"/>
    <property name="reconnectOnException" value="true"/>
  </bean>

  <bean id="amqConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL"
value="failover://(tcp://host1:8016,tcp://host2:8016)?jms.prefetchPolicy.all=1&amp;jms.dispatchAsync=false&amp;jms.useAsyncSend=false&amp;trackMessages=true&amp;timeout=5000&amp;jms.redeliveryPolicy.useExponentialBackOff=true&amp;jms.maximumRedeliveryDelay=300000L&amp;jms.redeliveryPolicy.maximumRedeliveries=-1"
/>
  </bean>
</beans>

--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Messages-stuck-in-queue-tp3244342p3733449.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to