activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6486
Date Wed, 26 Oct 2016 23:05:16 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.14.x d005e1a85 -> a2c7433e7


https://issues.apache.org/jira/browse/AMQ-6486

Ensure that message with no header is marked as non-persistent.
(cherry picked from commit a2d92ef786ad6fd542afb82543784794321fd13d)


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

Branch: refs/heads/activemq-5.14.x
Commit: a2c7433e7dec82ae350e1e0cdb7838cce37cb422
Parents: d005e1a
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Oct 26 19:04:35 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Wed Oct 26 19:05:11 2016 -0400

----------------------------------------------------------------------
 .../amqp/message/InboundTransformer.java        |  1 +
 .../transport/amqp/JMSInteroperabilityTest.java |  2 +-
 .../amqp/interop/AmqpSendReceiveTest.java       | 25 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/a2c7433e/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java
index 323a9c1..eaea705 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java
@@ -108,6 +108,7 @@ public abstract class InboundTransformer {
             }
         } else {
             jms.setPriority((byte) Message.DEFAULT_PRIORITY);
+            jms.setPersistent(false);
         }
 
         final MessageAnnotations ma = amqp.getMessageAnnotations();

http://git-wip-us.apache.org/repos/asf/activemq/blob/a2c7433e/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java
index e3d3b17..a91b685 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java
@@ -198,7 +198,7 @@ public class JMSInteroperabilityTest extends JMSClientTestSupport {
         MessageProducer amqpProducer = amqpSession.createProducer(queue);
         MessageConsumer openwireConsumer = openwireSession.createConsumer(queue);
 
-        TextMessage outbound = openwireSession.createTextMessage();
+        TextMessage outbound = amqpSession.createTextMessage();
         outbound.setText(testMessageBody);
         outbound.setBooleanProperty("Boolean", bool);
         outbound.setByteProperty("Byte", bValue);

http://git-wip-us.apache.org/repos/asf/activemq/blob/a2c7433e/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
index f0d6da8..ef3f27d 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
@@ -478,6 +478,31 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
     }
 
     @Test(timeout = 60000)
+    public void testMessageWithNoHeaderNotMarkedDurable() throws Exception {
+        AmqpClient client = createAmqpClient();
+        AmqpConnection connection = trackConnection(client.connect());
+        AmqpSession session = connection.createSession();
+
+        AmqpSender sender = session.createSender("queue://" + getTestName());
+        AmqpReceiver receiver1 = session.createReceiver("queue://" + getTestName());
+
+        // Create default message that should be sent as non-durable
+        AmqpMessage message1 = new AmqpMessage();
+        message1.setText("Test-Message -> non-durable");
+        message1.setMessageId("ID:Message:1");
+        sender.send(message1);
+
+        receiver1.flow(1);
+        AmqpMessage message2 = receiver1.receive(50, TimeUnit.SECONDS);
+        assertNotNull("Should have read a message", message2);
+        assertFalse("Second message sent should not be durable", message2.isDurable());
+        message2.accept();
+
+        sender.close();
+        connection.close();
+    }
+
+    @Test(timeout = 60000)
     public void testSendMessageToQueueNoPrefixReceiveWithPrefix() throws Exception {
         AmqpClient client = createAmqpClient();
         AmqpConnection connection = trackConnection(client.connect());


Mime
View raw message