You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by haglund <fo...@gmail.com> on 2012/12/20 10:58:09 UTC
Problem with dispatcher connection thread
Hi!
I have set up a web service that communicates with a qpid queue using AMQP
and Camel.
I use WSDL to define the service and spring to set up the connection.
I call the service in a web application that is deployed on JBoss AS 7.
My spring application context look like this
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />
<bean id="jmsConnectionFactory"
class="org.apache.qpid.client.AMQConnectionFactory">
<constructor-arg index="0" type="java.lang.String"
value="amqp://guest:guest@clientid/test?brokerlist='tcp://qpid:5672'" />
</bean>
<bean id="iosbroker" class="org.apache.camel.component.amqp.AMQPComponent">
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>
<bean
class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
<property name="bus" ref="cxf" />
<property name="camelContext" ref="camelContext" />
<property name="transportIds">
<list>
<value>http://cxf.apache.org/transports/camel</value>
</list>
</property>
</bean>
<client id="MyService" xmlns="http://cxf.apache.org/jaxws"
xmlns:helloworld="http://service.world.hello.com"
serviceName="helloworld:MyService"
endpointName="helloworld:MyServiceEndpoint"
address="camel://direct:MyService"
serviceClass="com.hello.world.service.MyServicePortType">
<features>
<logging xmlns="http://cxf.apache.org/core" />
</features>
</client>
<camelContext id="camelContext"
xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:MyService" />
<to uri="iosbroker:queue:my_queue" />
</route>
</camelContext>
The service is working fine and I get what I am suppose to get from the
queue.
The problem is that after I call the service (with a successful result) I
can see, in the jboss log, that a dispatcher connection thread has been
created and is polling the queue every second (and my qpid queue crash after
a while).
If I add the property "receiveTimeout" to
org.apache.camel.component.amqp.AMQPComponent I can slow it down, but it
still keep polling the queue.
This is what is repeated every second in the jboss log.
00:00:18,562 DEBUG [org.apache.qpid.transport.Connection] (Camel
(camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) SEND:
[conn:63ca493a] ch=0 id=7254 [S] MessageFlush(destination=1)
00:00:18,563 DEBUG [org.apache.qpid.transport.Connection] (Camel
(camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) FLUSH:
[conn:63ca493a]
00:00:18,564 DEBUG [org.apache.qpid.transport.Session] (Camel (camelContext)
thread #5 - TemporaryQueueReplyManager[temporary]-1)
ssn:"2528ec27-f351-46a0-bf89-ee020dc13293" sync()
00:00:18,565 DEBUG [org.apache.qpid.transport.Session] (Camel (camelContext)
thread #5 - TemporaryQueueReplyManager[temporary]-1)
ssn:"2528ec27-f351-46a0-bf89-ee020dc13293" waiting for[7254]: 7251,
[Lorg.apache.qpid.transport.Method;@696add0e
00:00:18,565 DEBUG [org.apache.qpid.transport.Connection] (IoReceiver -
qpid/127.0.0.1:5672) RECV: [conn:63ca493a] ch=0
SessionCompleted(commands={[1, 7254]})
00:00:18,568 DEBUG [org.apache.qpid.transport.Session] (IoReceiver -
qpid/127.0.0.1:5672) ssn:"2528ec27-f351-46a0-bf89-ee020dc13293" complete(1,
7254)
00:00:18,569 DEBUG [org.apache.qpid.transport.Session] (IoReceiver -
qpid/127.0.0.1:5672) ssn:"2528ec27-f351-46a0-bf89-ee020dc13293" commands
remaining: 1
00:00:18,571 DEBUG [org.apache.qpid.transport.Connection] (Camel
(camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) SEND:
[conn:63ca493a] ch=0 id=7255 MessageFlow(destination=1, unit=BYTE, value=-1)
00:00:18,572 DEBUG [org.apache.qpid.transport.Connection] (Camel
(camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) FLUSH:
[conn:63ca493a]
00:00:18,573 DEBUG [org.apache.qpid.transport.Connection] (Camel
(camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) SEND:
[conn:63ca493a] ch=0 id=7256 MessageFlow(destination=1, unit=MESSAGE,
value=500)
00:00:18,574 DEBUG [org.apache.qpid.transport.Connection] (Camel
(camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) FLUSH:
[conn:63ca493a]
00:00:18,575 DEBUG [org.apache.qpid.client.AMQSession.Dispatcher] (Camel
(camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) Set
Dispatcher Connection Started: Currently Started
00:00:18,576 DEBUG [org.apache.qpid.client.AMQSession.Dispatcher] (Camel
(camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) Set
Dispatcher Connection Started: Currently Started
Is this a normal behavior? Shouldn't the thread die after a successful
request or is there a way to configure camel so the consumer will stop
polling the queue after successful request or timeout?
I assume that it's something wrong with my configuration, but I can't find
what it is.
Best regards,
Kristoffer
--
View this message in context: http://camel.465427.n5.nabble.com/Problem-with-dispatcher-connection-thread-tp5724434.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Problem with dispatcher connection thread
Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Dec 20, 2012 at 10:58 AM, haglund <fo...@gmail.com> wrote:
> Hi!
>
> I have set up a web service that communicates with a qpid queue using AMQP
> and Camel.
> I use WSDL to define the service and spring to set up the connection.
>
> I call the service in a web application that is deployed on JBoss AS 7.
>
> My spring application context look like this
>
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />
>
> <bean id="jmsConnectionFactory"
> class="org.apache.qpid.client.AMQConnectionFactory">
> <constructor-arg index="0" type="java.lang.String"
> value="amqp://guest:guest@clientid/test?brokerlist='tcp://qpid:5672'" />
> </bean>
>
> <bean id="iosbroker" class="org.apache.camel.component.amqp.AMQPComponent">
> <property name="connectionFactory" ref="jmsConnectionFactory" />
> </bean>
>
> <bean
> class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
> <property name="bus" ref="cxf" />
> <property name="camelContext" ref="camelContext" />
> <property name="transportIds">
> <list>
> <value>http://cxf.apache.org/transports/camel</value>
> </list>
> </property>
> </bean>
>
> <client id="MyService" xmlns="http://cxf.apache.org/jaxws"
> xmlns:helloworld="http://service.world.hello.com"
> serviceName="helloworld:MyService"
> endpointName="helloworld:MyServiceEndpoint"
> address="camel://direct:MyService"
> serviceClass="com.hello.world.service.MyServicePortType">
> <features>
> <logging xmlns="http://cxf.apache.org/core" />
> </features>
> </client>
>
> <camelContext id="camelContext"
> xmlns="http://camel.apache.org/schema/spring">
> <route>
> <from uri="direct:MyService" />
> <to uri="iosbroker:queue:my_queue" />
> </route>
> </camelContext>
>
> The service is working fine and I get what I am suppose to get from the
> queue.
>
> The problem is that after I call the service (with a successful result) I
> can see, in the jboss log, that a dispatcher connection thread has been
> created and is polling the queue every second (and my qpid queue crash after
> a while).
> If I add the property "receiveTimeout" to
> org.apache.camel.component.amqp.AMQPComponent I can slow it down, but it
> still keep polling the queue.
>
> This is what is repeated every second in the jboss log.
>
> 00:00:18,562 DEBUG [org.apache.qpid.transport.Connection] (Camel
> (camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) SEND:
> [conn:63ca493a] ch=0 id=7254 [S] MessageFlush(destination=1)
> 00:00:18,563 DEBUG [org.apache.qpid.transport.Connection] (Camel
> (camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) FLUSH:
> [conn:63ca493a]
> 00:00:18,564 DEBUG [org.apache.qpid.transport.Session] (Camel (camelContext)
> thread #5 - TemporaryQueueReplyManager[temporary]-1)
> ssn:"2528ec27-f351-46a0-bf89-ee020dc13293" sync()
> 00:00:18,565 DEBUG [org.apache.qpid.transport.Session] (Camel (camelContext)
> thread #5 - TemporaryQueueReplyManager[temporary]-1)
> ssn:"2528ec27-f351-46a0-bf89-ee020dc13293" waiting for[7254]: 7251,
> [Lorg.apache.qpid.transport.Method;@696add0e
> 00:00:18,565 DEBUG [org.apache.qpid.transport.Connection] (IoReceiver -
> qpid/127.0.0.1:5672) RECV: [conn:63ca493a] ch=0
> SessionCompleted(commands={[1, 7254]})
> 00:00:18,568 DEBUG [org.apache.qpid.transport.Session] (IoReceiver -
> qpid/127.0.0.1:5672) ssn:"2528ec27-f351-46a0-bf89-ee020dc13293" complete(1,
> 7254)
> 00:00:18,569 DEBUG [org.apache.qpid.transport.Session] (IoReceiver -
> qpid/127.0.0.1:5672) ssn:"2528ec27-f351-46a0-bf89-ee020dc13293" commands
> remaining: 1
> 00:00:18,571 DEBUG [org.apache.qpid.transport.Connection] (Camel
> (camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) SEND:
> [conn:63ca493a] ch=0 id=7255 MessageFlow(destination=1, unit=BYTE, value=-1)
> 00:00:18,572 DEBUG [org.apache.qpid.transport.Connection] (Camel
> (camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) FLUSH:
> [conn:63ca493a]
> 00:00:18,573 DEBUG [org.apache.qpid.transport.Connection] (Camel
> (camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) SEND:
> [conn:63ca493a] ch=0 id=7256 MessageFlow(destination=1, unit=MESSAGE,
> value=500)
> 00:00:18,574 DEBUG [org.apache.qpid.transport.Connection] (Camel
> (camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) FLUSH:
> [conn:63ca493a]
> 00:00:18,575 DEBUG [org.apache.qpid.client.AMQSession.Dispatcher] (Camel
> (camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) Set
> Dispatcher Connection Started: Currently Started
> 00:00:18,576 DEBUG [org.apache.qpid.client.AMQSession.Dispatcher] (Camel
> (camelContext) thread #5 - TemporaryQueueReplyManager[temporary]-1) Set
> Dispatcher Connection Started: Currently Started
>
> Is this a normal behavior? Shouldn't the thread die after a successful
> request or is there a way to configure camel so the consumer will stop
> polling the queue after successful request or timeout?
> I assume that it's something wrong with my configuration, but I can't find
> what it is.
>
Do you want to do request/reply over AMQP ? If not then you should
send the message to the queue as InOnly.
http://camel.apache.org/event-message.html
When you do request/reply then a background consumer is started to
listen and pickup the response messages.
And thus maybe what you see in the logs.
> Best regards,
> Kristoffer
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-with-dispatcher-connection-thread-tp5724434.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen