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

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
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

We're in Beta

About us Mission Statement