Questions tagged [langohr]

Langohr is a Clojure RabbitMQ client with an API that reflects the AMQP protocol.

Langohr is a Clojure RabbitMQ client with an API that reflects the AMQP protocol.

11 questions
6
votes
1 answer

How do I stub langohr RabbitMQ interactions in clojure?

I'm trying to stub the RabbitMQ interactions, as those aren't really the main purpose of the application I'm writing. So, I've tried rebinding the langohr functions in my tests like so: (defn stub [ch] (langohr.basic/ack ch 1)) (deftest…
Phong
  • 93
  • 7
5
votes
1 answer

How to tolerate RabbitMQ restarts in Langohr?

We have Clojure code which reads from a Rabbit queue. We would like to tolerate the case where the RabbitMQ server is down briefly, e.g. in the case of a restart (sudo service rabbitmq-server restart). There appears to be some provision for…
JohnJ
  • 4,753
  • 2
  • 28
  • 40
2
votes
1 answer

How to redeliver queued messages in RabbitMQ using Langohr?

Background We consume messages from RabbitMQ with Langohr (version 3.4.0) and try to persist them into MongoDB. We're not using auto-ack since if we fail to persist the messages in MongoDB we want to be able to retry later. We're using the…
Johan
  • 37,479
  • 32
  • 149
  • 237
1
vote
1 answer

Best practise regarding RabbitMQ channels

When using RabbitMQ and its channel model, how often am I supposed to close channels? For example is it best practise to Close the channel at the end of the method it got opened? Reuse the channel globally between different methods? On a sidenote:…
WeGi
  • 1,908
  • 1
  • 21
  • 33
1
vote
1 answer

RabbitMQ delayed_message_exchange declaration fails in langohr clojure client

I am trying to configure a RabbitMQ delayed message exchange as described in this document: https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/ The below is my attempt at translating the code example from that README into clojure/langohr.…
clumsyjedi
  • 477
  • 6
  • 15
1
vote
0 answers

RabbitMQ Clojure Langohr doesn't throw error when rabbitmq server restarted

I have the following code to monitoring database table to create MQ messsage every several seconds. And I found that when I restarted the RabbitMQ server the app still runs without throwing an exception, and it still print message was created. So…
Daniel Wu
  • 5,853
  • 12
  • 42
  • 93
1
vote
1 answer

Refactoring redundancy out of Clojure code for RabbitMQ fanning

I am running through the RabbitMQ tutorials on their web-page and as an exercise am trying to refactor the examples they provide to make them more general and composable. I am stuck on the second "blabbr" example. Here is the function I would like…
kurofune
  • 1,055
  • 12
  • 26
0
votes
1 answer

Can I do `blocking-subscribe` in a scheduled task which runs repeatedly?

Recently I've found my Clojure/Ring/Jetty server repeatedly go into NoClassDefFoundError when I cider-connect into it and do something. I guess that is because the thread pool being exhausted by some dead threads. Then I've found this function in…
cmal
  • 2,062
  • 1
  • 18
  • 35
0
votes
2 answers

Instruct RabbitMQ to resend undelivered messages periodically

Background We're using langohr to interact with RabbitMQ. We've tried two different approaches to let RabbitMQ resend messages that has not yet been properly handled by our service. One way that works is to send a basic.nack with requeue set to the…
Johan
  • 37,479
  • 32
  • 149
  • 237
0
votes
0 answers

Is there a way to get RabbitMQ to deliver messages in batches, instead of one at a time?

I am using RabbitMQ with Clojure and Langohr, and I want to process messages off the queue in batches rather than one at a time. I could batch the messages myself after they're pulled off the queue, of course, but I'm curious if there's an API call…
Logan Buckley
  • 211
  • 1
  • 4
0
votes
2 answers

Clojure + RabbitMQ / multithreaded message consumption

Context: Clojure + RabbitMQ (via Langohr), a follow up to this question. I'm getting weird results in consuming messages from a RabbitMQ mq (getting the messages from a direct exchange and publishing to a fanout exchange after processing the…
neektza
  • 483
  • 6
  • 11