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

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a &gt; b) do {:ok, "a"} end if (a &lt; b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
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
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49266 226
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New

We're in Beta

About us Mission Statement