You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by pablo caballero <pd...@gmail.com> on 2010/08/09 21:51:50 UTC

Problem receiving message.

Background:

I'm using spring + camel + activemq in boths sender and receiver.

Relevant receiver spring's cfg:

<amq:broker useJmx="false" persistent="false">
	<amq:transportConnectors>
		<amq:transportConnector uri="tcp://localhost:15000" />
	</amq:transportConnectors>
</amq:broker>

<bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
	<property name="brokerURL" value="tcp://localhost:15000"/>
</bean>

<bean id="abstractJmsComponent"
class="org.apache.camel.component.jms.JmsComponent" abstract="true">
        <property name="connectionFactory" ref="jmsConnectionFactory"/>
</bean>

<bean id="jmsGP" parent="abstractJmsComponent">
	<property name="taskExecutor">
		<bean class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
		</bean>
	</property>
</bean>

<camel:camelContext id="camelContext">
	<camel:route>
		<camel:from uri="jmsGP:queue:someQueue"/>
		<camel:bean ref="someBean" method="someMethod"/>
	</camel:route>
</camel:camelContext>

Relevant sender spring's cfg:

<bean id="jmsConnectionFactoryGP"
class="org.apache.activemq.ActiveMQConnectionFactory">
	<property name="brokerURL" value="tcp://localhost:15000"/>
</bean>

<bean id="jmsGP" class="org.apache.camel.component.jms.JmsComponent">
    	<property name="connectionFactory" ref="jmsConnectionFactoryGP"/>
        <property name="taskExecutor">
		<bean class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
		</bean>
        </property>
</bean>

I run both apps (sender & receiver) under Tomcat

The sender app send the message via a
org.apache.camel.ProducerTemplate.sendBody call to the uri
jmsGP:queue:someQueue. No exception or error

I have a breakpoint in the server app (at the begining of someMethod
code) but it is never reached. Nothing happens (no exception, no
error)

If I run only the receiver app I see (netstat) a LISTENING entry (on
port 15000) and two ESTABLISHED entries (two "views" of the same
connection: 15000 -> some random port and same random port -> 15000).
when I run both apps no additional connection appear.

I'm sure that the problem is not a ActiveMQ issue but a "layer 8" one
(ergo "me"). Someone can kick me in the right direction?

Thank you very much!

Best regards

Re: Problem receiving message.

Posted by pablo caballero <pd...@gmail.com>.
Gary, thank you very much for your response.

I changed "localhost" for my specific IP address (also for 0.0.0.0)
and nothing happened.

I changed useJmx to true in the broker configuration to monitor the
queue (via jconsole) and something strange happened:

1.- I execute the sender and the consumer apps
2.- The sender app send a message
3.- I execute jconsole and I see that EnqueueCount and DequeueCount
queue's attributes both have the value 1.
4.- No activity occurs in the receiving application
5.- The sender app send another message (I had never tried to send two
messages!!!!)
6.- The receiving app consume the message!!! (and EnqueueCount ==
DequeueCount == 2)

The six steps above are repeated deterministically.

Sorry for my bad english.

Best regards

