google-cloud-pubsub

Google Pub/Sub Java examples

拈花ヽ惹草 提交于 2020-08-07 04:19:48
问题 I'm not able to find a way to read messages from pub/sub using java. I'm using this maven dependency in my pom <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-pubsub</artifactId> <version>0.17.2-alpha</version> </dependency> I implemented this main method to create a new topic: public static void main(String... args) throws Exception { // Your Google Cloud Platform project ID String projectId = ServiceOptions.getDefaultProjectId(); // Your topic ID String topicId =

Local Pubsub Emulator won't work with Dataflow

你离开我真会死。 提交于 2020-07-23 08:08:08
问题 I am developing Dataflow in Java, the input comes from a Pubsub. Later, I saw a guide here on how to use local Pubsub emulator so I would not need to deploy to GCP in order to test. Here is my simple code: private interface Options extends PipelineOptions, PubsubOptions, StreamingOptions { @Description("Pub/Sub topic to read messages from") String getTopic(); void setTopic(String topic); @Description("Pub/Sub subscription to read messages from") String getSubscription(); void setSubscription

Local Pubsub Emulator won't work with Dataflow

六月ゝ 毕业季﹏ 提交于 2020-07-23 08:05:32
问题 I am developing Dataflow in Java, the input comes from a Pubsub. Later, I saw a guide here on how to use local Pubsub emulator so I would not need to deploy to GCP in order to test. Here is my simple code: private interface Options extends PipelineOptions, PubsubOptions, StreamingOptions { @Description("Pub/Sub topic to read messages from") String getTopic(); void setTopic(String topic); @Description("Pub/Sub subscription to read messages from") String getSubscription(); void setSubscription

Local Pubsub Emulator won't work with Dataflow

故事扮演 提交于 2020-07-23 08:04:39
问题 I am developing Dataflow in Java, the input comes from a Pubsub. Later, I saw a guide here on how to use local Pubsub emulator so I would not need to deploy to GCP in order to test. Here is my simple code: private interface Options extends PipelineOptions, PubsubOptions, StreamingOptions { @Description("Pub/Sub topic to read messages from") String getTopic(); void setTopic(String topic); @Description("Pub/Sub subscription to read messages from") String getSubscription(); void setSubscription

Cloud Pub/Sub Notifications for Cloud Storage on sub directory

本秂侑毒 提交于 2020-07-06 19:48:06
问题 I want to listen to changes on GCS in sub bucket I tried this gsutil notification create -t my-topic -f json gs://my-bucket but it gives me notification for changes in all objects is there a way to get only from sub directory, something like this: gsutil notification create -t my-topic -f json gs://my-bucket/sub-dir 回答1: There is indeed a way to limit the notifications to a "directory" inside a bucket. Bear in mind that Cloud Storage is a "flat" storage system, where the concept of directory