Code Monkey home page Code Monkey logo

Comments (4)

timcharper avatar timcharper commented on August 22, 2024 1

You can provide an exchange definition to a publisher, and it will materialize it on first publish. Note, that materialization happens on first message publication per publisher instance, so you'll want to consider reusing publisher instances.

val publisher = Publisher.topic("topic.to.publish", Exchange.topic("chatty-cathy"))
for { data <- itemsForPublication } yield {
  (rabbitControl ? Message(data, publisher)).mapTo[Message.ConfirmResponse]
}

from op-rabbit.

iravid avatar iravid commented on August 22, 2024

Thanks for the answer, Tim. I ran into another limitation - we use RabbitMQ's x-consistent-hash plugin (https://github.com/rabbitmq/rabbitmq-consistent-hash-exchange); this type is not defined in the Exchange enumeration.

I'll gladly send a PR with the additional Exchange.consistentHash method and enum value.

Does this sound like an acceptable solution or would you prefer to drop the type parameter from the Exchange trait and allow users to pass in the exchange type as a string?

from op-rabbit.

timcharper avatar timcharper commented on August 22, 2024

Neat! Open up a new issue for it?

from op-rabbit.

iravid avatar iravid commented on August 22, 2024

👍

from op-rabbit.

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.