qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [1/2] git commit: Enable honoring of the disable message ID value in producer, broker will generate an ID for incoming messages without one.
Date Thu, 16 Oct 2014 17:58:48 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master 437a74fb9 -> 0b4311225


Enable honoring of the disable message ID value in producer, broker will
generate an ID for incoming messages without one.  

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/29f2dcda
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/29f2dcda
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/29f2dcda

Branch: refs/heads/master
Commit: 29f2dcda176c2e878563f215035b7c2420791820
Parents: 437a74f
Author: Timothy Bish <tabish121@gmail.com>
Authored: Thu Oct 16 12:17:27 2014 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Thu Oct 16 12:17:27 2014 -0400

----------------------------------------------------------------------
 .../amqp/message/AmqpJmsMessageFacade.java      |  2 +-
 .../jms/producer/JmsMessageProducerTest.java    | 30 ++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/29f2dcda/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
index 8a6a20b..b767632 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
@@ -231,7 +231,7 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade {
         if (disableMsgId) {
             // TODO - ActiveMQ will synthesize a message Id, but I don't think it has been
             //        really well tested, so we should investigate before enabling this.
-            // setMessageId(null);
+            setMessageId(null);
         }
 
         if (disableTimestamp) {

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/29f2dcda/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
index ceb2d53..254015f 100644
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
+++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
@@ -144,6 +144,36 @@ public class JmsMessageProducerTest extends AmqpTestSupport {
         assertEquals(0, message.getJMSExpiration());
     }
 
+    @Test
+    public void testProducerWithNoMessageIdCanBeConsumed() throws Exception {
+        connection = createAmqpConnection();
+        assertNotNull(connection);
+        connection.start();
+
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        assertNotNull(session);
+        Queue queue = session.createQueue(name.getMethodName());
+        MessageProducer producer = session.createProducer(queue);
+        producer.setDisableMessageID(true);
+
+        QueueViewMBean proxy = getProxyToQueue(name.getMethodName());
+        assertEquals(0, proxy.getQueueSize());
+
+        for (int i = 0; i < 10; ++i) {
+            Message message = session.createMessage();
+            producer.send(message);
+        }
+
+        assertEquals(10, proxy.getQueueSize());
+
+        MessageConsumer consumer = session.createConsumer(queue);
+        for (int i = 0; i < 10; i++) {
+            Message message = consumer.receive(5000);
+            assertNotNull(message);
+            assertEquals(0, message.getJMSExpiration());
+        }
+    }
+
     private String createLargeString(int sizeInBytes) {
         byte[] base = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
         StringBuilder builder = new StringBuilder();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message