Giter Site home page Giter Site logo

rabbitmq / rabbitmq-dotnet-client Goto Github PK

View Code? Open in Web Editor NEW
2.0K 119.0 575.0 62.72 MB

RabbitMQ .NET client for .NET Standard 2.0+ and .NET 4.6.2+

Home Page: https://www.rabbitmq.com/dotnet.html

License: Other

C# 98.39% PowerShell 0.83% Shell 0.67% Makefile 0.11%
rabbitmq dotnet dotnet-core c-sharp

rabbitmq-dotnet-client's Introduction

RabbitMQ .NET Client

GitHub Actions rabbitmq-dotnet-client CodeQL

This repository contains source code of the RabbitMQ .NET client. The client is maintained by the RabbitMQ team at Broadcom.

Dependency (NuGet Artifact)

The client is distributed via NuGet.

Tutorials and Documentation

Supported Platforms and .NET Releases

6.x

Latest 6.x versions of the library require .NET framework 4.6.1 or a .NET version up to 7. They also introduce potentially breaking public API changes covered in the changelog.

5.x and 4.x

4.x and 5.x versions of the library require .NET 4.5.1 or later or .NET Core. For .NET Core users, 2.0 is the minimum supported version for 5.x series.

Change Log

See CHANGELOG.md.

Building from Source

Please see How to Run Tests for the build and test process overview.

Contributing

See Contributing and How to Run Tests.

License

This package, the RabbitMQ .NET client library, is double-licensed under the Mozilla Public License 2.0 ("MPL") and the Apache License version 2 ("ASL").

This means that the user can consider the library to be licensed under any of the licenses from the list above. For example, you may choose the Apache Public License 2.0 and include this client into a commercial product.

rabbitmq-dotnet-client's People

Contributors

0x6e6562 avatar barshavit avatar bollhals avatar bording avatar danielmarbach avatar dpw avatar dumbbell avatar essiene avatar githubpang avatar gserjo avatar janeggers avatar jeremymahieu avatar joefitzgerald avatar kjnilsson avatar lukebakken avatar marcialrosales avatar michaelklishin avatar ngbrown avatar paulomorgado avatar pergh avatar pliner avatar rade avatar rosca-sabina avatar scooletz avatar sergeyshaykhullin avatar spring-operator avatar stebet avatar tonyg avatar weihanli avatar yulerb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rabbitmq-dotnet-client's Issues

WinRT/Windows Store support

Guys,

I'm in some kind of trouble ... I don't know how to solve it. The problem is I'm building a Metro Style app with RabbitMQ.Client.Dll and when I try to instantiate a IBasicProperties or use BasicPublish the source stop compiling with the following error:
1>e:\Julio\Projetos\GitHub\RabbitMQ.Client.dll : error CS0011: The base class or interface 'System.ICloneable' in assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' referenced by type 'RabbitMQ.Client.IContentHeader' could not be resolved

Read somewhere that this is because ICloneable doesn't exist anymore on WinRT.Should be useful to build full Win Store apps using RabbitMQ.

Follow semver in public interfaces

Hi,

Unfortunately it's not safe to upgrade RabbitMQ.Client from 2.5.1 to 2.6.0 if you depend on a public interface. You will get MissingMethodException - for the future, the client should follow semver and upgrade a major version number if it is renaming or removing methods or retyping method parameters or base classes, or package managers will upgrade the package and the applications depending on it will fail.

For an example, try out MassTransit.RabbitMQ, then run upgrade-package RabbitMQ.Client - you should see breakages when receiving messages (there will be an assembly redirect added).

Henrik

QueueingBasicConsumer does not AutoRecover

With AutomaticRecoveryEnabled, a QueueingBasicConsumer does not resume when a connection is reestablished, because the OnCancel call closes the queue. Nothing in the recovery reopens it. I worked around by creating my own consumer that does not close the queue on cancel.

async/await API

Originally this issue was about enabling of message publishing with a natural future ("awaitable" in the .NET world) API.

After some discussions with the .NET community, it makes more sense for us to switch to async/await entirely. This is a major change. The users who cannot upgrade in the meantime will be able to use 3.6.x versions with future RabbitMQ releases.

