Reputation: 6003
I have built a rabbitmq wrapper which publishes messages to consumers and this is working well.
Can I also build a work queue (like gearman) in rabbitmq which can distribute long running tasks to consumers and the consumers, in turn, notify the publisher with the results.
I guess this would require the publisher to act as a consumer as well which I am not sure how to implement. (Please correct me if I am wrong).
Or, is rabbitmq just not the tool for such case.
Thanks,
Upvotes: 0
Views: 789
Reputation: 4096
RabbitMQ supports this type of pattern. Have a look at the RPC tutorial for a bootstrap of how to implement this pattern.
It can be implemented in different way depending of your needs:
It usually implies a correlation id to correlate request with the reply, or it can be stateless if the reply contains all the necessary information.
It really depends on your needs.
Upvotes: 2