-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: messagingIssues in messaging modules (jms, messaging)Issues in messaging modules (jms, messaging)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: enhancementA general enhancementA general enhancement
Milestone
Description
Michael Böckling opened SPR-14672 and commented
In org.springframework.jms.support.converter.MappingJackson2MessageConverter#getJavaTypeForMessage, an exception is thrown if a message lacks the property that has been configured as the typeIdPropertyName, and thus Jackson has no idea to which Java type to map the message to.
The error message is "Could not find type id property [" + this.typeIdPropertyName + "]", which lacks sufficient diagnostic context to really track down the issue once it appears in a logfile. It would be very useful to have the name of the JMS queue, so I can make a guess which application forgot to set that ID.
The Message ID might also be useful for some cases.
Proposal:
protected JavaType getJavaTypeForMessage(Message message) throws JMSException {
String typeId = message.getStringProperty(this.typeIdPropertyName);
if (typeId == null) {
throw new MessageConversionException("Could not find type id property [" + this.typeIdPropertyName + "] on message " + message.getJMSMessageID() + " from destination " + message.getJMSDestination().toString());
}Affects: 4.2.6
Backported to: 4.2.8
Metadata
Metadata
Assignees
Labels
in: messagingIssues in messaging modules (jms, messaging)Issues in messaging modules (jms, messaging)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: enhancementA general enhancementA general enhancement