Comments (6)
@matteosister With the change in 0f0c825, if the channel process is dead, :amqp_channel.call
will fail, whereas with :amqp_channel.cast
it would just return :ok
even if no channel process is there to transmit the message to the broker.
My first thought is that the change would just make the problem visible, not actually cause it. Could it be that you were previously just losing messages under high load?
from amqp.
Another guess is that there might be code closing a channel or connection somewhere in your tests. Try this code and see if your tests pass?
def handle_call({:publish, exchange, routing_key, payload}, _from, chan) do
temp_chan = get_channel()
:ok = Basic.publish temp_chan, exchange, routing_key, payload
Channel.close temp_chan
Connection.close temp_chan.connection
{:reply, :ok, chan}
end
Obviously it is not efficient to run this on production so just to confirm the suspicion.
If you close a channel in middle of tests, I suggest you to open it again.
from amqp.
I confirm that by manually opening a new channel and closing it after publishing the message the test suite work! So there must be something that closes the channel...currently investigating...
from amqp.
it turns out it was just a problem with amqp. I was not declaring the exchange I was publishing to. So, as @pma said, the change from cast to call in the publishing call surfaced the problem. It was happening only in test, and not in prod (due to the fact that exchange in prod is already declared). So, I'm happy to finally be on 0.2.0 👍
many thanks!
from amqp.
@matteosister Great. Glad to hear it's sorted. Yeah, we expect this kind of implications but in a good way. You want to be alerted when the message was not delivered to the queue/exchange.
Thanks for the follow-up 👍
from amqp.
@ono totally agree with the design choice! 👍
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.