Skip to content

Commit 8db7cef

Browse files
authored
Vijay receive message ttl fix (Azure#17678)
* Fixing a regresion in message converter. * Changing version number.
1 parent 3529a08 commit 8db7cef

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

eng/spotbugs-aggregate-report/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
<dependency>
141141
<groupId>com.microsoft.azure</groupId>
142142
<artifactId>azure-servicebus</artifactId>
143-
<version>3.5.0</version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus;current} -->
143+
<version>3.5.1</version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus;current} -->
144144
</dependency>
145145
</dependencies>
146146
<properties>

eng/versioning/version_data.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ com.microsoft.azure:azure-keyvault-cryptography;1.2.4;1.3.0-beta.1
3434
com.microsoft.azure:azure-keyvault-extensions;1.2.4;1.3.0-beta.1
3535
com.microsoft.azure:azure-keyvault-test;1.2.3;1.2.4
3636
com.microsoft.azure:azure-keyvault-webkey;1.2.4;1.3.0-beta.1
37-
com.microsoft.azure:azure-servicebus;3.4.0;3.5.0
37+
com.microsoft.azure:azure-servicebus;3.5.0;3.5.1
3838
com.microsoft.azure:azure-storage-blob;11.0.2;11.0.2
3939
com.microsoft.azure.msi_auth_token_provider:azure-authentication-msi-token-provider;1.1.0-beta.1;1.1.0-beta.1
4040
com.microsoft.azure:azure-eventgrid;1.4.0-beta.1;1.4.0-beta.1

sdk/servicebus/microsoft-azure-servicebus/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The package can be downloaded from [Maven](https://search.maven.org/artifact/com
1919
<dependency>
2020
<groupId>com.microsoft.azure</groupId>
2121
<artifactId>azure-servicebus</artifactId>
22-
<version>3.5.0</version>
22+
<version>3.5.1</version>
2323
</dependency>
2424
```
2525
[//]: # ({x-version-update-end})

sdk/servicebus/microsoft-azure-servicebus/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>com.microsoft.azure</groupId>
88
<artifactId>azure-servicebus</artifactId>
9-
<version>3.5.0</version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus;current} -->
9+
<version>3.5.1</version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus;current} -->
1010

1111
<name>Microsoft Azure SDK for Service Bus</name>
1212
<description>Java library for Azure Service Bus</description>

sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageConverter.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,20 @@ public static Message convertAmqpMessageToBrokeredMessage(org.apache.qpid.proton
131131
// Header
132132
// Delivery count for service bus starts from 1, for AMQP it starts from 0.
133133
brokeredMessage.setDeliveryCount(amqpMessage.getDeliveryCount() + 1);
134-
brokeredMessage.setTimeToLive(Duration.ofMillis(amqpMessage.getTtl()));
135-
134+
long ttlMillis = amqpMessage.getTtl();
135+
if (ttlMillis > 0l) {
136+
brokeredMessage.setTimeToLive(Duration.ofMillis(ttlMillis));
137+
}
136138

137139
// Properties
138140
// Override TimeToLive from CrationTime and ExpiryTime, as they support duration of any length, which ttl doesn't
139141
if (amqpMessage.getCreationTime() != 0l && amqpMessage.getExpiryTime() != 0l) {
140-
brokeredMessage.setTimeToLive(Duration.ofMillis(amqpMessage.getExpiryTime() - amqpMessage.getCreationTime()));
142+
ttlMillis = amqpMessage.getExpiryTime() - amqpMessage.getCreationTime();
143+
if (ttlMillis > 0l) {
144+
brokeredMessage.setTimeToLive(Duration.ofMillis(ttlMillis));
145+
}
141146
}
147+
142148
Object messageId = amqpMessage.getMessageId();
143149
if (messageId != null) {
144150
brokeredMessage.setMessageId(messageId.toString());

sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/QueueDescription.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public void setUserMetadata(String userMetadata) {
399399
this.userMetadata = userMetadata;
400400
}
401401

402-
boolean getSupportOrdering() {
402+
boolean isSupportOrdering() {
403403
if (this.isSupportOrderingExplicitlySet) {
404404
return this.supportOrdering;
405405
} else {
@@ -442,7 +442,7 @@ public boolean equals(Object o) {
442442
&& AuthorizationRuleSerializer.equals(this.authorizationRules, other.authorizationRules)
443443
&& this.enableExpress == other.enableExpress
444444
&& this.isAnonymousAccessible == other.isAnonymousAccessible
445-
&& this.supportOrdering == other.supportOrdering ) {
445+
&& this.isSupportOrdering() == other.isSupportOrdering() ) {
446446
return true;
447447
}
448448

0 commit comments

Comments
 (0)