activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmathrusse <Christopher.Mathru...@sybase.com>
Subject Re: [Spam: 5.0] Message is not delivered and disappears
Date Fri, 09 Mar 2007 17:19:25 GMT

Yes, the change to port 2100 was intentional. The activemq.xml file on the
server was updated to this value. If it hadn't been I would not have been
able to connect to it.

My server application is using the JmsTemplate but that is not the issue as
I am using ConnectionPooling. 

I've managed to get things to work a bit. I modified both my simple client
and the client application by including a jndi.properties file in their
classpath. The simple java client was able to connect successfully and
perform a lookup of the queues, which I had predefined on the server. I was
able to find, using the simple java client, the queue with a  
ctx.lookup(queueName);, and send a message successfully. The consumer/server
application received this message successfully. Next I tried from the 3rd
party client application, but the lookup still failed. So I modified the
lookup to use the dynamic queue syntax, 
ctx.lookup("dynamicQueues/order.request.queue");. This worked and the
application was able to send successfully. 

Surprisingly the consumer received the message and was able to process it.
The only modification I made on the consumer side was that I changed the
queue name that it was listening on. Previously I had it listening to
"dynamicQueues/order.request.queue" and I changed it to
"order.request.queue". For some reason removing the dynamicQueues syntax
seemed to correct the problem.

I wish I had a good explanation for this.


James.Strachan wrote:
> 
> BTW your code uses this...
> 
> 		props.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
> 		props.put(Context.PROVIDER_URL, "tcp://localhost:2100");
> 
> thats the host/port used to connect to the broker. Have you changed
> the activemq.xml file to have ActiveMQ listen on port 2100?
> 
> On 3/8/07, cmathrusse <Christopher.Mathrusse@sybase.com> wrote:
>>
>> I've got ActiveMQ 4.1.0 running successfully. (or so I think) I've got my
>> application connecting to it without any problems, utilizing Springs
>> framework. The problem I'm having is when I attempt to send a message to
>> the
>> queue I receive the following in the activeMq.log file:
> 
> Are you using Spring's JmsTemplate by any chance? If so this is
> expected...
> http://activemq.apache.org/jmstemplate-gotchas.html
> 
> 
>>
>> DEBUG AbstractRegion                 - Adding consumer:
>> ID:CMATHRUSXP-2147-1173384522352-1:9:14:1
>> DEBUG Transport                      - Transport failed:
>> java.net.SocketException: Connection reset
>> java.net.SocketException: Connection reset
>>  at java.net.SocketInputStream.read(SocketInputStream.java:168)
>>  at
>> org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:49)
>>  at
>> org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:56)
>>  at java.io.DataInputStream.readInt(DataInputStream.java:353)
>>  at
>> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:267)
>>  at
>> org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:156)
>>  at
>> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:136)
>>  at java.lang.Thread.run(Thread.java:595)
>> DEBUG TransportConnection            - Stopping connection:
>> /172.17.2.128:2163
>> DEBUG TransportConnection            - Cleaning up connection resources.
>> DEBUG AbstractRegion                 - Removing consumer:
>> ID:CMATHRUSXP-2162-1173384593890-1:0:-1:1
>> DEBUG TransportConnection            - Stopped connection:
>> /172.17.2.128:2163
>>
>>
>> I've attached my simple java client. It is very similar to the
>> SimpleProducer that is published here:
>> http://activemq.apache.org/jndi-support.html
>> The only difference is that my InitialContext is created using a
>> properties
>> object and supplying the InitialContextFactory and ProviderURL. The
>> client
>> appears to connect successfully and sends a message successfully without
>> exceptions on the client, but I see the above exception on the server. In
>> addition, the message never gets received by the consumer.
>>
>> Interestingly enough, if I change my client code from:
>> ctx.lookup(queueName);
>>
>> to:
>> session.createQueue(queueName);
>>
>> The message gets received by the consumer. Oddly, the above exception
>> message is still produced in my servers log file, but the message gets
>> delivered correctly.
>>
>> I've configured in the activemq.xml file my queues so they are started
>> when
>> the broker starts as follows:
>>     <destinations>
>>      <queue name="order.request.queue"
>> physicalName="order.request.queue"/>
>>      <queue name="order.confirm.queue"
>> physicalName="order.confirm.queue"/>
>>     </destinations>
>>
>> but my client cannot seem to locate them using the
>> ctx.looup("order.request.queue") method, so I'm using the dynamic queue
>> lookup instead: ctx.looup("dynamicQueues/order.request.queue")
>> but I don't think that has anything to do with why the message is not
>> delivered.
>> As listed above, if I use the createQueue method things work, but if I
>> use
>> the ctx.lookup things don't. The reason it is so important to get this to
>> work is because I have a 3rd party application that will be sending
>> messages
>> via JMS and it is using the ctx.lookup method, which is failing for me.
>>
>> Any help would be greatly appreciated. Thanks....
>>
>>
>> http://www.nabble.com/file/7050/JMSClient.java JMSClient.java
>> --
>> View this message in context:
>> http://www.nabble.com/Message-is-not-delivered-and-disappears-tf3371445s2354.html#a9381531
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Message-is-not-delivered-and-disappears-tf3371445s2354.html#a9398732
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message