I am learning RabbitMQ and thought of using it for giving "dynamic message" updates to users very much like facebook give dynamic feeds from friends.
My Idea was :
Whenever a user is created I will create a queue having name is user's userId so queue name could be "
100_message_queue
" (userId_message_queue).Producer will push all updates in this queue.
From client side (javascript) , it will call a REST API like "
GET http://example.com/getliveupdates/100
" , then I will fetch all new updates from100_message_queue
and send it as response.
I read RabbitMQ php tutorials but cannot figure out how this is possible ? Moreover consumer runs forever so its seems I cannot make any REST request. It is giving me timeout.
Any idea how to implement this kind of structure ?
Thanks