You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to set dynamic values to headers in properties of the message published in RabbitMQ, but the field are not replaces with their values.
I saw the feature has been added in 7.1.0 version on RabbitMQ integration plugin : #27 (comment) but it doesn't seem to work.
According to this discussion, it seems that the code sprintf the top-level items in message_properties (such as app_id) but does not iterate over the items nested inside them.
With this headers attributs of message_properties will fall all time in the constant_properties because it's not of type string
A Solution could be to extract constant_properties[:headers] then do the same as the variable_properties and reseting it in constant_properties before freezing. Something like
`def buildHeaders(event)
if @constant_properties[:headers]
constant_headers = @constant_properties[:headers].reject { |_, v| templated?(v) }
variable_headers = @constant_properties[:headers].select { |_, v| templated?(v) }
headers = variable_headers.each_with_object(constant_headers.dup) do |(k, v), memo|
memo.store(k, event.sprintf(v))
end
@constant_properties[:headers] = headers
@constant_properties.freez
end
end`
@yaauie can you help us fix this issue ? Thank you in advance
I would like to set dynamic values to headers in properties of the message published in RabbitMQ, but the field are not replaces with their values.
I saw the feature has been added in 7.1.0 version on RabbitMQ integration plugin : #27 (comment) but it doesn't seem to work.
According to this discussion, it seems that the code sprintf the top-level items in message_properties (such as app_id) but does not iterate over the items nested inside them.
Version of the plugin I use :
My configuration :
The resulting message in RabbitMQ :
As you can see :
Thanks.
The text was updated successfully, but these errors were encountered: