dashbitco / broadway_cloud_pub_sub

A Broadway producer for Google Cloud Pub/Sub

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attributes don't seem to be passing through into metadata

Adzz opened this issue · comments

When I add a message to the pub sub queue, I can add attributes:

Screenshot 2019-09-09 at 18 59 59

But this is the message that I get through to handle_message/3

%Broadway.Message{
  acknowledger: {BroadwayCloudPubSub.GoogleApiClient,
   {BroadwayCloudPubSub.GoogleApiClient, #Reference<0.377512039.1466957828.121278>}, "REDACTED"},
  batch_key: :default,
  batch_mode: :bulk,
  batcher: :default,
  data: "MESSAGE",
  metadata: %{},
  status: :ok
}

I would expect that the attributes appear in the metadata field, but I could be wrong on that assumption...

@Adzz are you testing with your forked branch? Your pattern match for a string "data" param is then trying to take atom keys for the other fields. I'm assuming this is why you're not seeing any of the metadata, not just attributes. (See faded04#diff-aba84c6fefc1deabd03d66f245fc000bR148)

Can you please post at least partial output from running GoogleApi.PubSub.V1.Api.Projects.pubsub_projects_subscriptions_pull/5 for your subscription?

Related to #34 , the pull request should return a %GoogleApi.PubSub.V1.Model.PullResponse{} whose receivedMessages field should contain a list of %GoogleApi.PubSub.V1.Model.PubsubMessage{} structs.

If this is not the output you're receiving, I would file an issue on the API client repo: https://github.com/googleapis/elixir-google-api/

@mcrumm Oh of course, how stupid sorry! Thanks I'll close this issue in favour of the other one, which is the root cause here. Sorry for wasting your time on that

No worries! I just want to make sure we're tracking down the right issue.