Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get Direct Reply-to to work #23

Open
martinschueller opened this issue Feb 5, 2024 · 0 comments
Open

Can't get Direct Reply-to to work #23

martinschueller opened this issue Feb 5, 2024 · 0 comments

Comments

@martinschueller
Copy link

martinschueller commented Feb 5, 2024

For Sending and immediatly receiving messages, RabbitMQ has the Direct Reply-To feature: https://www.rabbitmq.com/direct-reply-to.html

I can't get it to work with this code, even though there's no error in the consumer or the queue and the message is sent back:

library(longears)

conn <- amqp_connect()


consumer <- amqp_consume(
    conn = conn,
    no_ack = TRUE,
    # prefetch_count = 1,
    timeout = 15,   
    queue = "amq.rabbitmq.reply-to",
    fun = function(msg) {
      received <<- received + 1
})

amqp_publish(conn, '{"content":1707163749285}', exchange = "", routing_key = "QUEUE_NAME", properties=amqp_properties(content_type="application/json", reply_to="amq.rabbitmq.reply-to.bdwkehdwhecbhjwe", delivery_mode=2))

while (TRUE) {
  amqp_listen(conn, timeout = 15)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant