[rabbitmq-discuss] Can we launch hello world tutorial from two different machines (foreign consumer and producer) ?

laurent bernabe laurent.bernabe at gmail.com
Wed May 8 12:28:07 BST 2013


Thanks.

Is it possible just by giving an arbitrary name for the host, as I don't
know the other peer IP (and my future use of application won't know it in
advance) ?

I've tried by changing


------------------------------
factory.setHost("localhost");
------------------------------

by

--------------------------------
factory.setHost("myAppName");
--------------------------------

where factory is the ConnectionFactory instance, but I got an exception
(java.net.UnknownHostException).
Or must I make some configuration on the two peers before ?

Regards

2013/5/8 Tim Watson <watson.timothy at gmail.com>

> No, that's not the point I am making. You should have just one broker
> running and the two client applications need to connect to the same broker.
>
> On 8 May 2013, at 11:37, laurent bernabe <laurent.bernabe at gmail.com>
> wrote:
>
> Hi,
>
> should setting the correlation_id accordingly for both Producer and
> Consumer enough ?
>
> Regards
>
> 2013/5/8 Tim Watson <watson.timothy at gmail.com>
>
>> Hi,
>>
>> The producer sends messages to a broker and he consumer receives them
>> from the same broker (or a clustered peer). Sounds like you're publishing
>> to a local broker which has nothing to do with the other broker that you're
>> trying to consume from. The broker is an intermediary between the two
>> clients.
>>
>> Cheers
>> Tim
>>
>> On 8 May 2013, at 11:28, laurent bernabe <laurent.bernabe at gmail.com>
>> wrote:
>>
>> Hello everyone,
>>
>> In the Hello World tutorial, it is said that the producer, the consumer,
>> and the broker don't have to be on the same machine.
>>
>>  I tried this feature without success, here is how :
>> 1) I slightly modified Receiver and Producer in order to make them as GUI
>> applications. (Files attached)
>> 2) From Eclipse IDE, I exported the application as a runnable jar file by
>> choosing the Producer class as main class for this application : Let's call
>> it RabbitMQProducer
>> 3) I did the same thing for the receiver class : Let's call this
>> application RabbitMQReceiver
>> 4) I installed the last RabbitMQ server on both machines (which are both
>> Ubuntu Linux machines, though versions are differents)
>> 5) I started an instance of the Producer on one machine and an instance
>> of the Receiver on the other machine : but sending a message on the
>> producer is without any effect on the Receiver.
>>
>> I've read all tutorials, but I still have not noticed what the main
>> difference between the RPC tutorial (tutorial 6) and the HelloWorld
>> tutorial (tutorial 1).
>>
>> So, how should I modify my codes ?
>>
>> Regards
>>  RecvGraphical.java<https://docs.google.com/file/d/0B9y2qdSglhCpblkzam1oakFsZUk/edit?usp=drive_web>
>>
>>  SendGraphical.java<https://docs.google.com/file/d/0B9y2qdSglhCpLUYwOEw5VGJWTzQ/edit?usp=drive_web>
>>
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>>
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130508/7bd7f957/attachment.htm>


More information about the rabbitmq-discuss mailing list