Manisha Khare
Manisha Khare

Reputation: 155

how to send Message between two android applications using RabbitMQ

I have created an application in Android for RabbitMQ using RabbitMQ-Android tutorial. It is working fine. Now I want to create two applications in Android and I want to make a communication between them using RabbitMQ.

I have not found any example nor tutorial regarding this issue. It would be a great help, if you could provide a link with code.


Thanks for your reply. I have created my first application using this tutorial only. But this tutorial shows the connection between Android and .NET application through RabbitMQ. I don't have .NET application. So, I want to create one more application in Android, and I want to send message between these two applications using RabbitMQ.

Is it possible?? Please give me any suggestion on this topic. Thanks

Upvotes: 2

Views: 3105

Answers (2)

Ted Wu
Ted Wu

Reputation: 11

You can use a Python script below to send message to Android client application.

#!/usr/bin/env python
import pika
import time

connection = pika.BlockingConnection(pika.ConnectionParameters(
    host='localhost'))

channel = connection.channel()

channel.queue_declare(queue='hello')

i = 0

while True:

  channel.basic_publish(exchange='logs',
                      routing_key='hello',
                      body='Hello World, ' + str(i))
  print " [x] Sent 'Hello World!'" + str(i)
  i += 1
  time.sleep(1)
connection.close()

Upvotes: 1

David Dossot
David Dossot

Reputation: 33413

Simon Dixon has a good tutorial that should get you going: http://simonwdixon.wordpress.com/2011/06/03/getting-started-with-rabbitmq-on-android-part-1/

Upvotes: 2

Related Questions