axelspringer/graphql-google-pubsub

Subscription topic does not exist

lohmander opened this issue · 2 comments

I might be missing something, but didn't find anything in the docs about having to create topics manually.

As soon as my client attempts to subscribe to a topic, it fails with:

(node:12814) UnhandledPromiseRejectionWarning: Error: 5 NOT_FOUND: Subscription topic does not exist
    at Object.exports.createStatusError (.../server/node_modules/grpc/src/common.js:87:15)
    at Object.onReceiveStatus (.../server/node_modules/grpc/src/client_interceptors.js:1188:28)
    at InterceptingListener._callNext (.../server/node_modules/grpc/src/client_interceptors.js:564:42)
    at InterceptingListener.onReceiveStatus (.../server/node_modules/grpc/src/client_interceptors.js:614:8)
    at callback (.../server/node_modules/grpc/src/client_interceptors.js:841:24)

I'm running the emulator locally.

@lohmander Currently the topic does not get created automatically.
You are right this isn't well documented. Will let this issue open to track the docs improvement.
Thanks for the feedback.

@jonas-arkulpa Is this by design or something that could be supported moving forward?

Am I understanding the behavior right in that the subscribe(...) will also not create the topic if it doesn't exist?

I see that you documented it does not get created with publish(...) but it is unclear intention on subscribe(...)

Seems like a valuable behavior to be able to create topic/subscription if they do not already exist. Or at least allow this to be driven by an option parameter. I would be love to submit a PR with this behavior if needed.