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?
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: Example Commands for SDKPerf Browser based - Angular Solace Message Client (Thanks @GreenRover !). Click on the “Try Me” button in the README to see it in action: GitHub - solacecommunity/angular-solace-message-client: Angular message client to communicate with a Solace messaging broker for sending and receiving messages using the native SMF protocol over web socket. Hope that helps!
Thanks @marc.dipasquale . I thought so - Can we include the user-defined headers in the message payload and process them in consumer applications ?
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
Not related to the Try Me! functionality: but if you’re asking specifically about this Kafka source connector: GitHub - SolaceProducts/pubsubplus-connector-kafka-source: Source connector to send data from Solace message broker to Apache Kafka streaming platform I just did a quick scan of the code and found no mentions of Header (Kafka) or SDTMap (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.
Thanks @Aaron ,
I will submit the feature enhancement request and work on submitting a PR in meantime.
Appreciated your support.
Regards,
Rahul.