Repository navigation
PubSub emulator exhibiting failures with Subscription JSON payload #2199
Description
Activity
- addedapi: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.
on Jun 28, 2017 Hi @bilisie, one interesting feature of your request is that you are essentially specifying the name of the subscription to be created twice; that is first in the URL, and second in the request body as "name". Moreover, the two values differ in your example curl command (although I'm assuming that's a copy-paste error).
You are actually correct that it's not considered an error for the value to be specified twice (I just verified this by testing against the live service - the specification is a bit ambiguous about this, see https://github.com/googleapis/googleapis/blob/master/google/api/http.proto#L206), so the emulator behavior is indeed different, and we should fix that. However, note that the name specified in the request body is being ignored. You can try using a different value against the live system as a test; you should see that the name of the subscription that is created comes from the URL.
Thanks for reporting this, BTW.
Hi @hbchai
Thanks for the update. I've added better reproduction of the issue here:
https://github.com/bilisie/pubsub-emulator-issueRemoving the name from the URL breaks the integration tests against real PubSub as I've tested earlier. I can also try removing it from the payload or leaving it the URL to see if that satisfied both the emulator and prod.
The subscription name definitely needs to be specified in the URL. Please do try removing it from the payload.
garrettjonesgoogle commented
on Jul 17, 2017 ContributorMore actionsThis isn't an issue in google-cloud-java, and it looks like there is a workaround, so I am going to close it out now.
- added 2 commits that reference this issue
on Feb 20, 2026 - added a commit that references this issue
on Jul 13, 2026
Hi,
I'm testing an emulator locally using a json payload as such:
On the emulator side the following stack trace is being produced:
The pattern of usage of using json payloads does function properly against real endpoints.