On Tue, Aug 10, 2010 at 7:48 AM, Gary Tully <ga...@gmail.com> wrote:
> one thought, rather than localhost, do you need activemq to listen on
> all network interfaces using the wildcard address 0.0.0.0 or a
> specific IP address?
>
> On 9 August 2010 20:51, pablo caballero <pd...@gmail.com> wrote:
>> Background:
>>
>> I'm using spring + camel + activemq in boths sender and receiver.
>>
>> Relevant receiver spring's cfg:
>>
>> <amq:broker useJmx="false" persistent="false">
>>        <amq:transportConnectors>
>>                <amq:transportConnector uri="tcp://localhost:15000" />
>>        </amq:transportConnectors>
>> </amq:broker>
>>
>> <bean id="jmsConnectionFactory"
>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>        <property name="brokerURL" value="tcp://localhost:15000"/>
>> </bean>
>>
>> <bean id="abstractJmsComponent"
>> class="org.apache.camel.component.jms.JmsComponent" abstract="true">
>>        <property name="connectionFactory" ref="jmsConnectionFactory"/>
>> </bean>
>>
>> <bean id="jmsGP" parent="abstractJmsComponent">
>>        <property name="taskExecutor">
>>                <bean class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
>>                </bean>
>>        </property>
>> </bean>
>>
>> <camel:camelContext id="camelContext">
>>        <camel:route>
>>                <camel:from uri="jmsGP:queue:someQueue"/>
>>                <camel:bean ref="someBean" method="someMethod"/>
>>        </camel:route>
>> </camel:camelContext>
>>
>> Relevant sender spring's cfg:
>>
>> <bean id="jmsConnectionFactoryGP"
>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>        <property name="brokerURL" value="tcp://localhost:15000"/>
>> </bean>
>>
>> <bean id="jmsGP" class="org.apache.camel.component.jms.JmsComponent">
>>        <property name="connectionFactory" ref="jmsConnectionFactoryGP"/>
>>        <property name="taskExecutor">
>>                <bean class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
>>                </bean>
>>        </property>
>> </bean>
>>
>> I run both apps (sender & receiver) under Tomcat
>>
>> The sender app send the message via a
>> org.apache.camel.ProducerTemplate.sendBody call to the uri
>> jmsGP:queue:someQueue. No exception or error
>>
>> I have a breakpoint in the server app (at the begining of someMethod
>> code) but it is never reached. Nothing happens (no exception, no
>> error)
>>
>> If I run only the receiver app I see (netstat) a LISTENING entry (on
>> port 15000) and two ESTABLISHED entries (two "views" of the same
>> connection: 15000 -> some random port and same random port -> 15000).
>> when I run both apps no additional connection appear.
>>
>> I'm sure that the problem is not a ActiveMQ issue but a "layer 8" one
>> (ergo "me"). Someone can kick me in the right direction?
>>
>> Thank you very much!
>>
>> Best regards
>>
>
>
>
> --
> http://blog.garytully.com
>
> Open Source Integration
> http://fusesource.com
>

Re: Problem receiving message.

Posted by Gary Tully <ga...@gmail.com>.
one thought, rather than localhost, do you need activemq to listen on
all network interfaces using the wildcard address 0.0.0.0 or a
specific IP address?

On 9 August 2010 20:51, pablo caballero <pd...@gmail.com> wrote:
> Background:
>
> I'm using spring + camel + activemq in boths sender and receiver.
>
> Relevant receiver spring's cfg:
>
> <amq:broker useJmx="false" persistent="false">
>        <amq:transportConnectors>
>                <amq:transportConnector uri="tcp://localhost:15000" />
>        </amq:transportConnectors>
> </amq:broker>
>
> <bean id="jmsConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>        <property name="brokerURL" value="tcp://localhost:15000"/>
> </bean>
>
> <bean id="abstractJmsComponent"
> class="org.apache.camel.component.jms.JmsComponent" abstract="true">
>        <property name="connectionFactory" ref="jmsConnectionFactory"/>
> </bean>
>
> <bean id="jmsGP" parent="abstractJmsComponent">
>        <property name="taskExecutor">
>                <bean class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
>                </bean>
>        </property>
> </bean>
>
> <camel:camelContext id="camelContext">
>        <camel:route>
>                <camel:from uri="jmsGP:queue:someQueue"/>
>                <camel:bean ref="someBean" method="someMethod"/>
>        </camel:route>
> </camel:camelContext>
>
> Relevant sender spring's cfg:
>
> <bean id="jmsConnectionFactoryGP"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>        <property name="brokerURL" value="tcp://localhost:15000"/>
> </bean>
>
> <bean id="jmsGP" class="org.apache.camel.component.jms.JmsComponent">
>        <property name="connectionFactory" ref="jmsConnectionFactoryGP"/>
>        <property name="taskExecutor">
>                <bean class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
>                </bean>
>        </property>
> </bean>
>
> I run both apps (sender & receiver) under Tomcat
>
> The sender app send the message via a
> org.apache.camel.ProducerTemplate.sendBody call to the uri
> jmsGP:queue:someQueue. No exception or error
>
> I have a breakpoint in the server app (at the begining of someMethod
> code) but it is never reached. Nothing happens (no exception, no
> error)
>
> If I run only the receiver app I see (netstat) a LISTENING entry (on
> port 15000) and two ESTABLISHED entries (two "views" of the same
> connection: 15000 -> some random port and same random port -> 15000).
> when I run both apps no additional connection appear.
>
> I'm sure that the problem is not a ActiveMQ issue but a "layer 8" one
> (ergo "me"). Someone can kick me in the right direction?
>
> Thank you very much!
>
> Best regards
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com