我想使用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中规定的规则。当我列出我的所有主题时,主题会显示出来。
答案 0 :(得分:1)
如果您在表单中指定outputTopic会发生什么:
--outputTopic = /topics/<project>/<topic>