java.net.SocketException- Connection reset by peer : socket write error

552 views
Skip to first unread message

Rinki Bhandari

unread,
Apr 4, 2021, 8:04:18 AM4/4/21
to rabbitmq-users
Hi,

We are facing issue regarding java.net.SocketException every time On starting Esper.
Environment used : 
- RabbitMQ server - 3.8.14
- Esper version: 8.7.0
- Erlang - Erlang 23.1
- Java - jdk1.8.0_271
- RabbitMQ Java Client 5.11.0

Also we are using DefaultConsumer to consume mesages from the channel. Here are the lines used -
DefaultConsumer consumer = new DefaultConsumer (channel)
{
 @Override 
 public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException
String message = new String(body,"UTF-8");
String rountingKey = envelope.getRoutingKey();
callBack.amqpDataReceived(message,routingKey);
}
channel.basicConsume(queue,true,consumer);
callBack.amqpReceiverStared();

Below is the screenshot attached of error. Earliest help would be appreciated.
SocketError.jpg

Arnaud Cogoluegnes

unread,
Apr 6, 2021, 2:40:52 AM4/6/21
to rabbitm...@googlegroups.com
The server logs would help to find out about the reason of the connection closing.

________________________________________
From: rabbitm...@googlegroups.com <rabbitm...@googlegroups.com> on behalf of Rinki Bhandari <rinki.b...@nirvanasolutions.com>
Sent: Sunday, April 4, 2021 2:04 PM
To: rabbitmq-users
Subject: [Suspected Spam] [rabbitmq-users] java.net.SocketException- Connection reset by peer : socket write error
NOTICE - The information provided in this email, website or report(s) contains privileged and confidential information intended only for the use of the person or persons who have authority to view or use the information. If you are not the authorized person or persons, you are hereby notified that you must not disseminate copy or take any action in reliance on it. If you have received this message in error, please immediately notify Nirvana Financial Solutions, INC, its subsidiaries or associates. All reporting, data management services and software are provided on an "as is" basis without warranty of any kind. Each party hereby expressly disclaims all other warranties, whether express or implied.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com<mailto:rabbitmq-user...@googlegroups.com>.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d43316f0-d12a-43cf-90fe-88c0c46711f1n%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fd43316f0-d12a-43cf-90fe-88c0c46711f1n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7C7c66bb65d39642fc56ac08d8f761ca92%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637531346686211695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=BQ0AubR0qyKY9tWPxK0ZzsO2QFigNW%2BpFRLww0reh10%3D&reserved=0>.

Rinki Bhandari

unread,
Apr 6, 2021, 4:04:37 AM4/6/21
to rabbitmq-users
Hi  Arnaud,

Thank you for replying. I would like to know which server log would be required?  Is it RabbitMQ or our application server log?

Regards

M K

unread,
Apr 6, 2021, 5:36:09 AM4/6/21
to rabbitmq-users

Rinki Bhandari

unread,
Apr 6, 2021, 6:47:43 AM4/6/21
to rabbitmq-users
Hi,

Below is the attached log file for RabbitMQ node.

Regards

rabbit@RinkiWin-10.log

Arnaud Cogoluegnes

unread,
Apr 6, 2021, 7:20:25 AM4/6/21
to rabbitm...@googlegroups.com
The connection seems to be closed by the client according to the logs. The error occurs on a basicPublish called from some application heartbeat utility. Are you sure the connection is not closed in another place of the application and this utility keeps on working against this closed connection?

________________________________________
From: rabbitm...@googlegroups.com <rabbitm...@googlegroups.com> on behalf of Rinki Bhandari <rinki.b...@nirvanasolutions.com>
Sent: Tuesday, April 6, 2021 12:47 PM
To: rabbitmq-users
Subject: Re: [Suspected Spam] [rabbitmq-users] java.net.SocketException- Connection reset by peer : socket write error

Hi,

Below is the attached log file for RabbitMQ node.

Regards

On Tuesday, April 6, 2021 at 3:06:09 PM UTC+5:30 michael....@gmail.com wrote:
RabbitMQ node logs [1].

1. https://www.rabbitmq.com/logging.html#logged-events<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rabbitmq.com%2Flogging.html%23logged-events&data=04%7C01%7Cacogoluegnes%40vmware.com%7C0abce64a92344f435da808d8f8e96be4%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637533028716046930%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=W6YwvWMG%2FIFo%2FONXrqRoht8Rfb5P7zem5urV7OPK2tQ%3D&reserved=0>
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d43316f0-d12a-43cf-90fe-88c0c46711f1n%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fd43316f0-d12a-43cf-90fe-88c0c46711f1n%2540googlegroups.com&data=04%7C01%7Cacogoluegnes%40vmware.com%7C0abce64a92344f435da808d8f8e96be4%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637533028716046930%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=%2FETIDEI%2FI0uKrWY0mMDFzeRwMec%2BxtWDV1KSw9coJEQ%3D&reserved=0><https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fd43316f0-d12a-43cf-90fe-88c0c46711f1n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7C7c66bb65d39642fc56ac08d8f761ca92%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637531346686211695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=BQ0AubR0qyKY9tWPxK0ZzsO2QFigNW%2BpFRLww0reh10%3D&reserved=0<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fd43316f0-d12a-43cf-90fe-88c0c46711f1n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7C0abce64a92344f435da808d8f8e96be4%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637533028716056924%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=oWS7%2F%2F4Judu5aCFk2RhVKpy%2FG5KF%2B2Yly0WhAfHAh%2Fw%3D&reserved=0>>.

NOTICE - The information provided in this email, website or report(s) contains privileged and confidential information intended only for the use of the person or persons who have authority to view or use the information. If you are not the authorized person or persons, you are hereby notified that you must not disseminate copy or take any action in reliance on it. If you have received this message in error, please immediately notify Nirvana Financial Solutions, INC, its subsidiaries or associates. All reporting, data management services and software are provided on an "as is" basis without warranty of any kind. Each party hereby expressly disclaims all other warranties, whether express or implied.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com<mailto:rabbitmq-user...@googlegroups.com>.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/daa3d0b5-a42a-4342-a708-e6350a50b237n%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fdaa3d0b5-a42a-4342-a708-e6350a50b237n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7C0abce64a92344f435da808d8f8e96be4%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637533028716056924%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=gOp39933mPi4A2eES2DTJ4EzQOsDY98ZRBQALQGs7pA%3D&reserved=0>.

Rinki Bhandari

unread,
Apr 6, 2021, 7:53:13 AM4/6/21
to rabbitmq-users
Yes I am  sure the connection is not closed in another place of the application. Also I am using RabbitMQ client v5.0.0 at .NET end and RabbitMQ client v5.11.0 at Java end. It showed me QueueingConsumer/QueueingBasicConsumer as  deprecated  so I made below changes in code. 
.NetEnd.PNG
JavaEnd.PNG

M K

unread,
Apr 6, 2021, 11:17:45 PM4/6/21
to rabbitmq-users
There isn't much that can be said from this log or code snippets. None of them explain why a socket write could time out
but according to the log, your applications open N connections and never close any. It *may* be an indication of a connection leak
(which is not related to socket write failures but a very serious issue if true) [1].

A traffic capture [2] would provide a lot more relevant information about what both sides of this connection do.

Rinki Bhandari

unread,
Apr 7, 2021, 10:41:41 AM4/7/21
to rabbitmq-users
Hi,

We have opened limited connections and disposed them correctly. There is no issue of connection leak. (verified). We need an example
which is perfect way to implement channels and consumers with EventingBasicConsumer's Received event at .Net side and  DefaultConsumer at java end

Thanks
Reply all
Reply to author
Forward
0 new messages