[rabbitmq-discuss] basicpublish Android to Java?

Kamran muhammad.kamrana at gmail.com
Mon Feb 20 11:56:30 GMT 2012


Hi Emile,
            Yes when I have Java Client in Android. Then a publish via
"basicpublish" from Android should go to "basicconsume" in Java file
(the receive file in tutorial one). Unfortunately it is not working
for me. This would be the code for basic publish from Android to a
Receiver (in Java).
      ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("sethost");
        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();
        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
        String message = "Kamran Android E";
        channel.basicPublish(EXCHANGE_NAME, QUEUE_NAME, null,
message.getBytes());

Regards,
Kamran


On Feb 20, 11:33 am, Emile Joubert <em... at rabbitmq.com> wrote:
> Hi,
>
> On 20/02/12 00:41, Kamran wrote:
>
> > I am new can you please help me out? Is there anyway I can send messages
> > from android to java files via basicpublish, the other way around is
> > possible.
> >http://simonwdixon.wordpress.com/2011/06/03/getting-started-with-rabb...I
> > have tried with handlers and with out it. Doesn't work.
>
> If I understand your question correctly you wish to send messages from
> "java files" to "android". Can you please explain what you mean by "java
> files"?
>
> If you have the RabbitMQ Java client working on Android then you should
> be able to publish and subscribe. Are you saying this is working only in
> one direction?
>
> -Emile
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list