You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by sic <si...@naver.com> on 2010/01/05 07:51:40 UTC

Re: differences between jms consumer and bean listener

Thanks for ur answer. As a result of my testing, I'm not completely certain
that bean DMLC listener is much better in the unstable network than
jms:consumer. But a few differences are founded, I think.
1. While the remote broker goes down, I'm going to deploy the jms:consumer
connecting to the remote broker. Then two cases are quiet different in
attempting to connect them.
spring bean listener cannot be deployed in servicemix and all works are
stopped(jmx controlling, queue handling and suchlike) except connecting to
the remote broker.
So the following logs are repeated for failover transport. 

org.apache.activemq.transport.failover.FailoverTransport:723  - Connec
l to: tcp://${remoteip}:${remoteport}, reason: java.net.ConnectException:
Connection timed out: connect
org.apache.activemq.transport.failover.FailoverTransport:757  - Waitin
00 ms before attempting connection.
org.apache.activemq.transport.failover.FailoverTransport:682  - Attemp
connect to: tcp://${remoteip}:${remoteport}

On the other hand jms:consumer are deployed normally and then all works are
fine, attempting to connect to the remote broker. 

2. spring bean listener cannot be stopped by jconsole and after that it
tries to receive the messages continously. 
org.springframework.jms.listener.AbstractPollingMessageListenerContainer:324 
- Consumer [ActiveMQMessageConsumer {
value=ID:rok-3230-1262665625125-2:36:1:53, started=true }] of session
[PooledSession { ActiveMQSession
{id=ID:{$user}-3230-1262665625125-2:36:1,started=true} }] did not receive a
message
org.springframework.jms.listener.AbstractPollingMessageListenerContainer:324
] - Consumer [ActiveMQMessageConsumer {
value=ID:rok-3230-1262665625125-2:36:1:54, started=true }] of session
[PooledSession { ActiveMQSession
{id=ID:{$user}-3230-1262665625125-2:36:1,started=true} }] did not receive a
message

By the way jms:consumer is stopped correctly using jconsole and don't
receive any message at all.

In this fact, I think bean listener is handled by servicemix with some
difficulty. Even so, it seems that using jms:consumer is unstable and I'll
add some testing result. Anyone has an advice concerning to this issues?


Gert Vanthienen wrote:
> 
> L.S.,
> 
> The jms:consumer uses the Spring DMLC as well, so there shouldn't be a
> real difference between both approaches.  Actually, I switched from
> the old jms:endopint to the newer jms:consumer endpoint at one site
> just because it is capable of handling network outages much better.  I
> have been using it with both ActiveMQ and WebSphere MQ and never
> experienced any real issues with it.  Could you take a look in the log
> to see what happens when the remote broker goes down?  If you switch
> to DEBUG logging, I think you should see some output from the DMLC
> stating that it's going to reconnect if everything is working OK.
> Perhaps some of the exceptions you get at that point can help us
> pinpoint why the reconnection doesn't occur.
> 
> Regards,
> 
> Gert Vanthienen
> ------------------------
> Open Source SOA: http://fusesource.com
> Blog: http://gertvanthienen.blogspot.com/
> 
> 
> 
> 2009/12/17 sic <si...@naver.com>:
>>
>> I just want local Service Assembly to connect to remote ActiveMQ broker.
>> So I configure jms-bc(consumer) in order to connect to them like this :
>> ...
>> <jms:consumer service="test:jms-su"
>>        endpoint="jms-endpoint"
>>        targetService="test:bean-su"
>>        targetEndpoint="bean-endpoint"
>>        concurrentConsumers="1"
>>        synchronous="true"
>>        destinationName="QU"
>>        receiveTimeout="3000"
>>        connectionFactory="#jmsConnectionFactory"
>>        listenerType="default"/>
>>
>> <bean id="jmsConnectionFactory"
>> class="org.apache.activemq.pool.pooledConnectionFactory"
>> destroy-method="stop">
>>        <property name="connectionFactory">
>>                <bean
>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>                        <property name="brokerURL">
>>                              
>>  <value>failover:(tcp://${remoteIP}:${remotePort})</value>
>>                        </property>
>>                </bean>
>>        </property>
>> </bean>
>> ...
>> This service assembly can be handled by using JConsole such as Stop,
>> Start,
>> Shutdown and so on.
>> In unstable, however, network environments, this consumer(s) are often
>> disconnected and after that, cannot be reconnected.
>> So I try setting DefaultMessageListenerContainer(DMLC) to bean-su like
>> this
>> :
>> ...
>> <bean id="listenerContainer"
>> class="org.springframework.jms.listener.DefaultMessageListenerContainer">
>>        <property name="messageListener" ref="ServiceBean" />
>>        <property name="connectionFactory" ref="jmsConnectionFactory" />
>>        <property name="destinationName" value="QU" />
>>        <property name="concurrentConsumers" value="1" />
>>        <property name="receiveTimeout" value="3000" />
>> </bean>
>>
>> <bean id="jmsConnectionFactory"
>> class="org.apache.activemq.pool.pooledConnectionFactory"
>> destroy-method="stop">
>>        <property name="connectionFactory">
>>                <bean
>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>                        <property name="brokerURL">
>>                              
>>  <value>failover:(tcp://${remoteIP}:${remotePort})</value>
>>                        </property>
>>                </bean>
>>        </property>
>> </bean>
>> ...
>>
>> In this circumstances, I just want to handle this service assembly using
>> JConsole.
>> Stopping this SA in JConsole, listener didn't stop consuming messages.
>>
>> What's differences between jms-consumer used ListenerType="default" and
>> spring bean listener set DMLC?
>> is there any additional configuration so as to control in JMX?
>>
>> regards
>>
>> sic
>> --
>> View this message in context:
>> http://old.nabble.com/differences-between-jms-consumer-and-bean-listener-tp26823813p26823813.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -----
> ---
> Gert Vanthienen
> http://gertvanthienen.blogspot.com
> 

-- 
View this message in context: http://old.nabble.com/differences-between-jms-consumer-and-bean-listener-tp26823813p27024380.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.