From c8ee2de96ca14fb44faed29227ff722ef7f6e620 Mon Sep 17 00:00:00 2001 From: Vijaya Gopal Yarramneni Date: Wed, 18 Nov 2020 21:28:15 -0800 Subject: [PATCH 1/2] Fixing a regresion in message converter. --- .../microsoft/azure/servicebus/MessageConverter.java | 12 +++++++++--- .../servicebus/management/QueueDescription.java | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageConverter.java b/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageConverter.java index ea925d9814258..a3c60b7e1785b 100644 --- a/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageConverter.java +++ b/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageConverter.java @@ -131,14 +131,20 @@ public static Message convertAmqpMessageToBrokeredMessage(org.apache.qpid.proton // Header // Delivery count for service bus starts from 1, for AMQP it starts from 0. brokeredMessage.setDeliveryCount(amqpMessage.getDeliveryCount() + 1); - brokeredMessage.setTimeToLive(Duration.ofMillis(amqpMessage.getTtl())); - + long ttlMillis = amqpMessage.getTtl(); + if (ttlMillis > 0l) { + brokeredMessage.setTimeToLive(Duration.ofMillis(ttlMillis)); + } // Properties // Override TimeToLive from CrationTime and ExpiryTime, as they support duration of any length, which ttl doesn't if (amqpMessage.getCreationTime() != 0l && amqpMessage.getExpiryTime() != 0l) { - brokeredMessage.setTimeToLive(Duration.ofMillis(amqpMessage.getExpiryTime() - amqpMessage.getCreationTime())); + ttlMillis = amqpMessage.getExpiryTime() - amqpMessage.getCreationTime(); + if (ttlMillis > 0l) { + brokeredMessage.setTimeToLive(Duration.ofMillis(ttlMillis)); + } } + Object messageId = amqpMessage.getMessageId(); if (messageId != null) { brokeredMessage.setMessageId(messageId.toString()); diff --git a/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/QueueDescription.java b/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/QueueDescription.java index 4126253b84960..44466a5f16d9c 100644 --- a/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/QueueDescription.java +++ b/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/QueueDescription.java @@ -399,7 +399,7 @@ public void setUserMetadata(String userMetadata) { this.userMetadata = userMetadata; } - boolean getSupportOrdering() { + boolean isSupportOrdering() { if (this.isSupportOrderingExplicitlySet) { return this.supportOrdering; } else { @@ -442,7 +442,7 @@ public boolean equals(Object o) { && AuthorizationRuleSerializer.equals(this.authorizationRules, other.authorizationRules) && this.enableExpress == other.enableExpress && this.isAnonymousAccessible == other.isAnonymousAccessible - && this.supportOrdering == other.supportOrdering ) { + && this.isSupportOrdering() == other.isSupportOrdering() ) { return true; } From 15d0292a7791125cf0502c8c08913e0ff1313c5b Mon Sep 17 00:00:00 2001 From: Vijaya Gopal Yarramneni Date: Wed, 18 Nov 2020 21:43:36 -0800 Subject: [PATCH 2/2] Changing version number. --- eng/spotbugs-aggregate-report/pom.xml | 2 +- eng/versioning/version_data.txt | 2 +- sdk/servicebus/microsoft-azure-servicebus/README.md | 2 +- sdk/servicebus/microsoft-azure-servicebus/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/spotbugs-aggregate-report/pom.xml b/eng/spotbugs-aggregate-report/pom.xml index 979f49c9999a3..a06be9c59e826 100644 --- a/eng/spotbugs-aggregate-report/pom.xml +++ b/eng/spotbugs-aggregate-report/pom.xml @@ -140,7 +140,7 @@ com.microsoft.azure azure-servicebus - 3.5.0 + 3.5.1 diff --git a/eng/versioning/version_data.txt b/eng/versioning/version_data.txt index d56fc84facdc2..61c6a98825dfd 100644 --- a/eng/versioning/version_data.txt +++ b/eng/versioning/version_data.txt @@ -34,7 +34,7 @@ com.microsoft.azure:azure-keyvault-cryptography;1.2.4;1.3.0-beta.1 com.microsoft.azure:azure-keyvault-extensions;1.2.4;1.3.0-beta.1 com.microsoft.azure:azure-keyvault-test;1.2.3;1.2.4 com.microsoft.azure:azure-keyvault-webkey;1.2.4;1.3.0-beta.1 -com.microsoft.azure:azure-servicebus;3.4.0;3.5.0 +com.microsoft.azure:azure-servicebus;3.5.0;3.5.1 com.microsoft.azure:azure-storage-blob;11.0.2;11.0.2 com.microsoft.azure.msi_auth_token_provider:azure-authentication-msi-token-provider;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure:azure-eventgrid;1.4.0-beta.1;1.4.0-beta.1 diff --git a/sdk/servicebus/microsoft-azure-servicebus/README.md b/sdk/servicebus/microsoft-azure-servicebus/README.md index e9fcc54683aaf..35f0342a8562d 100644 --- a/sdk/servicebus/microsoft-azure-servicebus/README.md +++ b/sdk/servicebus/microsoft-azure-servicebus/README.md @@ -19,7 +19,7 @@ The package can be downloaded from [Maven](https://search.maven.org/artifact/com com.microsoft.azure azure-servicebus - 3.5.0 + 3.5.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/servicebus/microsoft-azure-servicebus/pom.xml b/sdk/servicebus/microsoft-azure-servicebus/pom.xml index 99c739152737f..de05fa709cd89 100644 --- a/sdk/servicebus/microsoft-azure-servicebus/pom.xml +++ b/sdk/servicebus/microsoft-azure-servicebus/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.microsoft.azure azure-servicebus - 3.5.0 + 3.5.1 Microsoft Azure SDK for Service Bus Java library for Azure Service Bus