【发布时间】:2021-07-16 06:40:45
【问题描述】:
当 Dataflow 作业无法或不愿处理消息时,如何向 Pub/Sub 发送 NACK。
Pipeline pipeline = Pipeline.create(options);
pipeline.apply("gcs2ZipExtractor-processor",
PubsubIO.readMessagesWithAttributes()
.fromSubscription(pubSubSubscription))
.apply(ParDo.of(new ProcessZipFileEventDoFn(appProps)));
logger.info("Started ZipFile Extractor");
pipeline.run().waitUntilFinish();
上面是我用来运行 ApacheBeam Dataflow 管道作业的代码 sn-p。如果 ProcessZipFileEventDoFn 发生任何故障,我想向 Pub/Sub 订阅发送 NACK 消息,以便将消息移动到 DeadletterTopic。目前,Dataflow Runner 没有发生 NACK。
【问题讨论】:
标签: apache-beam google-cloud-pubsub dataflow