我想使用 com.google.cloud.dataflow.examples.PubsubFileInjector 将 GCS 文件转换为 pubsub 事件。
但是,当我提交管道时,如下所示:
java -cp $JAR_FILE com.google.cloud.dataflow.examples.PubsubFileInjector \
--runner=DataflowPipelineRunner \
--project="project-id" \
--stagingLocation="gs://cloud-dataflow-workspace" \
--input="gs://some/bucket/file" \
--outputTopic="projects/project-id/topics/test-topic"
管道运行时出现以下错误:
Apr 14, 2015, 9:37:36 AM(2b75a55e85963052): java.lang.RuntimeException: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid resource name given (name=projects/project-id/topics/test-topic). Refer to https://cloud.google.com/pubsub/overview#names for more information.", "reason" : "invalidArgument" } ],
但是我确定我的主题名称是正确的。它遵循https://cloud.google.com/pubsub/overview#names中所述的规则。当我列出我所有的主题时,主题就会出现。