Skip to content

Commit

Permalink
fix: updating return types of ack/nack futures to be consistent with …
Browse files Browse the repository at this point in the history
…publish (#1204)

* 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 <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
mmicatka and gcf-owl-bot[bot] committed Jul 29, 2022
1 parent 507174b commit 6e73ab9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions google-cloud-pubsub/clirr-ignored-differences.xml
Expand Up @@ -17,4 +17,21 @@
<className>com/google/cloud/pubsub/v1/MessageDispatcher$Builder</className>
<method>com.google.cloud.pubsub.v1.MessageDispatcher$Builder setEnableExactlyOnceDelivery(boolean)</method>
</difference>

<difference>
<!-- This should be removed after the next release 1.121.x -->
<differenceType>7006</differenceType>
<className>com/google/cloud/pubsub/v1/AckReplyConsumerWithResponse</className>
<method>*ack()</method>
<to>com.google.api.core.ApiFuture</to>
<justification>Updating return types to be consistent with Publish</justification>
</difference>
<difference>
<!-- This should be removed after the next release 1.121.x -->
<differenceType>7006</differenceType>
<className>com/google/cloud/pubsub/v1/AckReplyConsumerWithResponseImpl</className>
<method>*ack()</method>
<to>com.google.api.core.ApiFuture</to>
<justification>Updating return types to be consistent with Publish</justification>
</difference>
</differences>
Expand Up @@ -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
Expand All @@ -42,13 +42,13 @@ public interface AckReplyConsumerWithResponse {
*
* <p>A future representing the server response is returned
*/
Future<AckResponse> ack();
ApiFuture<AckResponse> ack();

/**
* Signals that the message has not been successfully processed. The service should resend the
* message.
*
* <p>A future representing the server response is returned
*/
Future<AckResponse> nack();
ApiFuture<AckResponse> nack();
}
Expand Up @@ -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<MessageDispatcher.AckReply> ackReplySettableApiFuture;
Expand All @@ -30,13 +30,13 @@ public AckReplyConsumerWithResponseImpl(
}

@Override
public Future<AckResponse> ack() {
public ApiFuture<AckResponse> ack() {
ackReplySettableApiFuture.set(MessageDispatcher.AckReply.ACK);
return messageFuture;
}

@Override
public Future<AckResponse> nack() {
public ApiFuture<AckResponse> nack() {
ackReplySettableApiFuture.set(MessageDispatcher.AckReply.NACK);
return messageFuture;
}
Expand Down

0 comments on commit 6e73ab9

Please sign in to comment.