You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2014/10/20 13:09:51 UTC
[4/4] git commit: enable sending byte value for destination type
annotations
enable sending byte value for destination type annotations
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/ace7dc39
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/ace7dc39
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/ace7dc39
Branch: refs/heads/master
Commit: ace7dc392fdf978c0efa0c1918b3c0033e9f66b7
Parents: 03d3ff3
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Oct 20 11:27:27 2014 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Mon Oct 20 11:27:49 2014 +0100
----------------------------------------------------------------------
.../qpid/jms/provider/amqp/AmqpConnection.java | 5 ++++
.../provider/amqp/AmqpConnectionProperties.java | 3 +++
.../qpid/jms/provider/amqp/AmqpProvider.java | 2 +-
.../amqp/message/AmqpMessageSupport.java | 25 --------------------
.../jms/integration/MessageIntegrationTest.java | 6 ++---
5 files changed, 11 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/ace7dc39/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
index 0ef8835..448556a 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
@@ -30,6 +30,7 @@ import org.apache.qpid.jms.meta.JmsSessionInfo;
import org.apache.qpid.jms.provider.AsyncResult;
import org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFactory;
import org.apache.qpid.jms.util.IOExceptionSupport;
+import org.apache.qpid.proton.amqp.Symbol;
import org.apache.qpid.proton.engine.Connection;
import org.apache.qpid.proton.engine.EndpointState;
import org.apache.qpid.proton.engine.Sasl;
@@ -63,6 +64,10 @@ public class AmqpConnection extends AmqpAbstractResource<JmsConnectionInfo, Conn
public AmqpConnection(AmqpProvider provider, Connection protonConnection, Sasl sasl, JmsConnectionInfo info) {
super(info, protonConnection);
+ Map<Symbol, Object> properties = new HashMap<>();
+ properties.put(AmqpConnectionProperties.JMS_MAPPING_VERSION_KEY, AmqpConnectionProperties.JMS_MAPPING_VERSION_VALUE);
+ protonConnection.setProperties(properties);
+
this.provider = provider;
this.remoteURI = provider.getRemoteURI();
this.amqpMessageFactory = new AmqpJmsMessageFactory(this);
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/ace7dc39/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
index add4d72..9708bda 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
@@ -27,6 +27,9 @@ import org.apache.qpid.proton.amqp.Symbol;
*/
public class AmqpConnectionProperties {
+ public static final Symbol JMS_MAPPING_VERSION_KEY = Symbol.valueOf("x-opt-jms-mapping-version");
+ public static final short JMS_MAPPING_VERSION_VALUE = 0;
+
private static final Symbol ANONYMOUS_RELAY = Symbol.valueOf("x-opt-anonymous-relay");
private String anonymousRelayName;
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/ace7dc39/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java
index 6573d26..4766bf0 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java
@@ -88,7 +88,7 @@ public class AmqpProvider extends AbstractProvider implements TransportListener
private boolean traceBytes;
private boolean presettleConsumers;
private boolean presettleProducers;
- private boolean useByteDestinationTypeAnnotation = false; //TODO: enable
+ private boolean useByteDestinationTypeAnnotation = true;
private long connectTimeout = JmsConnectionInfo.DEFAULT_CONNECT_TIMEOUT;
private long closeTimeout = JmsConnectionInfo.DEFAULT_CLOSE_TIMEOUT;
private long requestTimeout = JmsConnectionInfo.DEFAULT_REQUEST_TIMEOUT;
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/ace7dc39/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpMessageSupport.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpMessageSupport.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpMessageSupport.java
index 2d9c6f7..92f4617 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpMessageSupport.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpMessageSupport.java
@@ -44,31 +44,6 @@ public final class AmqpMessageSupport {
public static final String AMQP_REPLY_TO_ANNOTATION = "x-opt-reply-type";
/**
- * Attribute used to mark a destination as temporary.
- */
- public static final String TEMPORARY_ATTRIBUTE = "temporary";
-
- /**
- * Attribute used to mark a destination as being a Queue type.
- */
- public static final String QUEUE_ATTRIBUTES = "queue";
-
- /**
- * Attribute used to mark a destination as being a Topic type.
- */
- public static final String TOPIC_ATTRIBUTES = "topic";
-
- /**
- * Convenience value used to mark a destination as a Temporary Queue.
- */
- public static final String TEMP_QUEUE_ATTRIBUTES = TEMPORARY_ATTRIBUTE + "," + QUEUE_ATTRIBUTES;
-
- /**
- * Convenience value used to mark a destination as a Temporary Topic.
- */
- public static final String TEMP_TOPIC_ATTRIBUTES = TEMPORARY_ATTRIBUTE + "," + TOPIC_ATTRIBUTES;
-
- /**
* Attribute used to mark the Application defined correlation Id that has been
* set for the message.
*/
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/ace7dc39/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
index b70f8d6..d8220d8 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
@@ -276,7 +276,6 @@ public class MessageIntegrationTest extends QpidJmsTestCase
* Tests that the {@link AmqpMessageSupport#AMQP_TO_ANNOTATION} is set as a byte on
* a sent message to indicate its 'to' address represents a Topic JMSDestination.
*/
- @Ignore //TODO: enable when toggling default
@Test(timeout = 5000)
public void testSentMessageContainsToTypeAnnotationByte() throws Exception {
try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
@@ -314,7 +313,6 @@ public class MessageIntegrationTest extends QpidJmsTestCase
* Tests that the {@link AmqpMessageSupport#AMQP_REPLY_TO_ANNOTATION} is set as a byte on
* a sent message to indicate its 'reply-to' address represents a Topic JMSDestination.
*/
- @Ignore //TODO: enable when toggling default
@Test(timeout = 5000)
public void testSentMessageContainsReplyToTypeAnnotationByte() throws Exception {
try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
@@ -456,7 +454,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
Queue queue = session.createQueue("myQueue");
MessageAnnotationsDescribedType msgAnnotations = new MessageAnnotationsDescribedType();
- msgAnnotations.setSymbolKeyedAnnotation(AmqpMessageSupport.AMQP_TO_ANNOTATION, AmqpMessageSupport.TOPIC_ATTRIBUTES);
+ msgAnnotations.setSymbolKeyedAnnotation(AmqpMessageSupport.AMQP_TO_ANNOTATION, AmqpDestinationHelper.TOPIC_ATTRIBUTES_STRING);
PropertiesDescribedType props = new PropertiesDescribedType();
String myTopicAddress = "myTopicAddress";
@@ -498,7 +496,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
Queue queue = session.createQueue("myQueue");
MessageAnnotationsDescribedType msgAnnotations = new MessageAnnotationsDescribedType();
- msgAnnotations.setSymbolKeyedAnnotation(AmqpMessageSupport.AMQP_REPLY_TO_ANNOTATION, AmqpMessageSupport.TOPIC_ATTRIBUTES);
+ msgAnnotations.setSymbolKeyedAnnotation(AmqpMessageSupport.AMQP_REPLY_TO_ANNOTATION, AmqpDestinationHelper.TOPIC_ATTRIBUTES_STRING);
PropertiesDescribedType props = new PropertiesDescribedType();
String myTopicAddress = "myTopicAddress";
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org