Skip to content

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

@hdp617

Description

@hdp617

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions