TjerkW
TjerkW

Reputation: 2150

PubsubFileInjector cannot submit to PubSub topic

I wanted to use the com.google.cloud.dataflow.examples.PubsubFileInjector to translate GCS files into pubsub events.

However, when i submit the pipeline, as follows:

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"

I'm getting the following error when the pipeline runs:

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" } ],

However i'm sure my topic name is correct. It follows the rules stated at https://cloud.google.com/pubsub/overview#names. And when i list all my topics, the topic shows up.

Upvotes: 0

Views: 856

Answers (1)

Jeremy Lewi
Jeremy Lewi

Reputation: 6776

What happens if you specify outputTopic in the form:

--outputTopic = /topics/<project>/<topic>

Upvotes: 1

Related Questions