The decision is to develop a completely new client oriented towards async/await, although #307 introduce it in a place where it makes most sense and can be done with relatively few breaking changes.

Messages prefetched but not dequeued.

I'm sorry for vagueness in the text below, but we're dealing with a pretty vague problem.

We recently upgraded from a pretty old client (3.1.0) to 3.3.2 and with this new version every now and then we have a consumer has prefetched messages but is not dequeueing anything anymore.

We have old code that uses the rabbitmq client library directly - which we didn't change when the problem arose - and new code that uses masstransit with rabbitmq. Both implementations are dealing with this problem, which suggests/implicates the problem is not in our code.

We tried using a different server (3.3.5 CentOS instead of 3.0.1 on windows server) and the problem still occurs so the problem doesn't seem to be in the server either.

Only thing left is a problem in the client. Because it only happens every 1M messages or so, we've only seen this happen in our production environment. We haven't been able to reproduce the problem.

Is there any bug known that can cause this? Or maybe a new issue?

Build nuget packages from this repository.

For years, @joefitzgerald has been taking the official dll's and packaging them into nuget packages from a separate repository (link). The .nuspec and build scripts should be moved to this repository so that future merges to support additional platforms (Windows Store and portable apps) can appropriately adjust the nuget generation.

ConnectionShutdown on AutoRecoveryingConnection does not work in c# client

ConnectionShutdown does not work with AutoRecoveringConnection in the C# implementation. I can confirm this in version 3.4.0 and after looking at master, it appears to still be in there.

The reason for this is because the delegates run sequentially and recoveryListener will always be the first subscribed event as it is called in init(). However when recoverListener is called, it eventually runs the method RecoverConnectionDelegate which is in a loop until reconnect. This means that all subsequent delegates are blocked.

Because of my lack of understanding of this project mainly around threading I have not supplied a patch. I didn't understand why there is locking in both recoveryListener and BeginAutomaticRecovery, which is unfortunate because I think the best fix would be to use timers and remove Thread.Sleep(m_factory.NetworkRecoveryInterval). I have also tried spawning a new thread to handle the reconnection delegate but noticed there is a lot of exceptions being thrown in the RabbitMq.Client library, so I'm unsure whether someone wanted to keep this thread blocked.

