Skip to content

Exception when receiving Pub/Sub messages without attributes #170

Description

@matthewrobertson

Our handling of "raw" Pub/Sub events assumes there will always be data.message.attributes here. This is the case when using the Pub/Sub emulator. It is not necessarily the case when integrating with the GCP Pub/Sub service and so an exception is thrown.

Here is a sample payload sent by Pub/Sub:

{
    "message": {
        "data": "ZGFzZmRzYWZkYXNm",
        "messageId": "3390469820526936",
        "message_id": "3390469820526936",
        "orderingKey": "2",
        "publishTime": "2021-11-16T19:21:09.107Z",
        "publish_time": "2021-11-16T19:21:09.107Z"
    },
    "subscription": "projects/matts-clean-test-project/subscriptions/message-ordering-subscription"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions