Try PubSub+

Spring Cloud Stream Microservice Deserialize Messages

bensabatbensabat Member Posts: 6

Hello,

I have set up a Spring Cloud Stream microservice with the solace configuration. This microservice has been able to take in payloads of type string or java object, but I am now receiving SpB (protobuf) messages through solace. My goal is to deserialize these messages to JSON or POJO to be able to actually work with the data, but I have been unsuccessful at doing so.

I was wondering if Spring Cloud Stream has the functionality built in to deserialize messages of this type in an easy manner. I have been looking into @StreamListener of spring cloud stream but have not been able to get it working and do not fully understand how it works.

In addition, I have tried implementing the Eclipse Tahu project (https://github.com/eclipse/tahu/tree/master/sparkplug_b) into my microservice project but it has not been working and I feel as there must be an easier way to deserialize these messages. Please let me know if anyone knows how to go about this!

I also believe there needs to be some edits on the application.yml file of the project to declare what message type the microservice should expect to receive, but am not sure how it would look in this case. Please correct me if I'm wrong!

Thank you, Joseph

Comments

Sign In or Register to comment.