Coder Social home page Coder Social logo

Comments (3)

weaverryan avatar weaverryan commented on July 30, 2024

Hi @artandor!

Ok, so the problem is that you're setting the routingKey in the TransportConfiguration when you're sending one of your messages. This ultimately cases $message->setRoutingKey() to be called. But, when you switch to the null transport, you are switching to the NullMessage(), which does not have a setRoutingKey() method on it. It's tricky: I totally understand what you're trying to do. On the other hand, the library is kind of correct to say: "Hey! You're trying to use an option on your message that is not supported by this transport!".

I'm open to suggestions!

from messenger-enqueue-transport.

artandor avatar artandor commented on July 30, 2024

I guess the AMQP transport configuration lacks of abstraction, which ultimately lead to having a "setRoutingKey" method that is too specific too some transports. It is indeed not really linked to the NullMessage itself. But in the end, the NullMessage becomes buggy when it comes to functionnal testing, which, according to the documentation, was one of its usage.

The simpliest fix could be to add a "dispatch: boolean" in the enqueue conf, that hooks into the dispatch process to stop it before connecting to the amqp server. This way we could use the same DSN instead of enqueue://null and we wouldn't need to bring back the broker online.

from messenger-enqueue-transport.

weaverryan avatar weaverryan commented on July 30, 2024

The simpliest fix could be to add a "dispatch: boolean" in the enqueue conf, that hooks into the dispatch process to stop it before connecting to the amqp server.

That's an interesting idea. Is that something that's supported in Enqueue in general already? Or are you just thinking out loud. It occurred to me that this is not a problem specific to this library - but Enqueue in general: if you are using the Amqp transport and calling custom setter methods on the AmqpMessage, then if you globally switch to the NullTransport for testing, it would also explode in a very similar way. The best path may be to find out how this is recommended to be handled in Enqueue in general, and then make sure this library is properly supporting that option.

Cheers!

from messenger-enqueue-transport.

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.