Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 59956 invoked from network); 13 Apr 2006 21:03:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Apr 2006 21:03:01 -0000 Received: (qmail 57701 invoked by uid 500); 13 Apr 2006 21:02:59 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 57680 invoked by uid 500); 13 Apr 2006 21:02:58 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 57671 invoked by uid 99); 13 Apr 2006 21:02:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Apr 2006 14:02:58 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Apr 2006 14:02:58 -0700 Received: from localhost ([127.0.0.1] helo=talk.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1FU8xX-0006jY-Od for activemq-users@geronimo.apache.org; Thu, 13 Apr 2006 14:02:37 -0700 Message-ID: <3908376.post@talk.nabble.com> Date: Thu, 13 Apr 2006 14:02:35 -0700 (PDT) From: skarthik To: activemq-users@geronimo.apache.org Subject: publish() call to remote JMS server hangs MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-Sender: karthik.sethuraman@necam.com X-Nabble-From: skarthik X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, This is rather long post as it took me a while to narrow down the problem. We are running activeMQ RC2 server on a windows XP machine and a simple JMS client test-program on another remote XP machine within the same LAN subnet. The test-program opens one JMS connection to the activeMQ server, establishes one session (with auto acknowledge), and creates one publisher on a topic on the session. Then in a loop, it creates an ObjectMessage and publishes it with PERSISTENT DeliveryMode, peppered by Thread.sleep() calls after each publish. The following snippet provides an example: TopicConnectionFactory tcf = (TopicConnectionFactory) jndiCtx.lookup (tcfName); Topic topic = (Topic) jndiCtx.lookup (topicName); TopicConnection jmsCon = tcf.createTopicConnection(); TopicSession session = jmsCon.createTopicSession (false, Session.AUTO_ACKNOWLEDGE); TopicPublisher publisher = session.createPublisher (topic); while (true) { ObjectMessage om = session.createObjectMessage (); om.setObject ("TESTSTRING"); publisher.publish (om, DeliveryMode.PERSISTENT, 9, 20000); Thread.sleep (20000); } It was found that when we disconnect the LAN cable from the client machine (to simulate network outage), if the test client tries to publish an ObjectMessage before activeMQ client stub detects the network disconnect, the publish call hangs. After further analysis, we found that even setting simple string payload to the ObjectMessage as shown in the following code snippet causes the hang. ObjectMessage om = session.createObjectMessage (); om.setObject ("TESTSTRING"); publisher.publish (om, DeliveryMode.PERSISTENT, 9, 20000); But using a byte array (byte[]) as payload does not cause an hang. byte[] payload; // populated by reading a specified input ascii file ObjectMessage om = session.createObjectMessage (); om.setObject (payload); publisher.publish (om, DeliveryMode.PERSISTENT, 9, 20000); Also setting a complex java serializable class instance as payload causes a hang, but an instance of almost similar class, but with an additional byte[] array attribute does not cause the publish() call to hang. Wanted to clarify that this hang is observered only in the test case scenario involving LAN disconnects. In normal cases the same messages flow sucessfully between the multiple remote producers and consumers. Also when I say the publish() call does not hang, I meant the publish() class throws the following exception which is the normal expected behavior. javax.jms.JMSException: Connection reset by peer: socket write error at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:57) at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1118) at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1524) at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:462) at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:384) at org.apache.activemq.ActiveMQTopicPublisher.publish(ActiveMQTopicPublisher.java:151) at com.nec.tdd.tools.platformX.util.PingJMSMsg$Publisher.publishMessage(PingJMSMsg.java:122) at com.nec.tdd.tools.platformX.util.PingJMSMsg$Publisher.run(PingJMSMsg.java:102) Caused by: java.net.SocketException: Connection reset by peer: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at org.apache.activemq.transport.tcp.TcpBufferedOutputStream.write(TcpBufferedOutputStream.java:95) at java.io.DataOutputStream.write(DataOutputStream.java:85) at org.apache.activemq.openwire.v1.BaseDataStreamMarshaller.tightMarshalByteSequence2(BaseDataStreamMarshaller.java:403) at org.apache.activemq.openwire.v1.MessageMarshaller.tightMarshal2(MessageMarshaller.java:160) at org.apache.activemq.openwire.v1.ActiveMQMessageMarshaller.tightMarshal2(ActiveMQMessageMarshaller.java:88) at org.apache.activemq.openwire.v1.ActiveMQObjectMessageMarshaller.tightMarshal2(ActiveMQObjectMessageMarshaller.java:88) at org.apache.activemq.openwire.OpenWireFormat.marshal(OpenWireFormat.java:240) at org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:120) at org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor.java:141) at org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:86) at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:77) at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:44) at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:63) at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:68) at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1108) ... 6 more I hope this was helpful and would lead to a fix as this is a crital test scenario for us. Thanks in advance regards karthik -- View this message in context: http://www.nabble.com/publish%28%29-call-to-remote-JMS-server-hangs-t1446830.html#a3908376 Sent from the ActiveMQ - User forum at Nabble.com.