-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
google-cloudevents-dart #581
Comments
I want to run dart on Cloud Run and be able to respond to the Google Cloud Event sent by Eventarc on Firestore events. I generated all the dart protos after running this Now my dart server is deserializing the envelope message ( A Dart SDK would be an absolute game changer for me, but for now I'm just going to have to do this myself. |
@a-wallen - what proto are you using? I think you want document written event from here: https://github.com/googleapis/google-cloudevents/blob/main/proto%2Fgoogle%2Fevents%2Fcloud%2Ffirestore%2Fv1%2Fevents.proto Have you checked the cloud run headers received to verify the correct proto is being used? |
@nohe427 thanks for the help - you'd think that the Firestore Envelope would be the correct proto to deserialize with, but it looks like Eventarc sends a Datastore Envelope instead. here's the headers in my Cloud Run logs
plus the payload (base64 encoded so that I can paste it here)
The serialization is all wrong similar to this issue where the entire payload is just an unknown field. Let me come up with a repro |
I couldn't quite get it to reproduce the same way that it was with my hello world message
but this is the gist of what I have so far. https://github.com/a-wallen/firestore_triggers_cloud_run_protobuf |
@a-wallen - What event are you using in eventarc / cloudrun? I used google.cloud.firestore.document.v1.written event in mine and when I deserialize the body to a proto it works. Is there a guide you are following? Here is a screenshot from my cloud run instance to get the event type. And then I used DocumentEventData proto. Can you try calling this instead? |
@a-wallen - To me, it looks like the issue is the event type. I remember having issues with that event and switched to the one I referenced in my above comment. |
🥇@nohe427 that worked. For some reason, this still doesn't work when I try to debug it locally with Postman though 🤷♂️ |
@a-wallen - Sorry, I am unfamiliar with using Postman for debugging. I would double check that you are sending the right headers and that you are sending the raw binary data (I saw you encode it to base64, are you remembering to decode it when you send it?) |
Thanks for your help @nohe427 - I will be working on a barebones package for this https://pub.dev/packages/google_cloudevents_dart |
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I am interested in getting a
google-cloudevents-dart
repo. It appears that there is already a compiled events library that exists for golang, java, and kotlin. I would like to see one for dart.Describe the solution you'd like
A clear and concise description of what you want to happen.
All protobufs compiled for dartlang.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Compiling these myself, but that feels like it takes a lot longer than I would like.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: