coheigea commented on code in PR #3753:
URL: https://github.com/apache/cxf/pull/3753#discussion_r4662463427
##########
rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java:
##########
@@ -85,6 +88,14 @@ private static void
retrieveAndSetPayload(org.apache.cxf.message.Message inMessa
Message message,
boolean allowObjectMessage)
throws UnsupportedEncodingException, JMSException {
+ if (message instanceof StreamMessage && !allowObjectMessage) {
+ // Do not read the body: StreamMessage.readObject() may
deserialize provider-specific
+ // object values. Report the message as an unsupported format
instead, so that the
+ // SOAP/JMS binding can reply with an unsupportedJMSMessageFormat
fault.
+ inMessage.setContent(InputStream.class, new
ByteArrayInputStream(new byte[0]));
Review Comment:
The problem is asCXFMessage() runs in JMSDestination.onMessage() before the
interceptor chain, so throwing there means no reply ever gets sent. The client
just times out and the broker keeps redelivering until it hits the DLQ. Leaving
the body unread and tagging the message as “stream” lets SoapJMSInInterceptor
send back the proper unsupportedJMSMessageFormat fault, which is what the
SOAP/JMS spec wants (and what test1002/test1102 now check). We never read the
body either way, so no deserialization, and the converter still throws as a
backstop.
I'd be more inclined to do the same for ObjectMessage, I can take care of
that in a separate Pr.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]