Coder Social home page Coder Social logo

hqoss / rabbit_mq Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 5.0 1.19 MB

๐Ÿ‡ Build consistent and well-balanced Producer/Consumer pipelines

License: MIT License

Elixir 100.00%
rabbitmq rabbitmq-best-practices rabbitmq-modules elixir elixir-lang elixir-library

rabbit_mq's People

Contributors

slavovojacek avatar sztheory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rabbit_mq's Issues

Producer use arguments doesn't allow for macro expansion

I'm trying to do the following but can't:

defmodule Tmp2.QConfig do

def configuration do

%{
  Tmp2.Foo.Queue1  => [exchange: "example_queue", worker_count: 3],
  Tmp2.Foo.Queue2  => [exchange: "other_queue", worker_count: 2]
}

end
end

defmodule Tmp2.Foo do

for {module, options} <- Tmp2.QConfig.configuration() do

defmodule module do

    use RabbitMQ.Producer, options

    @impl true
    def handle_publisher_nack(unackd_messages) do
      Logger.error("Failed to publish messages: #{inspect(unackd_messages)}")
    end

end

end
end

This fixes the problem (producer.ex):

Change from:

  @confirm_type unquote(Keyword.get(opts, :confirm_type, :async))
  @exchange unquote(Keyword.fetch!(opts, :exchange))
  @worker_count unquote(Keyword.get(opts, :worker_count, 3))

To:
@confirm_type Keyword.get(unquote(opts), :confirm_type, :async)
@eXchange Keyword.fetch!(unquote(opts), :exchange)
@worker_count Keyword.get(unquote(opts), :worker_count, 3)

Many thanks to Kip from the ex_cldr team for figuring it out.

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.