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 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; }