Skip to content

CloudEvents to legacy events mapping for legacy pubsub and legacy storage events. #56

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

Open
hdp617 opened this issue Nov 21, 2020 · 1 comment

Comments

@hdp617
Copy link
Contributor

hdp617 commented Nov 21, 2020

When converting CloudEvents to legacy events, a legacy pubsub CloudEvent has type attribute "google.cloud.pubsub.topic.v1.messagePublished". This can be converted to a legacy event eventType as

  • google.pubsub.topic.publish
  • providers/cloud.pubsub/eventTypes/topic.publish (deprecated).

Similarly, the CloudEvent source attribute e.g. //pubsub.googleapis.com/projects/sample-project/topics/gcf-test can be converted into a legacy event resource as

  • structured format:
{
        "service":"pubsub.googleapis.com",
        "name":"projects/sample-project/topics/gcf-test",
        "type":"type.googleapis.com/google.pubsub.v1.PubsubMessage"
}
  • raw path: projects/sample-project/topics/gcf-test (deprecated).

(This is also the case for legacy storage events.)

  1. Is this reasonable to always convert to the non-deprecated format? User's function might still depend on the deprecated format.
  2. Is there a way to distinguish CloudEvents for legacy pubsub/storage and CloudEvents for normal pubsub/storage?

cc: @grant @jskeet

@jskeet
Copy link
Member

jskeet commented Nov 23, 2020

The legacy Storage events won't be supported as CloudEvents, as far as I'm aware.

For the legacy PubSub messages - I don't know whether there's any way of detecting that we're "expecting" the legacy event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants