Comments (9)
Added the information to README. Thanks!
from amqp.
@bradleyd Is the client connected directly to the broker? Or through something like haproxy? When using haproxy you can use the heartbeat: n
option in AMQP.Connection.open (n seconds must be less than haproxy connection timeout).
from amqp.
It is connected through aws load balancer. Heartbeat is set to 60
from amqp.
Actually that is false. I was thinking of remote connection. This is connection on same host over 127.0.0.1
from amqp.
@bradleyd That excludes the possibility of a load-balancer closing the backend connection...
Looking at the queue status in the RabbitMQ management console, do you see the messages being acked, or are they accumulating in the queue (in either ready or unacked state)?
When looking at the queue detail in the management console, does it still list consumers?
from amqp.
Thanks for trying to help @pma.
The messages are accumulating in ready. The consumer is also listed from console. I sniffed the local consumer port hoping to catch messages, but all I see is what looks like the heartbeat being sent back and forth
from amqp.
@bradleyd I'm also facing the same issue. Did you get any further insight on this?
from amqp.
I've been through this and realize that I wasn't handling message properly. In the README example that try/rescue may no catch unexpected errors avoiding you to call ack/reject
. Consumers needs to send acknowledges (aka.. ack/reject) to the broker so it can send more messages.
No matter what happens handling the message you will ack or reject and the broker will send you more messages:
def handle_info({:basic_deliver, payload, %{delivery_tag: tag, redelivered: redelivered}}, [chan, opts] = state) do
spawn fn ->
handler = @opts[:handler]
with {:ok, data} <- Poison.decode(payload),
{:ok, _} = handler.handle(data) do
ack(chan, tag)
else
_ -> reject(chan, tag, requeue: not redelivered)
end
end
{:noreply, state}
end
May it can help someone
from amqp.
Yeah, we had similar issues. If the handler silently fails or is stuck, ack or nack won't be sent. Then once the number gets more than prefetch_count
, consumer stops receiving any messages.
@bradleyd @trenpixster can this be a cause of the issue you experienced? Or you are seeing something else?
Since it can be a typical pitfall, I am planning to write something about it in README.
from amqp.
Related Issues (20)
- Application.Connection has a missing case clause on line 113 HOT 1
- where to find documentation HOT 3
- AMQP.Basic.get/3 option no_ack: true not working HOT 2
- Enabling transactional mode for channels? HOT 1
- FunctionClauseError no function clause matching in AMQP.Connection.open/1
- Support amqp_client 3.9.1
- unable to compile: cannot find or invoke local basic_credit_drained/0 inside match HOT 2
- unexpected_delivery_and_no_default_consumer and abandoned consumers HOT 3
- Are streams supported? HOT 3
- Unhandeled Genserver event HOT 1
- Support for streams HOT 1
- How would one approach having tests alongside this library? HOT 2
- There should be some guide on how we could write proper unit tests for this HOT 1
- No feedback when RabbitMQ is unreachable HOT 1
- AMQP issue crashes GenServer irrespective of multiple error handlers. HOT 1
- websocket support HOT 3
- OTP 26 HOT 1
- Issue compiling with Elixir 1.15 (ssl_verify_fun)
- AMQP.Connection doesn't pick the default SSL configuration HOT 1
- Why aren't channels closed when no longer needed? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amqp.