forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve ordering when auto-configuring WebSocket MessageConverters
Previously, WebSocketMessagingAutoConfiguration added a single additional converter. This was a MappingJackson2MessageConverter configured with the auto-configured ObjectMapper. AbstractMessageBrokerConfiguration places additional converters before any of the default converters. This meant that the auto-configuration had the unwanted side-effect of changing the ordering of the converters. A MappingJackson2MessageConverter was now first in the list, whereas, by default, it's last in the list after a StringMessageConverter and a ByteArrayMessageConverter. This commit updates WebSocketMessagingAutoConfiguration so that it switches off the registration of the default converters and registers a StringMessageConverter, ByteArrayMessageConverter and MappingJackson2MessageConverter in that order. A test has been added to verify that the types of these three converters match the types of the default converters. A second test that verifies that String responses are converted correctly has also been added alongside the existing test that verified the behaviour for JSON responses. Closes spring-projectsgh-5123
- Loading branch information
1 parent
c10943c
commit fc2e51a
Showing
2 changed files
with
66 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters