Skip to content

"Exchanges cannot be declared when disconnected" #6

Open
omnimod-technologies/Unity3D.Amqp
#2
@borogove

Description

@borogove

After connecting to the broker, and receiving a list of existing exchanges, I try to declare a new direct exchange:

	AmqpClient.DeclareExchange( "session.default.actuator", AmqpExchangeTypes.Direct ); 

And immediately get this exception:

InvalidOperationException: Exchanges cannot be declared when disconnected
CymaticLabs.Unity3D.Amqp.RabbitMq.RabbitMqBrokerConnection.DeclareExchange (System.String name, AmqpExchangeTypes type, Boolean durable, Boolean autoDelete, IDictionary`2 args)
CymaticLabs.Unity3D.Amqp.AmqpClient.DeclareExchangeOnHost (System.String name, AmqpExchangeTypes type, Boolean durable, Boolean autoDelete, IDictionary`2 args) (at Assets/CymaticLabs/Amqp/Scripts/AmqpClient.cs:1393)
CymaticLabs.Unity3D.Amqp.AmqpClient.DeclareExchange (System.String name, AmqpExchangeTypes type, Boolean durable, Boolean autoDelete, IDictionary`2 args) (at Assets/CymaticLabs/Amqp/Scripts/AmqpClient.cs:1379)
ClientNode.PostConnect () (at Assets/Scripts/Messaging/ClientNode.cs:19)
BaseMessagingNode+<DeferredPostConnect>c__Iterator0.MoveNext () (at Assets/Scripts/Messaging/BaseMessagingNode.cs:93)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

AmqpClient.Instance.IsConnected is true at this point.

I get the same result whether I declare the exchange synchronously on the "FinishConnected" callback from GetExchangesAsync, or following it via a Unity coroutine that waits for a second or two afterward.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions