You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The question arises, whether this is intentional. If ObjectStringMessageConverter.toMessage() should not be used with anything else than String payload explicitly throwing an IllegalArgumentException would probably be a better option. For the opposite case I will provide a PR.
The text was updated successfully, but these errors were encountered:
I am not quite sure, what the original intention of
ObjectStringMessageConverter
was, but currently usingfails, as
Message<?> converted
is alwaysnull
whenpayload
is anything else thanString.class
asAbstractMessageConverter.canConvertTo()
https://github.com/spring-projects/spring-framework/blob/80646591367b93d220b9dc0b0a126b203edc140c/spring-messaging/src/main/java/org/springframework/messaging/converter/AbstractMessageConverter.java#L231-L235
always returns
null
due toStringMessageConverter.supports()
https://github.com/spring-projects/spring-framework/blob/80646591367b93d220b9dc0b0a126b203edc140c/spring-messaging/src/main/java/org/springframework/messaging/converter/StringMessageConverter.java#L50-L55
returns
false
in this case.The question arises, whether this is intentional. If
ObjectStringMessageConverter.toMessage()
should not be used with anything else thanString payload
explicitly throwing anIllegalArgumentException
would probably be a better option. For the opposite case I will provide a PR.The text was updated successfully, but these errors were encountered: