public Builder mergeFrom(com.google.pubsub.v1.PullRequest other) { if (other == com.google.pubsub.v1.PullRequest.getDefaultInstance()) return this; if (!other.getSubscription().isEmpty()) { subscription_ = other.subscription_; onChanged(); } if (other.getReturnImmediately() != false) { setReturnImmediately(other.getReturnImmediately()); } if (other.getMaxMessages() != 0) { setMaxMessages(other.getMaxMessages()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@OnScheduled public void onScheduled(ProcessContext context) { final Integer batchSize = context.getProperty(BATCH_SIZE).asInteger(); pullRequest = PullRequest.newBuilder() .setMaxMessages(batchSize) .setReturnImmediately(false) .setSubscription(getSubscriptionName(context)) .build(); try { subscriber = getSubscriber(context); } catch (IOException e) { storedException.set(e); getLogger().error("Failed to create Google Cloud Subscriber due to {}", new Object[]{e}); } }
PullRequest pullRequest = PullRequest.newBuilder() .setMaxMessages(numOfMessages) .setReturnImmediately(false) // return immediately if messages are not available .setSubscription(subscriptionName)
.setSubscription(cpsSubscription) .setReturnImmediately(false) .setMaxMessages(cpsMaxBatchSize) .build(); try {
.setSubscription(subscription.getPath()) .setReturnImmediately(returnImmediately) .setMaxMessages(batchSize) .build(); PullResponse response = subscriberStub().pull(request);
.setSubscription(expectedSubscription) .setReturnImmediately(true) .setMaxMessages(10) .build(); Timestamp timestamp =
public Builder mergeFrom(com.google.pubsub.v1.PullRequest other) { if (other == com.google.pubsub.v1.PullRequest.getDefaultInstance()) return this; if (!other.getSubscription().isEmpty()) { subscription_ = other.subscription_; onChanged(); } if (other.getReturnImmediately() != false) { setReturnImmediately(other.getReturnImmediately()); } if (other.getMaxMessages() != 0) { setMaxMessages(other.getMaxMessages()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.PullRequest other) { if (other == com.google.pubsub.v1.PullRequest.getDefaultInstance()) return this; if (!other.getSubscription().isEmpty()) { subscription_ = other.subscription_; onChanged(); } if (other.getReturnImmediately() != false) { setReturnImmediately(other.getReturnImmediately()); } if (other.getMaxMessages() != 0) { setMaxMessages(other.getMaxMessages()); } onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.PullRequest other) { if (other == com.google.pubsub.v1.PullRequest.getDefaultInstance()) return this; if (!other.getSubscription().isEmpty()) { subscription_ = other.subscription_; onChanged(); } if (other.getReturnImmediately() != false) { setReturnImmediately(other.getReturnImmediately()); } if (other.getMaxMessages() != 0) { setMaxMessages(other.getMaxMessages()); } onChanged(); return this; }
@Override public PullRequest createPullRequest(String subscriptionName, Integer maxMessages, Boolean returnImmediately) { Assert.hasLength(subscriptionName, "The subscription name must be provided."); PullRequest.Builder pullRequestBuilder = PullRequest.newBuilder().setSubscription( ProjectSubscriptionName.of(this.projectId, subscriptionName).toString()); if (maxMessages != null) { pullRequestBuilder.setMaxMessages(maxMessages); } if (returnImmediately != null) { pullRequestBuilder.setReturnImmediately(returnImmediately); } return pullRequestBuilder.build(); }
@Override public PullRequest createPullRequest(String subscriptionName, Integer maxMessages, Boolean returnImmediately) { Assert.hasLength(subscriptionName, "The subscription name must be provided."); PullRequest.Builder pullRequestBuilder = PullRequest.newBuilder().setSubscription( ProjectSubscriptionName.of(this.projectId, subscriptionName).toString()); if (maxMessages != null) { pullRequestBuilder.setMaxMessages(maxMessages); } if (returnImmediately != null) { pullRequestBuilder.setReturnImmediately(returnImmediately); } return pullRequestBuilder.build(); }
.setSubscription(subscription) .setReturnImmediately(returnImmediately) .setMaxMessages(maxMessages) .build(); return pull(request);
.setSubscription(subscription == null ? null : subscription.toString()) .setReturnImmediately(returnImmediately) .setMaxMessages(maxMessages) .build(); return pull(request);