To keep the code intact I have done a hokey fix by changing Connection.cs from:
foreach (ConnectionShutdownEventHandler h in handler.GetInvocationList()) {
to
foreach (ConnectionShutdownEventHandler h in handler.GetInvocationList().Reverse()) {
to fix this problem.

Error connecting over SSL

Hi,

Ive been trying to connect to my rabbitmq broker using SSL but I keep getting the following exception;

"A call to SSPI failed"

var connectionFactory = new ConnectionFactory()
            {
                HostName = {hostname},
                Port = 5671,
                UserName = "guest",
                Password = "guest",
                AuthMechanisms = new AuthMechanismFactory[] {new ExternalMechanismFactory()},
                Ssl = new SslOption
                {
                    Enabled = true,
                    ServerName = {hostname},
                    Version = SslProtocols.Tls12,
                    AcceptablePolicyErrors = SslPolicyErrors.RemoteCertificateNameMismatch |
                                             SslPolicyErrors.RemoteCertificateChainErrors,
                },
            };                

            using (IConnection conn = connectionFactory.CreateConnection())
            {
               .....
            }

Ive found this;

http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2013-November/031709.html

Not sure what the correct approach is to get this working. Ive written the same code in Java and it connects to my broker fine. My colleague has also posted this on stackoverflow.

Can anyone point me in the right location?

Thanks,

Jon

RecoverQueue deletes recorded bindings before they can be recovered

AutorecoveringConnection calls RecoverQueues, which in turn calls DeleteRecordedQueue(oldName). This function executes m_recordedBindings.RemoveWhere(b => name.Equals(b.Destination)); The next call to RecoverBindings does nothing, since the bindings were removed for the old queue name.

each connection uses 3 threads

When using heartbeat, RabbitMQ.Client.Framing.Impl.Connection uses at least 3 threads:

  • mainLoopThread
  • Inbound heartbeat thread (HeartbeatReadLoop)
  • Outbount heartbeat thread (HeartbeatWriteLoop)

It woud be nice to decreases that count to benefit from .net io threads.

IModel.Dispose() hangs after consuming with IBasicConsumer.HandleBasicDeliver()

Starting with version 3.5 of .NET client, I'm seeing an issue with disposing models after consuming on that channel. Dispose() will hang indefinitely. There was nothing wrong with the connection when this happened. Everything was running smoothly. I have an application that may frequently create and dispose channels on which we consume messages. In the mean time I have reverted to 3.4.3 so my application works.

Thanks

Issue on removing connection while closing Application.

I am using .NET RabbitMQ Client library. I want to develop a messaging system. For this, I have implemented all necessary methods of RabbitMQ. Moreover I have to develope dispose() for removing connection from RabbitMQ as connection is not removed automatically. I am calling this method in FormClosing() event so this method will be triggered when user closes the application by clicking on close button and by the logic connection will be removed. Up to this, all code is working perfectly.

The problem is,
Calling a dispose() to remove connection explicitly is bad practice so i don’t want to use dispose(). I'm not able to remove any connection at the time of closing the application without triggering dispose(). Connection remains into RabbitMQ.

Question:

How to remove this connection from RabbitMQ without calling dispose() explicitly?

Subscription gets stuck when publishing with a separate IModel in v3.5.0+

Environment:

  • Windows 7 x64
  • Erlang 17.1
  • RabbitMQ Server 3.5.1

Ever since the pull request #37 was merged (v3.5.0+) the following code stopped working:

namespace Test
{
    using System;
    using System.Text;
    using System.Threading;
    using System.Threading.Tasks;
    using RabbitMQ.Client;
    using RabbitMQ.Client.Events;
    using RabbitMQ.Client.MessagePatterns;

    internal class Program
    {
        private static void Main(string[] args)
        {
            Console.WriteLine("Write something and press enter to send it to the message queue.");
            Console.WriteLine("Write 'exit' (without quotes) to quit.");

            var connectionFactory = new ConnectionFactory
            {
                Uri = "amqp://guest:guest@localhost:5672"
            };

            using (var connection = connectionFactory.CreateConnection())
            {
                using (var model = connection.CreateModel())
                {
                    model.QueueDeclare(queue: "test", durable: true, exclusive: false, autoDelete: false, arguments: null);
                }

                var token = new CancellationTokenSource();
                var task = Task.Run(() =>
                {
                    using (var model = connection.CreateModel())
                    using (var subscription = new Subscription(model, queueName: "test", noAck: false))
                    {
                        while (!token.IsCancellationRequested)
                        {
                            BasicDeliverEventArgs e;
                            if (subscription.Next(500, out e))
                            {
                                Console.WriteLine("Message received: {0}", Encoding.UTF8.GetString(e.Body));
                                subscription.Ack(e);
                            }
                        }
                    }
                });

                string msg;
                while (((msg = Console.ReadLine())) != "exit")
                {
                    Program.Publish(connection, msg);
                }
                token.Cancel();
                task.Wait();
            }
        }

        private static void Publish(IConnection connection, string msg)
        {
            using (var model = connection.CreateModel())
            {
                model.BasicPublish(exchange: string.Empty, routingKey: "test", mandatory: true, immediate: false, basicProperties: null, body: Encoding.UTF8.GetBytes(msg));
            }
        }
    }
}

If you run the previous code using the client library v3.4.3-, the messages will echo just fine. If you run it using v3.5.0+, the messages will get stuck in the queue as 'Unacked' and they will never echo.

Is this a bug, or have I been wrongly using the client library and this change evidenced it?

Make IQueueingBasicConsumer and ISubscription public

I am trying to have some cases covered by tests, some of the interfaces I need to mock are made internal in the solution (e.g. I would like to mock IQueueingBasicConsumer).
Is there any reason for interfaces like IQueueingBasicConsumer, ISubscription not being exposed?

EventingBasicConsumer Should Expose Constructor That Accepts IModel

EventingBasicConsumer inherits from DefaultBasicConsumer which exposes an overloaded constructor that takes and existing IModel instance. The same constructor should exist on EventingBasicConsumer and pass the IModel instance down to DefaultBasicConsumer(IModel).

Currently any instance of EventingBasicConsumer will always have a NULL value for the Model property.

Dequeue might never return

while (true)
{
    try
    {
        while (true)
        {
            try
            {
                using (var c = factory.CreateConnection())
                using (var m = c.CreateModel())
                {
                    var exchange = "app-logging";
                    var consumer = new QueueingBasicConsumer(m);
                    var props = new Dictionary<string, object>()
                        {
                            {"x-expires", 30*60000} // expire queue after 30 minutes, see http://www.rabbitmq.com/extensions.html
                        };

                    m.ExchangeDeclare(exchange, ExchangeType.Topic);
                    var q = m.QueueDeclare("", false, true, false, props);
                    m.QueueBind(q, exchange, "#");
                    m.BasicConsume(q, true, consumer);

                    while (true)
                    {
                        var msg = (BasicDeliverEventArgs) consumer.Queue.Dequeue();

                        if (msg.BasicProperties.IsAppIdPresent())
                            Console.Write(msg.BasicProperties.AppId + " ");

                        Console.WriteLine(msg.Body.AsUtf8String());
                    }
                }
            }
            catch (BrokerUnreachableException)
            {
                Console.WriteLine("Could not connect, retrying...");
                Thread.Sleep(1000);
            }
        }
    }
    catch (EndOfStreamException)
    {
        Console.WriteLine("RabbitMQ went down, re-connecting...");
        continue;
    }
    catch(IOException)
    {
        Console.WriteLine("RabbitMQ went down ungracefully, re-connecting...");
        continue;
    }
}

This might fail by blocking indefinitely on Dequeue. First start program with RMQ up and running. Then shut down RMQ. try to bring RMQ back up. Never happens.

This is targeting 2.5.1 - because 2.6.1 breaks a public interface, so I could try a version 2.6.2 that again is binary compatible with 2.5.1, if such a version is released.

NuGet Package

With NuGet there is now a gem like package managment system avaiable. So it would be a good idea to provide this client also there.

3.4.4 -> 3.5.1 Timeout

I have a small wrapper using this library on .NET 4.5.
I've updated from 3.4.4 to 3.5.1 and now, the connection gets closed and it crashes whenver I try to awknowledge a message:
AMQP close-reason, initiated by Library, code=0, text="End of stream"

I've found that this only happens when processing the message takes more than the current RequestHeartbeat. So if I increase it, it Ack() fine, otherwise it closes the connection and if throws.

Has anything changed related to this or am I using RequestHeartbeat in the wrong way?

Named parameter version of the API

This is just a generic request. I've noticed this client/API is very Boolean happy. I'd much rather see overloads which take in specific purpose enums.

I just put together a demo app and in reviewing the code I wrote yesterday, I'm having difficulty reading it. Compare what I have with what it could be.

What I have:
model.QueueDeclare(queueName, true, false, false, null);

What I could have:
model.QueueDeclare(queue:queueName, durable:true, exclusive:false, autoDelete:false, arguments:null);

What I'd like to have:
model.QueueDeclare(queueName, Durability.Durable, Scope.Public, OnEmpty.DoNotDelete);

The names of the enums are merely a suggestion -- if you can think of better names, go for it. I'd just like to see more overloads, default parameters, & enums.

Regarding default parameters, I'd even go so far as to say model.QueueDeclare(queueName) is acceptable so long as IntelliSense told me what all the defaults were.

RabbitMQ randomly disconnects from server on localhost

I use RabbitMQ 3.5.1 and latest .net client.
I often get
System.IO.EndOfStreamException: SharedQueue closed
at RabbitMQ.Util.SharedQueue1.EnsureIsOpen() at RabbitMQ.Util.SharedQueue1.Dequeue(Int32 millisecondsTimeout, T& result)

though both client and server reside on the same host & heartbeat is enabled

An example of a program that receives such errors is:

 static void InternalTask()
  {
   var factory = new ConnectionFactory() { HostName = "localhost",RequestedHeartbeat = 30};
   using (var connection = factory.CreateConnection())
   {
    using (var channel = connection.CreateModel())
    {
     channel.QueueDeclare("LoneWorker", true, false, false, null);

     channel.BasicQos(0, 1, false);
     var consumer = new QueueingBasicConsumer(channel);
     channel.BasicConsume("LoneWorker", false, consumer);
     _loger.Info(" [*] Waiting for messages.  To exit press CTRL+C");
     while (true)
     {
      var ea =consumer.Queue.Dequeue();

      var body = ea.Body;
      var message = Encoding.UTF8.GetString(body);
      _loger.Info(" [x] Received {0}", message);
      channel.BasicAck(ea.DeliveryTag, false);
     }
    }
   }
  }

Accessing disposed object

System.ObjectDisposedException was unhandled
  Message=Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
  Source=System
  ObjectName=System.Net.Sockets.Socket
  StackTrace:
       at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
       at System.Net.Sockets.TcpClient.set_LingerState(LingerOption value)
       at RabbitMQ.Client.Impl.SocketFrameHandler_0_9.Close()
       at RabbitMQ.Client.Impl.ConnectionBase.FinishClose()
       at RabbitMQ.Client.Impl.ConnectionBase.HeartbeatWriteLoop()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

When having connections open and then terminating the server.

Expected some of the RMQ exceptions to be thrown.

Log messages:

The thread '<No Name>' (0x2cb0) has exited with code 0 (0x0).
A first chance exception of type 'System.IO.EndOfStreamException' occurred in RabbitMQ.Client.dll

Lib version: 2.7.1.

This exception tears down the app domain.

SimpleRpcClient bug when CorrelationId doesn't match?

In tutorial 6 (rpc): http://www.rabbitmq.com/tutorials/tutorial-six-dotnet.html
It says that "If we see an unknown correlationId value, we may safely discard the message - it doesn't belong to our requests.". The example RPCClient shown has this if guard in its Call() override:
if (ea.BasicProperties.CorrelationId == corrId)

However, you can see in SimpleRpcClient, that an exception is being thrown if the CorrelationId doesn't match.
https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/master/projects/client/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcClient.cs#L396

I'm just testing and setting up boilerplate stuff right now. I have a single client (based on SimpleRpcClient) that sends 1000 requests. If I have a single worker (server) running, it works fine. If I run more servers, they are all dropping their replies into the same reply queue, and I quickly get the exception.

Seems that perhaps in Subscription.cs, in both overloads for Next(), when you call consumer.Queue.Dequeue(), correlationIds should be checked before MutateLatestEvent is called or m_latestEvent set (and if it doesn't match, just ignore, don't throw an exception). You don't want to set the latest event for the wrong message, right? Subscription.Next() is called from SimpleRpcClient.RetrieveReply (where the mismatched correlationId exception is being thrown). Could Next() keep trying until it gets the right reply?

Am I going about this incorrectly?

Producer/client => exchange => multiple SimpleRpcServers
The multiple servers could be processing multiple requests from the same client, and therefore drop replies into the same temp reply queue, yes? But that's where it's blowing up for me.

Thoughts?

'Descriptor is not a socket' when running on Mono

Every now and again, I'm getting the following exception when running on Mono:

System.Net.Sockets.SocketException: The descriptor is not a socket
  at System.Net.Sockets.Socket.SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.TcpClient.set_ReceiveTimeout (Int32 value) [0x00000] in <filename unknown>:0 
  at RabbitMQ.Client.Impl.SocketFrameHandler_0_9.set_Timeout (Int32 value) [0x00000] in <filename unknown>:0 
  at RabbitMQ.Client.Impl.ConnectionBase.ClosingLoop () [0x00000] in <filename unknown>:0

This has been happening at least since Mono 3.0.6 and RabbitMQ 3.2.1, I don't have data from earlier. Rate of this error happening right now is around 0.02% of all messages sent - but it's quite stable, and, frankly, worrying.

I'm not sure why this is happening in the first place -

has catch clauses around the relevant code. Am I missing something?

Oh and this has been going around at least since 2010, it seems: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2010-October/009270.html

I've seen the commit from @michaelklishin that was later reverted by @rade that seems to touch on the same issue - but as @rade mentions, that shouldn't be necessary, there are already catch clauses for the exception. I mean, those are re-thrown in ``Dispose()` later, but, according to the stack trace, that's not even the case here.

3.0.0 Changelog

I can't seem to find any documentation regarding what is new in 3.0.0 other than reading through the commit logs. Is there any possibility to get this information in an easier format?

Support connection lists and host selection strategies

I think it would be very useful to have a thin wrapper. For instance, the Java client supports creating a connection factory providing an array of addresses (ip and port). I read something about auto-healing although I don't remember seeing it documented and so I'm not sure if it's fully supported.

Specifically, I would like to be able to provide multiple servers and the client should take care of the rest. What happens if the current server goes down? Switch to another server. Perhaps have options for how many attempts before giving up, how to pick the next server...

Best way to close a Connection object shared across threads

I have a .net console that delivers a high volume of messages to RabbitMQ that shares a Connection object across all threads. What are the suggested practices for closing the connection at the end of execution? We notice the console will not exit until the connection is explicitly closed. Setting AutoClose = true after channel creation tears down at inconsistent points so perhaps we are missing an additional setting.

Revamp code generator

We've been avoiding tweaking code generator much in recent years because it's fairly hard to make non-trivial changes. As a result it is much harder to refactor the rest of the library because we depend on the existing ModelBase hierarchy and responsibility scope heavily.

Now that we require .NET 4.0, we can investigate Expression Trees. The idea of using F# has came up a few times in the past (for templating, implementing ModelBase in F# and relying e.g. on Code Quotations will likely suffer from the law of diminishing returns in our case).

Specific points of improvements we should aim for:

  • Make it easier to make changes to ModelBase
  • Split generator ModelBase into smaller parts
  • Make generated code better suited for future API and implementation changes, e.g. in #16 and #20.

Since the code generation artefacts are not exposed to end users, we can make breaking changes there but preserving .NET and Mono compatibility is a must.

Consumers do not resume on AutoRecovery because ConsumerWorkService is Shutdown

Looks like in 3.5.0 HandleBasicDeliver is delegated to the dispatcher. Trouble seems to be when the connection was closed, Shutdown was called on the work service, clearing all the keys out. Nothing re-registers the keys with the work service when the connection is restored.

[RabbitMQ.Client.Impl.RecoveryAwareModel] {Session#1:Connection(aa6ca86e-62e9-4a25-aac2-dd2a6fc66aa7,amqp://localhost:5672)} RabbitMQ.Client.Impl.RecoveryAwareModel

The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary2.get_Item(TKey key) at RabbitMQ.Util.BatchingWorkPool2.AddWorkItem(K key, V item) in projects\client\RabbitMQ.Client\src\util\BatchingWorkPool.cs:line 65

QueueDeclare with AutoDelete = true is causing Queue to be deleted before it can be bound?

Hi All,

Running into a strange issue upgrading from 3.4.x to 3.5.1. (Could be that my usage is incorrect.)

I declare a queue/bind as follows (this used to work fine in 3.4.x):

msgBusChannel = mMsgBusConnection.CreateModel();
msgBusChannel.ExchangeDeclare(mExchangeName, ExchangeType.Topic);
msgBusChannel.QueueDeclare(mQueueName, false, false, true, null);
msgBusChannel.QueueBind(mQueueName, mExchangeName, mRoutingKey, null);

mConsumer = new QueueingBasicConsumer(msgBusChannel);
mConsumerTag = msgBusChannel.BasicConsume(mQueueName, true, mConsumer);

while(!IsClosed && mConsumer.IsRunning) {... // process queued items}

Now after upgrading to 3.5.1 with the above my queues don't exist as far as I can tell from the RabbitMQ management page... even though the channel is still being created. So as a quick test I switched the autodelete = true to false and then my queues showed up... So I am guessing something with that behavior has changed so that the queue is being auto-deleted even though I haven't had a chance to bind it to anything yet.

Any thoughts?

EDIT:

Actually another thing I am seeing is the following (AlreadyClosedException):

Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=541, text="Unexpected Exception", classId=0, methodId=0, cause=System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

Thanks,
Piyush

DequeueNowait returns null first time.

Is it possible that DequeueNowait will return nothing the first time because no data has been prefetched yet, even when there are messages on the queue?

If I use Dequeue with a wait time of 10ms i do get a message the first time.

If this is possible, is it by design? Or is there a workaround other then using a wait period?

I'm using 2.8.7 client.

Model.QueueDeclare hangs forever

image

The process has single thread running and it's stuck in the above state forever (at least hours).
How I can investigate the issue further?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.