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

fix: updating return types of ack/nack futures to be consistent with publish #1204

Merged
merged 4 commits into from Jul 29, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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