You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2014/03/27 07:39:45 UTC
git commit: [CXF-5649]Enable configuration for JMS message type to be
byte when use MTOM (cherry picked from commit
58ea0b97dbc02ae959f48089384fbf906c813b9a)
Repository: cxf
Updated Branches:
refs/heads/2.6.x-fixes 740009299 -> 4d1cde5aa
[CXF-5649]Enable configuration for JMS message type to be byte when use MTOM
(cherry picked from commit 58ea0b97dbc02ae959f48089384fbf906c813b9a)
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4d1cde5a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4d1cde5a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4d1cde5a
Branch: refs/heads/2.6.x-fixes
Commit: 4d1cde5aa87dea85cd1f2718d6ac88f616514be8
Parents: 7400092
Author: Freeman Fang <fr...@gmail.com>
Authored: Thu Mar 27 14:35:51 2014 +0800
Committer: Freeman Fang <fr...@gmail.com>
Committed: Thu Mar 27 14:39:25 2014 +0800
----------------------------------------------------------------------
.../org/apache/cxf/transport/jms/JMSDestination.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/4d1cde5a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
index 4bc2c52..b6ce449 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
@@ -48,6 +48,7 @@ import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.common.classloader.ClassLoaderUtils.ClassLoaderHolder;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.configuration.ConfigurationException;
import org.apache.cxf.continuations.ContinuationProvider;
import org.apache.cxf.continuations.SuspendedInvocationException;
import org.apache.cxf.interceptor.OneWayProcessorInterceptor;
@@ -294,8 +295,10 @@ public class JMSDestination extends AbstractMultiplexDestination
final javax.jms.Message request = (javax.jms.Message)inMessage
.get(JMSConstants.JMS_REQUEST_MESSAGE);
final String msgType;
- if (isMtomEnabled(outMessage)) {
- msgType = JMSConstants.BINARY_MESSAGE_TYPE;
+ if (isMtomEnabled(outMessage)
+ && !jmsConfig.getMessageType().equals(JMSConstants.TEXT_MESSAGE_TYPE)) {
+ //get chance to set messageType from JMSConfiguration with MTOM enabled
+ msgType = jmsConfig.getMessageType();
} else if (request instanceof TextMessage) {
msgType = JMSConstants.TEXT_MESSAGE_TYPE;
} else if (request instanceof BytesMessage) {
@@ -303,6 +306,13 @@ public class JMSDestination extends AbstractMultiplexDestination
} else {
msgType = JMSConstants.BINARY_MESSAGE_TYPE;
}
+
+
+ if (JMSConstants.TEXT_MESSAGE_TYPE.equals(msgType) && isMtomEnabled(outMessage)) {
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message("INVALID_MESSAGE_TYPE", LOG);
+ throw new ConfigurationException(msg);
+ }
Destination replyTo = getReplyToDestination(jmsTemplate, inMessage);