TIL - April 25, 2025

By default, Google Cloud Pub/Sub Push Subscriptions deliver a message to a push endpoint as a Wrapped message in the following (abbrievated) format { "message": { "data": string, "messageId": string, "message_id": string, "publishTime": string, "publish_time": string }, "subscription": string } This is hidden in the Push Subscription documentation and not surfaced in the PubsubMessage reference documentation which shows the following format: { "data": string, "attributes": { string: string, ... }, "messageId": string, "publishTime": string, "orderingKey": string } I haven't verified, but I suspect that the configuration for choosing unwrapped messages is to Enable payload unwrapping Have you used Cloud Run with Pub/Sub and ran into this? Let me know in the comments.

Apr 26, 2025 - 07:04
 0
TIL - April 25, 2025

By default, Google Cloud Pub/Sub Push Subscriptions deliver a message to a push endpoint as a Wrapped message in the following (abbrievated) format

{
    "message": {
        "data": string,
        "messageId": string,
        "message_id": string,
        "publishTime": string,
        "publish_time": string
    },
    "subscription": string
}

This is hidden in the Push Subscription documentation and not surfaced in the PubsubMessage reference documentation which shows the following format:

{
  "data": string,
  "attributes": {
    string: string,
    ...
  },
  "messageId": string,
  "publishTime": string,
  "orderingKey": string
}

I haven't verified, but I suspect that the configuration for choosing unwrapped messages is to Enable payload unwrapping

Have you used Cloud Run with Pub/Sub and ran into this? Let me know in the comments.