sblabreu

sblabreu

Broadway_rabbitmq empty metadata

Hi,

Testing broadway_rabbitmq 0.6.0 producer and I’m not able to get the metadata.

I can see the properties/headers from RabbitMQ web management queue page

app_id:	broker_producer
user_id:	guest
timestamp:	1589673281240
message_id:	eae5cfaf-279e-41f3-9c1a-3dadae63ac59
delivery_mode:	1
headers:	
merchant_id:	1234
content_type:	application/json

But cannot see the properties/headers on the Broadway.Message

%Broadway.Message{
  acknowledger: {BroadwayRabbitMQ.Producer,
   %AMQP.Channel{conn: %AMQP.Connection{pid: #PID<0.492.0>}, pid: #PID<0.552.0>},
   %{
     client: BroadwayRabbitMQ.AmqpClient,
     delivery_tag: 4,
     on_failure: :reject,
     on_success: :ack,
     redelivered: false
   }},
  batch_key: :default,
  batch_mode: :bulk,
  batcher: :default,
  data: "test",
  metadata: %{},
  status: :ok
}

I’m using a topic exchange with routing_key.

Thanks in advance,
Sergio

Marked As Solved

sblabreu

sblabreu

Update,

My bad :wink:

I should include :headers on the Broadway metadata options and not the actual header :yawning_face:

          metadata: [:headers,:user_id]

The on the Broadway.Message I receive

metadata: %{headers: [{"merchant_id", :longstr, "1234"}], user_id: "guest"},

Works perfectly the problem was between the chair and the keyboard.

Where Next?

Popular in Questions Top

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 53690 245
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New

We're in Beta

About us Mission Statement