From 3952bcdbe8b383901fc500a146673ae5facbeee3 Mon Sep 17 00:00:00 2001 From: Martyn Taylor Date: Fri, 17 Aug 2018 15:55:39 +0100 Subject: [PATCH] ARTEMIS-2023 Fix missing setEnable1x methods --- .../artemis/jms/client/ActiveMQSession.java | 26 +++++++++++++------ .../ra/inflow/ActiveMQMessageHandler.java | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java index 278b4299e6..528310fa62 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java @@ -144,28 +144,36 @@ public class ActiveMQSession implements QueueSession, TopicSession { public BytesMessage createBytesMessage() throws JMSException { checkClosed(); - return new ActiveMQBytesMessage(session); + ActiveMQBytesMessage message = new ActiveMQBytesMessage(session); + message.setEnable1xPrefixes(enable1xPrefixes); + return message; } @Override public MapMessage createMapMessage() throws JMSException { checkClosed(); - return new ActiveMQMapMessage(session); + ActiveMQMapMessage message = new ActiveMQMapMessage(session); + message.setEnable1xPrefixes(enable1xPrefixes); + return message; } @Override public Message createMessage() throws JMSException { checkClosed(); - return new ActiveMQMessage(session); + ActiveMQMessage message = new ActiveMQMessage(session); + message.setEnable1xPrefixes(enable1xPrefixes); + return message; } @Override public ObjectMessage createObjectMessage() throws JMSException { checkClosed(); - return new ActiveMQObjectMessage(session, options); + ActiveMQObjectMessage message = new ActiveMQObjectMessage(session, options); + message.setEnable1xPrefixes(enable1xPrefixes); + return message; } @Override @@ -173,8 +181,8 @@ public class ActiveMQSession implements QueueSession, TopicSession { checkClosed(); ActiveMQObjectMessage msg = new ActiveMQObjectMessage(session, options); - msg.setObject(object); + msg.setEnable1xPrefixes(enable1xPrefixes); return msg; } @@ -183,7 +191,9 @@ public class ActiveMQSession implements QueueSession, TopicSession { public StreamMessage createStreamMessage() throws JMSException { checkClosed(); - return new ActiveMQStreamMessage(session); + ActiveMQStreamMessage message = new ActiveMQStreamMessage(session); + message.setEnable1xPrefixes(enable1xPrefixes); + return message; } @Override @@ -191,8 +201,8 @@ public class ActiveMQSession implements QueueSession, TopicSession { checkClosed(); ActiveMQTextMessage msg = new ActiveMQTextMessage(session); - msg.setText(null); + msg.setEnable1xPrefixes(enable1xPrefixes); return msg; } @@ -202,8 +212,8 @@ public class ActiveMQSession implements QueueSession, TopicSession { checkClosed(); ActiveMQTextMessage msg = new ActiveMQTextMessage(session); - msg.setText(text); + msg.setEnable1xPrefixes(enable1xPrefixes); return msg; } diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java index 2de6988cbe..33c64454de 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java @@ -282,6 +282,8 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList } ActiveMQMessage msg = ActiveMQMessage.createMessage(message, session, options); + msg.setEnable1xPrefixes(activation.getConnectionFactory().isEnable1xPrefixes()); + boolean beforeDelivery = false; try {