activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seij...@gmail.com
Subject Re: ActiveMQ Pooled Session
Date Sun, 28 Jun 2015 17:51:19 GMT
to recover you want to have failover://  and you can setup the component

with two parts, one listening side with exclusive connections and one with pooling

for sending I think that should cover your needs.




So - two “factories”





<bean id="amqConnectionFactoryInternal" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="${internal.producer.url}"/>
</bean>

<bean id="amqPooledConnectionFactoryInternal" class="org.apache.activemq.pool.PooledConnectionFactory"
init-method="start" destroy-method="stop">
    <property name="maxConnections" value="${internal.producer.maxconnections}"/>
    <property name="connectionFactory" ref="amqConnectionFactoryInternal"/>
</bean>
This uses the first one, then
(Here they are osgi services (could be beans)
<reference id="jmsproducer" interface="javax.jms.ConnectionFactory" filter="(internal-producer=true)"/>
<reference id="jmsconsumer" interface="javax.jms.ConnectionFactory" filter="(internal-consumer=true)"/>



<bean id="jmsconfig" class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="jmsinternalconsumer"/>
    <property name="templateConnectionFactory" ref="jmsinternalconsumer"/>
</bean>

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

On Sun, Jun 28, 2015 at 11:41 AM, A.Marchand <a.marchand@progeri.com>
wrote:

> I understand your point about the fact that using a pooled connection for
> listening does not give any benefits. 
> So I tested the system differently by changing my route.  
> I am no longer listening to messages via the pooled connection but only
> sending messages to it (That's the main interest of a pooled connection).
> My ActiveMQ is still initialized via the default values via the following
> bean:
> <bean id="jms" 
>       class="org.apache.activemq.camel.component.ActiveMQComponent">
>       <property name="brokerURL" value="tcp://127.0.0.1:61616"/>
> </bean>
> which will use pooled connections.
> And I only have one route which looks like that:
> <route>
> 			<from uri="timer://mytimer?repeatCount=10000"/>
> 			<log message="Sending Message"/>
> 			<setBody>
> 				<constant>MY MESSAGE</constant>
> 			</setBody>
> 			<to uri="jms:topic:MYMES"/>
> </route>
> And unfortunately, the connection does not recover when the sending fails
> either. (After I killed the connection via TCPView.exe)
> Note that this test will probably fail in every system using camel and
> initializing the ActiveMQ via the default constructor which will probably
> include camel files deployed as xml in servicemix.
> Cheers,
> Arnaud
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Pooled-Session-tp4698203p4698301.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message