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
{
"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.)
- Is this reasonable to always convert to the non-deprecated format? User's function might still depend on the deprecated format.
- Is there a way to distinguish CloudEvents for legacy pubsub/storage and CloudEvents for normal pubsub/storage?
cc: @grant @jskeet
When converting CloudEvents to legacy events, a legacy pubsub CloudEvent has
typeattribute"google.cloud.pubsub.topic.v1.messagePublished". This can be converted to a legacy eventeventTypeasgoogle.pubsub.topic.publishproviders/cloud.pubsub/eventTypes/topic.publish(deprecated).Similarly, the CloudEvent
sourceattribute e.g.//pubsub.googleapis.com/projects/sample-project/topics/gcf-testcan be converted into a legacy eventresourceasprojects/sample-project/topics/gcf-test(deprecated).(This is also the case for legacy storage events.)
cc: @grant @jskeet