php - Publishing tasks only for consumer with given tag -


just writing app runs several jobs in background, when 1 job done, next pipe starts. of jobs consumed node workers, while others - php workers. among backend workers have couple frontend express apps handling user requests.

i'd users stay notified status of requests, i'm using queue, called 'notifications', receive messages forward customers.

thats how register queue:

channel.consume(notifications_queue, (msg) => {    //here dragons }, {consumertag: myinstanceid}); 

when produce messages backend, prepend instance id message, consumers/workers may , notify me work progress:

//here in consumer //i exctract instanceid message received //and store in instanceid var channel.sendtoqueue(   mynotificationsqueue,   new buffer(json.stringify(message)),   {consumertag: instanceid} ); 

finally, i'd produce similar message in php worker (i use php-amqplib, in rabbitmq tutorial on page), don't know how attach tag in way similar nodejs approach. when checked source, i've found $consumer_tag not used in basic_publish method, appears in consume-related code.

to more specific issue, i'm working data file uploaded customer, perform operations on using node bindings native tools, , multiple times in kind of pipe. when 1 operation finished, worker produces message next step. every step has own queue , workers. final step (and final workers) upload file location want, , i'm pinned php here miss libraries other language. also, every worker after producing message next in queue, sends message notification queue, including id fetched incoming message, , notification string, saying step done.

so question is: how attach consumer tag published message in php? should configure channel somehow, or use library, capable of doing so? ideas?

edit

of course can prepare queue, let's call notification_raws, push there notifications blob, , later consume blobs nodejs create tagged messages notifications queue... also, can paint face pink paint, , call myself napoleon bonaparte...


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -