Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Exception when receiving Pub/Sub messages without attributes #170

Closed
matthewrobertson opened this issue Nov 17, 2021 · 0 comments · Fixed by #187
Closed

Exception when receiving Pub/Sub messages without attributes #170

matthewrobertson opened this issue Nov 17, 2021 · 0 comments · Fixed by #187
Labels
bug Something isn't working

Comments

@matthewrobertson
Copy link
Member

matthewrobertson commented Nov 17, 2021

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"
}
@matthewrobertson matthewrobertson added the bug Something isn't working label Nov 17, 2021
anniefu added a commit that referenced this issue May 18, 2022
…tes in them (#187)

* Handle when attributes not present

Co-authored-by: Annie Fu <16651409+anniefu@users.noreply.github.com>
@anniefu anniefu closed this as completed Jun 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants