-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to add message_properties with variables. #72
base: main
Are you sure you want to change the base?
Added ability to add message_properties with variables. #72
Conversation
@@ -63,7 +63,7 @@ def multi_receive_encoded(events_and_data) | |||
|
|||
def publish(event, message) | |||
raise ArgumentError, "No exchange set in HareInfo!!!" unless @hare_info.exchange | |||
local_exchange.publish(message, :routing_key => event.sprintf(@key), :properties => symbolize(@message_properties.merge(:persistent => @persistent))) | |||
local_exchange.publish(message, :routing_key => event.sprintf(@key), :properties => symbolize(@message_properties.merge(:persistent => @persistent), event)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we revert this change, I don't see a need to log the whole event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand what you meant.
I tried to evaluate the value in the {key: value}, so when it's a variable, like {"reply_to" => "%{myReplyTo}"}, the value in rabbit won't be "%{myReplyTo}" but the value of the variable myReplyTo.
I know there is an issue with the commit now (and the reason it didn't passed the tests), that it refers to the value always as a string, and if it's a boolean (like {"persistent" => true}) it will return {"persistent" => "true"}.
I'll fix it. But is there any other things I'm missing?
053f4f4
to
a0fedb6
Compare
When adding message_properties dictionary (message_properties => {"content_type" => "const type"}) You can now use dynamic values from variables {"content_type" => "%{ContentType}"}
a0fedb6
to
9ba2207
Compare
hi @jsvd @sophie135, is there any plan to release this feature? It would be very useful to be able to set the priority of the message dynamically.
|
@jeslopalo I have revived this feature in the new RabbitMQ Integration Plugin: logstash-plugins/logstash-integration-rabbitmq#9 Since the Integration Plugin requires Logstash 6.5, I'd appreciate your input on backport requirements to get this feature working for you since you contributed. |
When adding message_properties dictionary (message_properties => {"content_type" => "const type"})
You can now use dynamic values from variables {"content_type" => "%{ContentType}"}
Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/