.addAllAckIds(ackIds) .setSubscription(getSubscriptionName(context)) .build(); subscriber.acknowledgeCallable().call(acknowledgeRequest);
public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { if (other == com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance()) return this; if (!other.getSubscription().isEmpty()) { subscription_ = other.subscription_; onChanged(); } if (!other.ackIds_.isEmpty()) { if (ackIds_.isEmpty()) { ackIds_ = other.ackIds_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAckIdsIsMutable(); ackIds_.addAll(other.ackIds_); } onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.pubsub.v1.AcknowledgeRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.pubsub.v1.AcknowledgeRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
if (deliveredAckIds.size() != 0) { AcknowledgeRequest.Builder requestBuilder = AcknowledgeRequest.newBuilder() .setSubscription(cpsSubscription); final Set<String> ackIdsBatch = new HashSet<>(); synchronized (deliveredAckIds) { requestBuilder.addAllAckIds(deliveredAckIds); ackIdsInFlight.addAll(deliveredAckIds); ackIdsBatch.addAll(deliveredAckIds); deliveredAckIds.clear(); ListenableFuture<Empty> response = subscriber.ackMessages(requestBuilder.build()); Futures.addCallback( response,
/** * * * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> * * <code>repeated string ack_ids = 2;</code> */ public Builder setAckIds(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureAckIdsIsMutable(); ackIds_.set(index, value); onChanged(); return this; } /**
public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { if (other == com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance()) return this; if (!other.getSubscription().isEmpty()) { subscription_ = other.subscription_; onChanged(); } if (!other.ackIds_.isEmpty()) { if (ackIds_.isEmpty()) { ackIds_ = other.ackIds_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAckIdsIsMutable(); ackIds_.addAll(other.ackIds_); } onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> * * <code>repeated string ack_ids = 2;</code> */ public Builder addAckIdsBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureAckIdsIsMutable(); ackIds_.add(value); onChanged(); return this; } public final Builder setUnknownFields(
/** * * * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> * * <code>repeated string ack_ids = 2;</code> */ public Builder addAckIdsBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureAckIdsIsMutable(); ackIds_.add(value); onChanged(); return this; }
/** * * * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> * * <code>repeated string ack_ids = 2;</code> */ public Builder addAckIds(java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureAckIdsIsMutable(); ackIds_.add(value); onChanged(); return this; } /**
/** * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> * * <code>repeated string ack_ids = 2;</code> */ public Builder addAckIds( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureAckIdsIsMutable(); ackIds_.add(value); onChanged(); return this; } /**
/** * <code>repeated string ack_ids = 2;</code> * * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> */ public Builder addAckIdsBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureAckIdsIsMutable(); ackIds_.add(value); onChanged(); return this; } public final Builder setUnknownFields(
/** * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> * * <code>repeated string ack_ids = 2;</code> */ public Builder setAckIds( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureAckIdsIsMutable(); ackIds_.set(index, value); onChanged(); return this; } /**
/** * <code>repeated string ack_ids = 2;</code> * * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> */ public Builder addAckIds( java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureAckIdsIsMutable(); ackIds_.add(value); onChanged(); return this; } /**
/** * <code>repeated string ack_ids = 2;</code> * * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> */ public Builder setAckIds( int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureAckIdsIsMutable(); ackIds_.set(index, value); onChanged(); return this; } /**
public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { if (other == com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance()) return this; if (!other.getSubscription().isEmpty()) { subscription_ = other.subscription_; onChanged(); } if (!other.ackIds_.isEmpty()) { if (ackIds_.isEmpty()) { ackIds_ = other.ackIds_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAckIdsIsMutable(); ackIds_.addAll(other.ackIds_); } onChanged(); } onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { if (other == com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance()) return this; if (!other.getSubscription().isEmpty()) { subscription_ = other.subscription_; onChanged(); } if (!other.ackIds_.isEmpty()) { if (ackIds_.isEmpty()) { ackIds_ = other.ackIds_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAckIdsIsMutable(); ackIds_.addAll(other.ackIds_); } onChanged(); } onChanged(); return this; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.pubsub.v1.AcknowledgeRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.pubsub.v1.AcknowledgeRequest) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.pubsub.v1.AcknowledgeRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.pubsub.v1.AcknowledgeRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.pubsub.v1.AcknowledgeRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.pubsub.v1.AcknowledgeRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
/** * <code>repeated string ack_ids = 2;</code> * * <pre> * The acknowledgment ID for the messages being acknowledged that was returned * by the Pub/Sub system in the `Pull` response. Must not be empty. * </pre> */ public Builder addAllAckIds( java.lang.Iterable<java.lang.String> values) { ensureAckIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, ackIds_); onChanged(); return this; } /**