I am almost a newbie in java threading
. I have a scenario whereby I am posting JSON
messages in a rabbitmq queue
and an external service is performing operation on the JSON
received and then after the execution of the external service, it will return a value in integer
indicating whether the execution went successful or not.
I want to call the external service and then want to wait for the return value i.e make the execution of the producer halt until consumer function returns me the value.
Your help is highly appreciable. Just give me the topic like whether to use synchronized methods, or Future and Callable interfaces etc.
Thanks. Please don't say that "show us what you have tried till now etc", I just need your suggestions about how to do it. :)