I am working on an error queue checking tool for the company I work for, and I have this thing and it works with Spring Boot, which does all my bean settings using annotations (as opposed to using any xml). The tool works (for now) as intended, except for the fact that in our error queue (which is the IBM MQ series), some xml messages contain a new line, which my JMS listener sees as their own thing. In fact, it would seem that it exclusively processes the XML message in turn, and not the whole message (although it processes all HL7 messages just fine). This functionality is not in my power, but its own question.
When my JMS listener catches this newline character, it throws an exception, stating that the message payload cannot be empty and then flushes something with a zero index. It initiates a rollback and causes mine JMSErrorhandler, the problem is that it remains in this loop (forever ...). From the debugger, it looks like this exception occurs somewhere in the Spring code right before it passes to my method processOrder(), since it never hits my breakpoints. I am not in the workplace, so I do not have access to the code, as well as to stacktrace (I hope my terrible explanation for the error is enough), but I can say that the listener is modeled directly from this, from the Spring website:
@Component
public class MyService {
@JmsListener(destination = "myDestination")
public void processOrder(String data) { ... }
}
-, ; , - ? , , , , .
.: , - Spring, . :
Caused by: org.springframework.messaging.converter.MessageConversionException: No converter found to convert to class java.lang.String, message=GenericMessage [payload=
JMSMessage class: jms_none
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 5
JMSMessageID: ID:414d5120514d5f4445565f595731202056d7ea6b28797f6b
JMSTimestamp: 1460469585820
JMSCorrelationID: null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: false
JMSXAppID: perl
JMSXDeliveryCount: 1
JMSXUserID: cisadm
JMS_IBM_Character_Set: ISO-8859-1
JMS_IBM_Encoding: 273
JMS_IBM_Format: MQSTR
JMS_IBM_MsgType: 8
JMS_IBM_PutApplType: 6
JMS_IBM_PutDate: 20160412
JMS_IBM_PutTime: 13594582, headers={JMS_IBM_Character_Set=ISO-8859-1, JMS_IBM_MsgType=8, JMSXUserID=cisadm , jms_priority=5, JMS_IBM_Encoding=273, jms_timestamp=1460469585820, JMSXAppID=perl , JMS_IBM_PutApplType=6, JMS_IBM_Format=MQSTR , jms_redelivered=false, JMS_IBM_PutDate=20160412, jms_deliveryMode=2, JMSXDeliveryCount=1, JMS_IBM_PutTime=13594582, id=1dfefda3-49cb-dfcc-1a31-b8087e3d6ebd, jms_expiration=0, jms_messageId=ID:414d5120514d5f4445565f595731202056d7ea6b28797f6b, timestamp=1460469638210}]
at org.springframework.messaging.handler.annotation.support.PayloadArgumentResolver.resolveArgument(PayloadArgumentResolver.java:118) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:139) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:108) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:90) ~[spring-jms-4.2.4.RELEASE.jar:4.2.4.RELEASE]
... 10 more
, . ?