@java.lang.Override public com.google.pubsub.v1.PushConfig getDefaultInstanceForType() { return com.google.pubsub.v1.PushConfig.getDefaultInstance(); }
/** * * * <pre> * If push delivery is used with this subscription, this field is * used to configure it. An empty `pushConfig` signifies that the subscriber * will pull and ack messages using API methods. * </pre> * * <code>.google.pubsub.v1.PushConfig push_config = 4;</code> */ public com.google.pubsub.v1.PushConfig getPushConfig() { return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; } /**
/** * * * <pre> * The push configuration for future deliveries. * An empty `pushConfig` indicates that the Pub/Sub system should * stop pushing messages from the given subscription and allow * messages to be pulled and acknowledged - effectively pausing * the subscription if `Pull` or `StreamingPull` is not called. * </pre> * * <code>.google.pubsub.v1.PushConfig push_config = 2;</code> */ public com.google.pubsub.v1.PushConfig getPushConfig() { return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; } /**
/** * * * <pre> * If push delivery is used with this subscription, this field is * used to configure it. An empty `pushConfig` signifies that the subscriber * will pull and ack messages using API methods. * </pre> * * <code>.google.pubsub.v1.PushConfig push_config = 4;</code> */ public com.google.pubsub.v1.PushConfig getPushConfig() { if (pushConfigBuilder_ == null) { return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; } else { return pushConfigBuilder_.getMessage(); } } /**
/** * * * <pre> * If push delivery is used with this subscription, this field is * used to configure it. An empty `pushConfig` signifies that the subscriber * will pull and ack messages using API methods. * </pre> * * <code>.google.pubsub.v1.PushConfig push_config = 4;</code> */ public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { if (pushConfigBuilder_ != null) { return pushConfigBuilder_.getMessageOrBuilder(); } else { return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; } } /**
/** * * * <pre> * The push configuration for future deliveries. * An empty `pushConfig` indicates that the Pub/Sub system should * stop pushing messages from the given subscription and allow * messages to be pulled and acknowledged - effectively pausing * the subscription if `Pull` or `StreamingPull` is not called. * </pre> * * <code>.google.pubsub.v1.PushConfig push_config = 2;</code> */ public com.google.pubsub.v1.PushConfig getPushConfig() { if (pushConfigBuilder_ == null) { return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; } else { return pushConfigBuilder_.getMessage(); } } /**
/** * * * <pre> * The push configuration for future deliveries. * An empty `pushConfig` indicates that the Pub/Sub system should * stop pushing messages from the given subscription and allow * messages to be pulled and acknowledged - effectively pausing * the subscription if `Pull` or `StreamingPull` is not called. * </pre> * * <code>.google.pubsub.v1.PushConfig push_config = 2;</code> */ public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { if (pushConfigBuilder_ != null) { return pushConfigBuilder_.getMessageOrBuilder(); } else { return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; } } /**
/** * * * <pre> * A URL locating the endpoint to which messages should be pushed. * For example, a Webhook endpoint might use "https://example.com/push". * </pre> * * <code>string push_endpoint = 1;</code> */ public Builder clearPushEndpoint() { pushEndpoint_ = getDefaultInstance().getPushEndpoint(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.pubsub.v1.PushConfig other) { if (other == com.google.pubsub.v1.PushConfig.getDefaultInstance()) return this; if (!other.getPushEndpoint().isEmpty()) { pushEndpoint_ = other.pushEndpoint_; onChanged(); } internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** Example of creating a pull subscription for a topic. */ public Subscription createSubscription(String topicId, String subscriptionId) throws Exception { // [START pubsub_create_pull_subscription] try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { // eg. projectId = "my-test-project", topicId = "my-test-topic" ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId); // eg. subscriptionId = "my-test-subscription" ProjectSubscriptionName subscriptionName = ProjectSubscriptionName.of(projectId, subscriptionId); // create a pull subscription with default acknowledgement deadline Subscription subscription = subscriptionAdminClient.createSubscription( subscriptionName, topicName, PushConfig.getDefaultInstance(), 0); return subscription; } // [END pubsub_create_pull_subscription] }
subscription, topic, PushConfig.getDefaultInstance(), 0);
/** * Creates and returns a Pub/Sub subscription object listening to the Occurrence topic * @param subId the identifier you want to associate with the subscription * @param projectId the GCP project to create the subscription under * @throws IOException thrown on errors with the subscription client * @throws StatusRuntimeException if subscription already exists * */ public static Subscription createOccurrenceSubscription(String subId, String projectId) throws IOException, StatusRuntimeException { // This topic id will automatically receive messages when Occurrences are added or modified String topicId = "container-analysis-occurrences-v1beta1"; SubscriptionAdminClient client = SubscriptionAdminClient.create(); PushConfig config = PushConfig.getDefaultInstance(); ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId); ProjectSubscriptionName subName = ProjectSubscriptionName.of(projectId, subId); Subscription sub = client.createSubscription(subName, topicName, config, 0); return sub; } // [END pubsub]
subscriptionName, topicName, PushConfig.getDefaultInstance(), 0); } catch (ApiException e) {
/** * <pre> * If push delivery is used with this subscription, this field is * used to configure it. An empty `pushConfig` signifies that the subscriber * will pull and ack messages using API methods. * </pre> * * <code>optional .google.pubsub.v1.PushConfig push_config = 4;</code> */ public com.google.pubsub.v1.PushConfig getPushConfig() { return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; } /**
public com.google.pubsub.v1.PushConfig getDefaultInstanceForType() { return com.google.pubsub.v1.PushConfig.getDefaultInstance(); }
@java.lang.Override public com.google.pubsub.v1.PushConfig getDefaultInstanceForType() { return com.google.pubsub.v1.PushConfig.getDefaultInstance(); }
/** * <code>optional string push_endpoint = 1;</code> * * <pre> * A URL locating the endpoint to which messages should be pushed. * For example, a Webhook endpoint might use "https://example.com/push". * </pre> */ public Builder clearPushEndpoint() { pushEndpoint_ = getDefaultInstance().getPushEndpoint(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.pubsub.v1.PushConfig other) { if (other == com.google.pubsub.v1.PushConfig.getDefaultInstance()) return this; if (!other.getPushEndpoint().isEmpty()) { pushEndpoint_ = other.pushEndpoint_; onChanged(); } internalGetMutableAttributes().mergeFrom( other.internalGetAttributes()); onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.PushConfig other) { if (other == com.google.pubsub.v1.PushConfig.getDefaultInstance()) return this; if (!other.getPushEndpoint().isEmpty()) { pushEndpoint_ = other.pushEndpoint_; onChanged(); } internalGetMutableAttributes().mergeFrom( other.internalGetAttributes()); onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.PushConfig other) { if (other == com.google.pubsub.v1.PushConfig.getDefaultInstance()) return this; if (!other.getPushEndpoint().isEmpty()) { pushEndpoint_ = other.pushEndpoint_; onChanged(); } internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }