Skip to content

Exception when receiving Pub/Sub messages without attributes #170

Closed
@matthewrobertson

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"
}

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