Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Exchanges cannot be declared when disconnected" #6

Open
borogove opened this issue Aug 3, 2017 · 2 comments · Fixed by omnimod-technologies/Unity3D.Amqp#2
Open

Comments

@borogove
Copy link

borogove commented Aug 3, 2017

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?

@Monoblanco4
Copy link

Were you able to figure it out? I am getting the same error in the same situation, AmqpClient.Instance.IsConnected is true for me as well the same point.

@klydra
Copy link

klydra commented Jul 10, 2020

Were you able to figure it out? I am getting the same error in the same situation, AmqpClient.Instance.IsConnected is true for me as well the same point.

Same here...

EDIT:
I couldn't find any solution to fix this error.
Alternative library to use here : #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants