question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: sendToQueue

See original GitHub issue

I may end up working on this but the feature request is to implement a sendToQueue function that should work just like the publish function except it’ll go to whatever queue you send the message to. So instead of relying on the routingKey you can have it sent directly to a queue.

Documentation for sendToQueue http://www.squaremobius.net/amqp.node/channel_api.html#channel_sendToQueue

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
mxriverlynncommented, Jul 8, 2016

when you send to queue, you are publishing through an exchange and exchanges require a routing key.

the exchange happens to be a special, built-in exchange, but it’s still an exchange.

this specialized exchange receives the queue name as the routing key, and uses that to route the message through the exchange and to the correct queue.

send to queue is useful when you are doing replies and a few other very specific scenarios. but in general, i considered it an anti-pattern that just makes demo code look easier.

it’s a rather deceptive implementation that caused me a lot of confusion when i first started learning RMQ.

2reactions
shawnHartsellcommented, Jul 8, 2016

In addition to what @derickbailey said…in RabbitMQ all messages route through some kind of exchange. You can use direct exchanges to achieve the “straight to queue” functionality @rg1220

The built-in default exchange is a direct exchange. Additionally, every queue that is created is automatically bound to the direct exchange with the routing key of the queue name. This means that if you publish a message to the default exchange and use your destination queue as the routing key, it will be delivered to that queue.

https://www.rabbitmq.com/tutorials/amqp-concepts.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

amqplib | Channel API reference - GitHub Pages
Writable when you call publish or sendToQueue : they return either true , meaning “keep sending”, or false , meaning “please wait for...
Read more >
Feature Request - timeout for publish and sendToQueue
I've noticed that if the client cannot connect, calling to sendToQueue from the channel wrapper creates a promise that never resolves or ...
Read more >
amqplib.Channel.sendToQueue JavaScript and Node.js code ...
How to use. sendToQueue. function. in. Channel. Best JavaScript code snippets using amqplib.Channel.
Read more >
sendToQueue procedure - Progress Documentation
Sends a message to a queue. Syntax PROCEDURE sendToQueue. DEFINE INPUT PARAMETER queueName AS CHARACTER. DEFINE INPUT PARAMETER message AS HANDLE.
Read more >
RabbitMQ sendtoQueue and consume in the same rest api call
In one particular endpoint for product service data is first send to Bid queue where it is processed in Bid service and after...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found