Hello,

We are using 2.7.1 version of .NET client and 2.7.1 rabbitmq-server.
Several times we catched all consumers of rabbitmq server was hang
after network instability (lost and reestablished connection or server
with rabbitmq power cable unpluged)

Problem method is IModel.Close() or IConnection.Close() (sorry, I
don't remember which is)

Parts of our code responded for connection below:

public void Connect()
{
var cf = new ConnectionFactory
{
HostName = replica.EndPoint.Address.ToString(),
Port = replica.EndPoint.Port,
UserName = mqUsername,
Password = mqPassword,
};
connection = cf.CreateConnection();
Model = connection.CreateModel();
Model.DeclareQueue(queueName);
Model.BasicConsume(queueName, false, thisConsumerTag, true, false,
null, this);
}

public void Disconnect(){
if (Model != null && Model.IsOpen) Model.Close(200, "Close on client
initiative");
if (connection != null && connection.IsOpen) connection.Close(200,
"Close on client initiative", disconnectTimeout);
}

Can anyone suggest a right way to close connection without chance to
hang?
Would appreciate for help.

Search Discussions

  • Busoli, Simone at Feb 17, 2012 at 4:08 pm
    Alexey, you need to enable heartbeats to make sure that you detect network issues. It's an option on the ConnectionFactory class.

    -----Original Message-----
    From: rabbitmq-discuss-bounces at lists.rabbitmq.com [mailto:rabbitmq-discuss-bounces at lists.rabbitmq.com] On Behalf Of Alexey
    Sent: venerd? 17 febbraio 2012 11:22
    To: rabbitmq-discuss at lists.rabbitmq.com
    Subject: [rabbitmq-discuss] Consumers may hang after network instability

    Hello,

    We are using 2.7.1 version of .NET client and 2.7.1 rabbitmq-server.
    Several times we catched all consumers of rabbitmq server was hang after network instability (lost and reestablished connection or server with rabbitmq power cable unpluged)

    Problem method is IModel.Close() or IConnection.Close() (sorry, I don't remember which is)

    Parts of our code responded for connection below:

    public void Connect()
    {
    var cf = new ConnectionFactory
    {
    HostName = replica.EndPoint.Address.ToString(),
    Port = replica.EndPoint.Port,
    UserName = mqUsername,
    Password = mqPassword,
    };
    connection = cf.CreateConnection();
    Model = connection.CreateModel();
    Model.DeclareQueue(queueName);
    Model.BasicConsume(queueName, false, thisConsumerTag, true, false, null, this); }

    public void Disconnect(){
    if (Model != null && Model.IsOpen) Model.Close(200, "Close on client initiative");
    if (connection != null && connection.IsOpen) connection.Close(200, "Close on client initiative", disconnectTimeout); }

    Can anyone suggest a right way to close connection without chance to hang?
    Would appreciate for help.
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

    _________________________________________________________________________________________________________________
    Questo messaggio ? da intendersi esclusivamente ad uso del destinatario e pu? contenere informazioni che sono di natura privilegiata, confidenziale
    o non divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non ? il destinatario designato, o il dipendente/agente responsabile
    per la consegna del messaggio al destinatario designato, si informa che ogni disseminazione, distribuzione o copiatura di questa comunicazione ?
    strettamente proibita anche ai sensi del decreto legislativo 196/03 . Se avete ricevuto questo messaggio per errore, vi preghiamo di notificarcelo
    immediatamente a mezzo e-mail di risposta e successivamente di procedere alla cancellazione di questa e-mail e relativi allegati dal vostro sistema.
    _________________________________________________________________________________________________________________
    This message is intended only for the use of the addressee and may contain information that is privileged, confidential and exempt from
    disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the
    message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly
    prohibited. If you have received this e-mail in error, please notify us immediately by return e-mail and delete this e-mail and all attachments from
    your system.
    _________________________________________________________________________________________________________________
  • Alexey at Feb 20, 2012 at 1:05 pm
    Thanks, Simone.
    I've tried this solution and stuck with bug 24650.
    Hope it will be fixed in next release.
    On 17 ???, 22:08, "Busoli, Simone" wrote:
    Alexey, you need to enable heartbeats to make sure that you detect network issues. It's an option on the ConnectionFactory class.







    -----Original Message-----
    From: rabbitmq-discuss-boun... at lists.rabbitmq.com [mailto:rabbitmq-discuss-boun... at lists.rabbitmq.com] On Behalf Of Alexey
    Sent: venerd? 17 febbraio 2012 11:22
    To: rabbitmq-disc... at lists.rabbitmq.com
    Subject: [rabbitmq-discuss] Consumers may hang after network instability

    Hello,

    We are using 2.7.1 version of .NET client and 2.7.1 rabbitmq-server.
    Several times we catched all consumers of rabbitmq server was hang after network instability (lost and reestablished connection or server with rabbitmq power cable unpluged)

    Problem method is IModel.Close() or IConnection.Close() (sorry, I don't remember which is)

    Parts of our code responded for connection below:

    public void Connect()
    {
    ? ? ? ? var cf = new ConnectionFactory
    ? ? ? ? {
    ? ? ? ? ? ? ? ? HostName = replica.EndPoint.Address.ToString(),
    ? ? ? ? ? ? ? ? Port = replica.EndPoint.Port,
    ? ? ? ? ? ? ? ? UserName = mqUsername,
    ? ? ? ? ? ? ? ? Password = mqPassword,
    ? ? ? ? };
    ? ? ? ? connection = cf.CreateConnection();
    ? ? ? ? Model = connection.CreateModel();
    ? ? ? ? Model.DeclareQueue(queueName);
    ? ? ? ? Model.BasicConsume(queueName, false, thisConsumerTag, true, false, null, this); }

    public void Disconnect(){
    ? ? ? ? if (Model != null && Model.IsOpen) Model.Close(200, "Close on client initiative");
    ? ? ? ? if (connection != null && connection.IsOpen) connection.Close(200, "Close on client initiative", disconnectTimeout); }

    Can anyone suggest a right way to close connection without chance to hang?
    Would appreciate for help.
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

    ___________________________________________________________________________ ______________________________________
    Questo messaggio ? da intendersi esclusivamente ad uso del destinatario e pu? contenere informazioni che sono di natura privilegiata, confidenziale
    o non divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non ? il destinatario designato, o il dipendente/agente responsabile
    per la consegna del messaggio al destinatario designato, si informa che ogni disseminazione, distribuzione o copiatura di questa comunicazione ?
    strettamente proibita anche ai sensi del decreto legislativo 196/03 . Se avete ricevuto questo messaggio per errore, vi preghiamo di notificarcelo
    immediatamente a mezzo e-mail di risposta e successivamente di procedere alla cancellazione di questa e-mail e relativi allegati dal vostro sistema.
    ___________________________________________________________________________ ______________________________________
    This message is intended only for the use of the addressee and may contain information that is privileged, confidential and exempt from
    disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the
    message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly
    prohibited. If you have received this e-mail in error, please notify us immediately by return e-mail and delete this e-mail and all attachments from
    your system.
    ___________________________________________________________________________ ______________________________________

    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
  • Simon MacMullen at Feb 20, 2012 at 1:08 pm

    On 20/02/12 13:05, Alexey wrote:
    I've tried this solution and stuck with bug 24650.
    Hope it will be fixed in next release.
    Yes, it will be in the next release.

    Cheers, Simon

    --
    Simon MacMullen
    RabbitMQ, VMware
  • Laputa at Mar 1, 2012 at 2:19 am
    We use python client amqplib, and have the same question.
    I set the heartbeat, but it didn't work.


    ? 2012?2?18????UTC+8??12?08?16??Busoli, Simone???
    Alexey, you need to enable heartbeats to make sure that you detect network
    issues. It's an option on the ConnectionFactory class.

    -
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120229/6b436558/attachment.htm>
  • Laputa at Mar 1, 2012 at 2:20 am

    We use python client amqplib, and have the same question.
    I enable the heartbeats, but it doesn't work.


    ? 2012?2?18????UTC+8??12?08?16??Busoli, Simone???
    Alexey, you need to enable heartbeats to make sure that you detect
    network issues. It's an option on the ConnectionFactory class.

    -
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120229/62b22842/attachment.htm>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedFeb 17, '12 at 10:22a
activeMar 1, '12 at 2:20a
posts6
users4
websiterabbitmq.com
irc#rabbitmq

People

Translate

site design / logo © 2022 Grokbase