Fix local development with Pub/Sub emulator#272
Merged
matthewrobertson merged 3 commits intomasterfrom Apr 20, 2021
Merged
Conversation
73a896c to
008a9d0
Compare
matthewrobertson
commented
Apr 7, 2021
008a9d0 to
0149bb6
Compare
grant
suggested changes
Apr 16, 2021
Contributor
grant
left a comment
There was a problem hiding this comment.
Thanks!
Do you mind adding a little more detailed description in the PR for how you tested this locally?
For example, I don't see the use of PUBSUB_EMULATOR_HOST in the PR here. Some light instructions for how a user can test this manually would help. Even better would be to update the docs we have on this content with the new setup.
grant
approved these changes
Apr 19, 2021
Contributor
grant
left a comment
There was a problem hiding this comment.
Main concern is the middleware for all raw Pub/Sub requests. o.w. lgtm
matthewrobertson
added a commit
to GoogleCloudPlatform/functions-framework-java
that referenced
this pull request
Jun 28, 2021
Currently, the functions frameworks are dependent on some private dataplane event marshalling logic in order to correctly pass PubSub events to background functions. This commit implements the same marshalling logic in the FF in order to enable local development using the PubSub emulator. We have already made this change in other languages: GoogleCloudPlatform/functions-framework-nodejs#272 GoogleCloudPlatform/functions-framework-ruby#100 GoogleCloudPlatform/functions-framework-python#121 GoogleCloudPlatform/functions-framework-go#70
matthewrobertson
added a commit
to GoogleCloudPlatform/functions-framework-java
that referenced
this pull request
Jun 28, 2021
Currently, the functions frameworks are dependent on some private dataplane event marshalling logic in order to correctly pass PubSub events to background functions. This commit implements the same marshalling logic in the FF in order to enable local development using the PubSub emulator. We have already made this change in other languages: GoogleCloudPlatform/functions-framework-nodejs#272 GoogleCloudPlatform/functions-framework-ruby#100 GoogleCloudPlatform/functions-framework-python#121 GoogleCloudPlatform/functions-framework-go#70
matthewrobertson
added a commit
to GoogleCloudPlatform/functions-framework-java
that referenced
this pull request
Jun 30, 2021
Currently, the functions frameworks are dependent on some private dataplane event marshalling logic in order to correctly pass PubSub events to background functions. This commit implements the same marshalling logic in the FF in order to enable local development using the PubSub emulator. We have already made this change in other languages: GoogleCloudPlatform/functions-framework-nodejs#272 GoogleCloudPlatform/functions-framework-ruby#100 GoogleCloudPlatform/functions-framework-python#121 GoogleCloudPlatform/functions-framework-go#70
matthewrobertson
added a commit
to GoogleCloudPlatform/functions-framework-java
that referenced
this pull request
Jul 2, 2021
Currently, the functions frameworks are dependent on some private dataplane event marshalling logic in order to correctly pass PubSub events to background functions. This commit implements the same marshalling logic in the FF in order to enable local development using the PubSub emulator. We have already made this change in other languages: GoogleCloudPlatform/functions-framework-nodejs#272 GoogleCloudPlatform/functions-framework-ruby#100 GoogleCloudPlatform/functions-framework-python#121 GoogleCloudPlatform/functions-framework-go#70
matthewrobertson
added a commit
to GoogleCloudPlatform/functions-framework-java
that referenced
this pull request
Jul 7, 2021
* unblock local development with the pubsub emulator Currently, the functions frameworks are dependent on some private dataplane event marshalling logic in order to correctly pass PubSub events to background functions. This commit implements the same marshalling logic in the FF in order to enable local development using the PubSub emulator. We have already made this change in other languages: GoogleCloudPlatform/functions-framework-nodejs#272 GoogleCloudPlatform/functions-framework-ruby#100 GoogleCloudPlatform/functions-framework-python#121 GoogleCloudPlatform/functions-framework-go#70 * fix code style issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, deploying a function with
--trigger-topiccreates a Pub/Sub subscription that delivers events to an internal endpoint that marshals request payloads before forwarding them to a user's function. Unfortunately, this breaks local development with the Pub/Sub emulator as the Functions Frameworks are dependent on this request marshalling logic.In order to better support local development and testing with the Pub/Sub emulator, this commit introduces the event marshalling logic to the Functions Framework via express middleware that is enable when the
PUBSUB_EMULATOR_HOSTis set.fixes #41, fixes #96