🎄 Happy Holidays! 🥳
Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.
Happy Holidays!
Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.
Is is it possible to consume user-defined headers using Try me in console?
we are using PubSub+ Kafka source connector as a consumer, so is it possible to consumer the user defined header using PubSub+ Kafka source connector?
Best Answers
-
Hi @techrahul95,
I assume you're asking about the "Try-Me" in PubSub+ Manager. If so, no it can't set user defined headers. Maybe one of these 2 options will work for you?
- CLI tool - sdkperf: This is a very flexible messaging CLI tool that has been in use by Solace users for 10+ years now. Example commands: https://docs.solace.com/API/SDKPerf/Example-Commands.htm
- Browser based - Angular Solace Message Client (Thanks @GreenRover!). Click on the "Try Me" button in the README to see it in action: https://github.com/solacecommunity/angular-solace-message-client
Hope that helps!
0 -
Hi @techrahul95,
You can put whatever you'd like into the payload of the message. You would just have to make sure the consumers know what to expect so they can properly parse it.
But I would caution against not using user-defined properties just b/c the try-me tool doesn't allow you to do so. In many cases it makes a lot of sense to use user-defined properties as they can allow the consumers to know context about the message they are receiving. Things like an ApplicationMessageID, OrderID, type information, etc. are very common
1
Answers
-
Hi @techrahul95,
I assume you're asking about the "Try-Me" in PubSub+ Manager. If so, no it can't set user defined headers. Maybe one of these 2 options will work for you?
- CLI tool - sdkperf: This is a very flexible messaging CLI tool that has been in use by Solace users for 10+ years now. Example commands: https://docs.solace.com/API/SDKPerf/Example-Commands.htm
- Browser based - Angular Solace Message Client (Thanks @GreenRover!). Click on the "Try Me" button in the README to see it in action: https://github.com/solacecommunity/angular-solace-message-client
Hope that helps!
0 -
Thanks @marc. I thought so - Can we include the user-defined headers in the message payload and process them in consumer applications ?
0 -
Hi @techrahul95,
You can put whatever you'd like into the payload of the message. You would just have to make sure the consumers know what to expect so they can properly parse it.
But I would caution against not using user-defined properties just b/c the try-me tool doesn't allow you to do so. In many cases it makes a lot of sense to use user-defined properties as they can allow the consumers to know context about the message they are receiving. Things like an ApplicationMessageID, OrderID, type information, etc. are very common
1 -
Not related to the Try Me! functionality: but if you're asking specifically about this Kafka source connector: https://github.com/SolaceProducts/pubsubplus-connector-kafka-source I just did a quick scan of the code and found no mentions of
Header
(Kafka) orSDTMap
(Solace). So it doesn't appear that if User Properties are specified in the received Solace message, they will be passed through to the Kafka side.Note the code is open source... you could either add the functionality yourself and submit a PR, or raise an Issue so we can track this as a feature request.
1 -
Thanks @Aaron,
I will submit the feature enhancement request and work on submitting a PR in meantime.
Appreciated your support.
Regards,
Rahul.😊
1