Spring-framework: Protobuf MessageConverter in spring-messaging for use with STOMP

Created on 19 Nov 2019  路  6Comments  路  Source: spring-projects/spring-framework

Hi,

I have created a ReactorNettyTcpStompClient to connect to RabbitMQ STOMP.

My requirement is to send protobuf ByteString to the destination queue. I tried with all the message converters that are available under _org.springframework.messaging.converter_ package. Either i get MessageDeliveryException: nested exception is java.lang.ClassCastException or MessageConversionException: Unable to convert payload with....

I am thinking of overriding/overloading the send() method of DefaultStompSessionclass and use it.

Is there any other easier way?

How to use protocol buffers with Spring Messaging?

Thanks,
Strive

messaging superseded enhancement

Most helpful comment

Yes, it is marked "ideal-for-contribution" and that means we've already identified it as something that should be straight-forward to address.

All 6 comments

Currently there isn't a MessageConverter in spring-messaging for Protobuf. The spring-web module however has an ProtobufHttpMessageConverter and it wouldn't be too hard to copy the implementation of that in order create a MessageConverter equivalent.

I created a converter that suits my needs (took a clue from ByteArrayMessageConverter).
Definitely will have look at ProtobufHttpMessageConverter.

Thanks for adding this to 5.x backlog

Regards,
Strive

Could i take this task ?

Yes, it is marked "ideal-for-contribution" and that means we've already identified it as something that should be straight-forward to address.

Please check my PR #24087.
I also added a question on which I need advice

This is now superseded by #24087.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spring-projects-issues picture spring-projects-issues  路  5Comments

spring-projects-issues picture spring-projects-issues  路  5Comments

spring-projects-issues picture spring-projects-issues  路  4Comments

spring-projects-issues picture spring-projects-issues  路  3Comments

Moomba42 picture Moomba42  路  3Comments