tags:

views:

16

answers:

1

Hi, i am using Rabbitmq Java client API.i am sending two number from GUI to producer and producer put into queue another side consumer can listen the queue and read it and perform the addition of two number and put result on queue then again my producer will listen the my response queue and retrieve the result. code:

while (runInfinite) { QueueingConsumer.Delivery delivery; try { delivery = consumer.nextDelivery(); } catch (InterruptedException ie) { continue; } System.out.println("Result received-" + new String(delivery.getBody())); }

My problem is when the while loop run infinite time and i want to send the fetched result to an GUI to show result.i want to know that, it is possible ,if possible then what i do?

Thanks

A: 

You can use two queues. The GUI puts the numbers in 1 queue. and the background job puts it another Queue. But I do not think you want something like a queue to do the above thing.

Look at events actions and callbacks with respect to your GUI and see if they are suitable for the things you want to do.

sheki