Auto-configure ObjectMapper used in the WebSocket MappingJackson2MessageConverter
See original GitHub issueI just wanted to include some cool websocket stuff within my project. This kinda worked out of the box! Thank you!!
I use SimpMessagingTemplate
for sending messages. They get automatically converted to JSON, which is nice, BUT I can’t figure out which ObjectMapper
is getting used for this, because it won’t use my custom Serializers and it also doesn’t use my custom Jackson settings from application.properties.
Should I just use @Autowired ObjectMapper
and serialize my Objects to String by myself?
Btw: I didn’t test if it uses the correct ObjectMapper
for JSON messages from the client to the server.
Issue Analytics
- State:
- Created 9 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
java.lang.NoClassDefFoundError org.springframework ...
I am trying to open a WebSocket in Spring Client. ... initObjectMapper(MappingJackson2MessageConverter.java:92) ~[spring-messaging-5.2.5.
Read more >org.springframework.boot.autoconfigure.websocket ...
org.springframework.boot.autoconfigure.websocket.WebSocketMessagingAutoConfiguration maven / gradle build tool code. The class is part of the package ...
Read more >Spring Cloud
Spring Cloud AWS module dependencies can be used directly in Maven with a direct configuration ... MappingJackson2MessageConverter messageConverter = new.
Read more >org.springframework.messaging.converter.MessageConverter
instanceOf(MappingJackson2MessageConverter.class)); }. Example #10 ... The converter is also used when sending a message to the message broker.
Read more >[Solved]-Camel - RabbitMQ spring boot-Springboot
... How to configure Jackson ObjectMapper for Camel in Spring Boot ... spring boot rabbitmq MappingJackson2MessageConverter custom object conversion ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I’m using simply
I use AbstractWebSocketMessageBrokerConfigurer because I need to set the Endpoint and the Prefixes.
EDIT: I now use this code. Is this the right way?
I guess that might be an another approach, although as WebSocketMessageBrokerConfigurationSupport doesn’t implement WebSocketMessageBrokerConfigurer, I’m not sure how to wire it up…