Add new decorator to pass a received GCP PubSub message received object to a handler function
Description
Add new decorator to the library to validate and parse a PubSub MessagePublishedData event and return the data in the message.data to the handler function as its original binary.
Further details
This decorator should live under a pubsub_messages module, and be called message_handler (or check current name in the draft MR and use that).
The handler should have access to the lower level CloudEvent and MessagePublishedData objects - see original MR.
Task list
Acceptance criteria
-
Added decorator to extract data from a MessagePublishedData payload and pass as binary to the handler function -
On errors these should be logged and a 400response sent to caller
Links/references
Edited by Mike Knee