Skip to content

Commit

Permalink
Vijay receive message ttl fix (#17678)
Browse files Browse the repository at this point in the history
* Fixing a regresion in message converter.

* Changing version number.
  • Loading branch information
yvgopal authored Nov 19, 2020
1 parent 3529a08 commit 8db7cef
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion eng/spotbugs-aggregate-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-servicebus</artifactId>
<version>3.5.0</version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus;current} -->
<version>3.5.1</version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus;current} -->
</dependency>
</dependencies>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning/version_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/microsoft-azure-servicebus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The package can be downloaded from [Maven](https://search.maven.org/artifact/com
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-servicebus</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/microsoft-azure-servicebus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-servicebus</artifactId>
<version>3.5.0</version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus;current} -->
<version>3.5.1</version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus;current} -->

<name>Microsoft Azure SDK for Service Bus</name>
<description>Java library for Azure Service Bus</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public void setUserMetadata(String userMetadata) {
this.userMetadata = userMetadata;
}

boolean getSupportOrdering() {
boolean isSupportOrdering() {
if (this.isSupportOrderingExplicitlySet) {
return this.supportOrdering;
} else {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 8db7cef

Please sign in to comment.