From 6e73ab9618f61ee1915e52abe3b80e356bc3c13f Mon Sep 17 00:00:00 2001 From: Mike Micatka <31972785+mmicatka@users.noreply.github.com> Date: Fri, 29 Jul 2022 14:27:19 -0400 Subject: [PATCH] fix: updating return types of ack/nack futures to be consistent with publish (#1204) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: updating return types of ack/nack to be consistent with publish * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * reverting a README change * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 4 ++-- .../clirr-ignored-differences.xml | 17 +++++++++++++++++ .../pubsub/v1/AckReplyConsumerWithResponse.java | 6 +++--- .../v1/AckReplyConsumerWithResponseImpl.java | 6 +++--- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a07fe2f69..bedf96eaf 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-pubsub' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-pubsub:1.120.2' +implementation 'com.google.cloud:google-cloud-pubsub:1.120.3' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.120.2" +libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.120.3" ``` ## Authentication diff --git a/google-cloud-pubsub/clirr-ignored-differences.xml b/google-cloud-pubsub/clirr-ignored-differences.xml index 610c1b362..36ec9cb95 100644 --- a/google-cloud-pubsub/clirr-ignored-differences.xml +++ b/google-cloud-pubsub/clirr-ignored-differences.xml @@ -17,4 +17,21 @@ com/google/cloud/pubsub/v1/MessageDispatcher$Builder com.google.cloud.pubsub.v1.MessageDispatcher$Builder setEnableExactlyOnceDelivery(boolean) + + + + 7006 + com/google/cloud/pubsub/v1/AckReplyConsumerWithResponse + *ack() + com.google.api.core.ApiFuture + Updating return types to be consistent with Publish + + + + 7006 + com/google/cloud/pubsub/v1/AckReplyConsumerWithResponseImpl + *ack() + com.google.api.core.ApiFuture + Updating return types to be consistent with Publish + diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponse.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponse.java index 4bde6acbc..59ea25ae7 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponse.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponse.java @@ -16,8 +16,8 @@ package com.google.cloud.pubsub.v1; +import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import java.util.concurrent.Future; /** * Acknowledging a message in Pub/Sub means that you are done with it, and it will not be delivered @@ -42,7 +42,7 @@ public interface AckReplyConsumerWithResponse { * *

A future representing the server response is returned */ - Future ack(); + ApiFuture ack(); /** * Signals that the message has not been successfully processed. The service should resend the @@ -50,5 +50,5 @@ public interface AckReplyConsumerWithResponse { * *

A future representing the server response is returned */ - Future nack(); + ApiFuture nack(); } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponseImpl.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponseImpl.java index d0a0316af..6e78a1392 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponseImpl.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponseImpl.java @@ -15,8 +15,8 @@ */ package com.google.cloud.pubsub.v1; +import com.google.api.core.ApiFuture; import com.google.api.core.SettableApiFuture; -import java.util.concurrent.Future; public class AckReplyConsumerWithResponseImpl implements AckReplyConsumerWithResponse { final SettableApiFuture ackReplySettableApiFuture; @@ -30,13 +30,13 @@ public AckReplyConsumerWithResponseImpl( } @Override - public Future ack() { + public ApiFuture ack() { ackReplySettableApiFuture.set(MessageDispatcher.AckReply.ACK); return messageFuture; } @Override - public Future nack() { + public ApiFuture nack() { ackReplySettableApiFuture.set(MessageDispatcher.AckReply.NACK); return messageFuture; }