activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kspat <karthik.pataward...@gmail.com>
Subject Message producer losing connections with consumer in the jms framework with apache activemq as message broker
Date Tue, 21 Aug 2012 13:58:58 GMT
We have a jms framework implemented with activemq version 5.2 being used as
broker for the communication for HA setup. The activemqbroker is a separate
process which opens up the port for the jms communication. When the HA
related process is restarted on the local HA server (message consumer), it
connects & listens to the jms port of the peer server (which is message
producer). There after the changes done on the peer will be listened by the
local server (being listener) and data synch up will happen. We have 2
connections to the jms port of the peer server from local server – each has
its own data to synch up. Usually we see 4 connection to the peer from the
local and vice versa. The data synch up is 2 way – the each server acts as
consumer for the change from peer and producer for the changes made in local
which will be consumed by peer server.

We are seeing the issue where the producer is losing the communication with
the consumer. But the consumer is not aware that producer has disconnected
itself. Consumer is still listening to Producer. We are not seeing in JMS
exception thrown from the Producer. If jms exception is thrown then we catch
the same from consumer side. Also we are using Auto Ack from the consumer
side (to be sent to Producer). We are seeing following exception on the
activemq logs on the producer side:

[serverA:57346] DEBUG Transport                      - Transport failed:
java.net.SocketException: Connection timed out
java.net.SocketException: Connection timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
      at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
      at java.io.DataInputStream.readInt(DataInputStream.java:353)
      at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
      at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:210)
      at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:202)
      at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
      at java.lang.Thread.run(Thread.java:595)

Also when the issue is seen the number of connections from peer to local
will drop to 2 from existing 4. The producer has lost the connection with
the consumer but consumer has not. Please refer the netstat output from both
server:

On proper working set up: (highlighted text refers the connection with peer
server)
Consumer side:
Server_A.61616  Server_B.58484  64240      0 64240      0 ESTABLISHED
Server_A.53451  Server_B.61616  64240      0 64240      0 ESTABLISHED
Server_A.61616  Server_B.63886  64240      0 64240      0 ESTABLISHED
Server_A.49525  Server_B.61616  64240      0 64240      0 ESTABLISHED

Producer side:
Server_B.61616  Server_A.49525  64240      0 64240      0 ESTABLISHED
Server_B.58484  Server_A.61616  64240      0 64240      0 ESTABLISHED
Server_B.63886  Server_A.61616  64240      0 64240      0 ESTABLISHED
Server_B.61616  Server_A.53451  64240      0 64240      0 ESTABLISHED


Netstat output after the issue was seen:
Consumer side:
Server_A.53451  Server_B.61616  64240      0 64240      0 ESTABLISHED
Server_A.49525  Server_B.61616  64240      0 64240      0 ESTABLISHED

Producer side:
Server_B.58484  Server_A.61616  64240      0 64240      0 ESTABLISHED
Server_B.63886  Server_A.61616  64240      0 64240      0 ESTABLISHED

It would be great if somebody could guide us on this.




--
View this message in context: http://activemq.2283324.n4.nabble.com/Message-producer-losing-connections-with-consumer-in-the-jms-framework-with-apache-activemq-as-messar-tp4655378.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Mime
View raw message