0

I am starting using RabbitMQ with Swift. I had followed the example code from the library for RabbitMQ on github:

let delegate = RMQConnectionDelegateLogger() 
let conn = RMQConnection(uri: "amqp://localhost:5672", delegate: delegate)

conn.start()

let ch = conn.createChannel()

let q = ch.queue("hello")
q.subscribe { rm in
    print(rm.content )
}

And I get a lot of times these errors:

Will start recovery for connection: <' Received connection: <'RMQConnection: 0x7fdb43c73670> disconnectedWithError: Error Domain=GCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo={NSLocalizedDescription=Socket closed by remote peer}RMQConnection: 0x7fdb43c73670>

And on the RabbitMQ log I got this error:

Error on AMQP connection <0.271.0> (172.19.0.1:53144 -> 172.19.0.4:5672, state: starting): PLAIN login refused: user '' - invalid credentials

Where can I define the credentials? I had searching a lot for an example and I can't find anything.

pableiros
  • 14,932
  • 12
  • 99
  • 105

1 Answers1

0

check this:

Can't access RabbitMQ web management interface after fresh install

and after that change the URL connection as:

'amqp://test:test@localhost:5672/'
Community
  • 1
  • 1
Gabriele Santomaggio
  • 21,656
  • 4
  • 52
  • 52