We are running our program inside a kubernetes pod, which is listening to pubsub message. Based on message data type it launches dataflow job. And once job execution finishes, we again send pubsub message to another system.
Pipeline is launched in batch mode and it read from GCS and after processing write to GCS.
Pipeline pipeline = Pipeline.create(options);
PCollection<String> read = pipeline
.apply("Read from GCS",
TextIO.read().from("GCS_PATH").withCompression(Compression.GZIP));
//process
// write to GCS
....
PipelineResult result = pipeline.run();
result.waitUntilFinish();
# send job completed message to Pubsub to other component
....
....
As I have to send event to other components in the system. As of now I am using Pubsbub java client library to push message to pubsub.
Is there a way, I can use apache Pubsub connector to send message like below - Or what is the right way to do the same
PubsubIO.writeMessages().to("topicName");