cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject git commit: [CXF-5649]Enable configuration for JMS message type to be byte when use MTOM
Date Thu, 27 Mar 2014 06:19:31 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 5427c2ece -> d16e2ea97


[CXF-5649]Enable configuration for JMS message type to be byte when use MTOM


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d16e2ea9
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d16e2ea9
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d16e2ea9

Branch: refs/heads/master
Commit: d16e2ea9758eecf8f85830352877904e23bb35d9
Parents: 5427c2e
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Thu Mar 27 14:19:05 2014 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Thu Mar 27 14:19:05 2014 +0800

----------------------------------------------------------------------
 .../cxf/transport/jms/BackChannelConduit.java     | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d16e2ea9/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/BackChannelConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/BackChannelConduit.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/BackChannelConduit.java
index d07b6be..321eded 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/BackChannelConduit.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/BackChannelConduit.java
@@ -34,6 +34,7 @@ import javax.jms.TextMessage;
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.configuration.ConfigurationException;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.transport.AbstractConduit;
@@ -124,8 +125,21 @@ class BackChannelConduit extends AbstractConduit implements JMSExchangeSender
{
             // setup the reply message
             final javax.jms.Message request = (javax.jms.Message)inMessage
                 .get(JMSConstants.JMS_REQUEST_MESSAGE);
-            final String msgType = JMSMessageUtils.isMtomEnabled(outMessage)
-                ? JMSConstants.BINARY_MESSAGE_TYPE : JMSMessageUtils.getMessageType(request);
+            final String msgType;
+            if (JMSMessageUtils.isMtomEnabled(outMessage) 
+                && !jmsConfig.getMessageType().equals(JMSConstants.TEXT_MESSAGE_TYPE))
{
+                //get chance to set messageType from JMSConfiguration with MTOM enabled
+                msgType = jmsConfig.getMessageType();
+            } else {
+                msgType = JMSMessageUtils.getMessageType(request);
+            }
+            if (JMSConstants.TEXT_MESSAGE_TYPE.equals(msgType) 
+                && JMSMessageUtils.isMtomEnabled(outMessage)) {
+                org.apache.cxf.common.i18n.Message msg = 
+                    new org.apache.cxf.common.i18n.Message("INVALID_MESSAGE_TYPE", LOG);
+                throw new ConfigurationException(msg);
+            }
+            
             if (isTimedOut(request)) {
                 return;
             }


Mime
View raw message