Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vijay receive message ttl fix #17678

Merged
merged 2 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
yvgopal marked this conversation as resolved.
Show resolved Hide resolved
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