-
Couldn't load subscription status.
- Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
pascal gehl opened SPR-13288 and commented
I have a @Controller method wired with a @MessagingGateway annotated service.
@MessageMapping(value = "/messages/save")
public void save(Message<ToBeSaved> msg) {
service.save(msg);
}Unfortunately this does not work; I get
SimpAnnotationMethodMessageHandler -- Unhandled exception
MethodArgumentTypeMismatchException: Could not resolve method parameter at index 0 in method: public void MyEndpoint.save(Message<ToBeSaved>) The expected Message<?> payload type [ToBeSaved] does not match the actual payload type [[B]
at org.springframework.messaging.handler.annotation.support.MessageMethodArgumentResolver.resolveArgument(MessageMethodArgumentResolver.java:59)After investigation generic Message<CustomClass> is not understood as being a Message instance with ToBeSaved payload class but only Message<?> with Byte[] payload.
It would be nice if MessageMethodArgumentResolver was able to use MessageConverter the same way PayloadArgumentResolver can.
Affects: 4.1.7
Issue Links:
- JsonView support for JMS [SPR-13237] #17828 JsonView support for JMS
- Jackson @JsonView deserialization support for @MessageMapping payloads [SPR-13265] #17856 Jackson
@JsonViewdeserialization support for@MessageMappingpayloads - Missing MessageMethodArgumentResolver default constructor [SPR-14616] #19183 Missing MessageMethodArgumentResolver default constructor
- AMQP-582 The MethodRabbitListenerEndpointTests.invalidMessagePayloadType() isn't compatible with SF-4.3
Referenced from: commits 416966d
1 votes, 7 watchers
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement