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
{{ message }}
Repository navigation
AbstractJacksonMessageConverter throws InvalidMimeTypeException for a malformed content type #3743
AbstractJacksonMessageConverter#fromMessage checks the incoming content type with this.supportedContentType.isCompatibleWith(MimeType.valueOf(contentType)). MimeType.valueOf throws InvalidMimeTypeException for a value that is not a MIME type, such as json or text, which third-party publishers do set. Before GH-3520 such a message was either converted ("json".contains("json")) or returned as byte[] with a warning; now the exception escapes fromMessage. As it is an IllegalArgumentException rather than a MessageConversionException, ConditionalRejectingErrorHandler does not consider it fatal, so the message is requeued and redelivered indefinitely.
determineEncoding, a few lines below, already guards its own MimeTypeUtils.parseMimeType(contentType) against exactly this.
To Reproduce
JacksonJsonMessageConverterconverter = newJacksonJsonMessageConverter();
MessagePropertiesproperties = newMessageProperties();
properties.setContentType("json");
converter.fromMessage(newMessage("{\"ticker\":\"VMW\"}".getBytes(), properties));
// org.springframework.util.InvalidMimeTypeException: Invalid mime type "json": does not contain '/'
Expected behavior
A content type that cannot be parsed is treated like an unsupported one: the usual warning is logged and the body is returned as is (or Optional.empty() with nullAsOptionalEmpty), so listener error handling sees the same outcome as for any other non-JSON content type.
Activity
artembilan commentedon Oct 26, 2026
@sharanggupta ,
Please, be our guest.
Happy to review and merge your PR.
Thank you!
sharanggupta commentedon Oct 26, 2026
Thanks, @artembilan, opened #3779.
GH-3743: Handle malformed content type in Jackson converter
GH-3743: Handle malformed content type in Jackson converter
GH-3743: Handle malformed content type in Jackson converter