This may deserve an issue against the Cloud Pub/Sub service. But so far the GCP support isn't really helpful so I am posting this issue here.
According to here, the Pubsub message should have a messageId property, whether it's from pull or push.
So I am trying to see what the message looks like: (event here is the pubsub message pushed to the cloud function)
exports.my_cloud_function = (event) => {
logger.debug(`Event: ${util.inspect(event)}`);
}
What I expected:
{ '@type': 'type.googleapis.com/google.pubsub.v1.PubsubMessage', messageId:'111111111', publishTime: 'Oct 1st 2019, xxxx', attributes: { key1: 'value1', key2: 'value2' }, data: 'eLCJ=(some base 64)' }
What actually is:
{ '@type': 'type.googleapis.com/google.pubsub.v1.PubsubMessage', attributes: { key1: 'value1', key2: 'value2' }, data: 'eLCJ=(some base 64)' }