Giter Club home page Giter Club logo

Comments (6)

pma avatar pma commented on July 16, 2024

@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.

ono avatar ono commented on July 16, 2024

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.

matteosister avatar matteosister commented on July 16, 2024

thanks @pma and @ono

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.

matteosister avatar matteosister commented on July 16, 2024

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.

ono avatar ono commented on July 16, 2024

@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.

matteosister avatar matteosister commented on July 16, 2024

@ono totally agree with the design choice! 👍

from amqp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.