Q:

Cloud AMPQ integration with iOS APP

I am working on to integrate cloud AMPQ to my iOS app. With RabbitMQ client, unable to make successful communication with the server. 
I have checked below stack overflow link to make a communication with the server: 
stack overflow link 
The sample source shared in above link broken. Please suggest me possible solution. Thanks in advance

A:

You should use the official client library: https://github.com/rabbitmq/rabbitmq-objc-client (Swift + ObjC compatible)
Basic Usage (extract from repo):

Instantiate an RMQConnection:
let delegate = RMQConnectionDelegateLogger() // implement RMQConnectionDelegate yourself to react to errors
let conn = RMQConnection(uri: "amqp://guest:guest@localhost:5672", delegate: delegate)

Connect:
conn.start()

Create a channel:
let ch = conn.createChannel()

Use the channel:
let q = ch.queue("myqueue")
q.subscribe({ m in
    print("Received: \(String(data: m.body, encoding: String.Encoding.utf8))")
})
q.publish("foo".data(using: String.Encoding.utf8))

Close the connection when done:
conn.close()

Depending on the provider, you'll need to construct the connection URI manually. Heroku for example already presents it in it's dashboard. Here's the documentation on the supported parameters: https://www.rabbitmq.com/uri-spec.html and https://www.rabbitmq.com/uri-query-parameters.html
Example URI on Heroku:
amqp://xxxxxxx:yyy-zzz@aaaaaa.bigwig.lshift.net:10674/bbbbbbb

Format:
amqp_URI = "amqp://" [ username [ ":" password ] "@" ] host [ ":" port ] [ "/" vhost ] [ "?" query ]

