[
https://issues.apache.org/jira/browse/BEAM-3489?focusedWorklogId=288636&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-288636
]
ASF GitHub Bot logged work on BEAM-3489:
----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Aug/19 23:48
Start Date: 04/Aug/19 23:48
Worklog Time Spent: 10m
Work Description: thinhha commented on issue #8370: [BEAM-3489] add
PubSub messageId in PubsubMessage
URL: https://github.com/apache/beam/pull/8370#issuecomment-518045772
Hi @lukecwik, looks like the non-messageId coders are hard-coded in
`PubsubUnboundedSource`:
Line 1088 of
`beam/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubUnboundedSource.java`:
```
@Override
public Coder<PubsubMessage> getOutputCoder() {
return outer.getNeedsAttributes()
? PubsubMessageWithAttributesCoder.of()
: PubsubMessagePayloadOnlyCoder.of();
}
```
This means that while the PubsubMessage is created with the messageId field
populated when using
`PubsubIO.readMessagesWithMessageId()`/`PubsubIO.readMessagesWithAttributesAndMessageId()`
, this field does not show up in the subsequent step.
Looks like `setNeedsAttributes` is a required field. I'm not sure how to
change `getOutputCoder()`
without breaking something.
How do you think this case can be handled?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 288636)
Time Spent: 6h 20m (was: 6h 10m)
> Expose the message id of received messages within PubsubMessage
> ---------------------------------------------------------------
>
> Key: BEAM-3489
> URL: https://issues.apache.org/jira/browse/BEAM-3489
> Project: Beam
> Issue Type: New Feature
> Components: io-java-gcp
> Reporter: Luke Cwik
> Assignee: Thinh Ha
> Priority: Minor
> Labels: newbie, starter
> Time Spent: 6h 20m
> Remaining Estimate: 0h
>
> This task is about passing forward the message id from the pubsub proto to
> the java PubsubMessage.
> Add a message id field to PubsubMessage.
> Update the coder for PubsubMessage to encode the message id.
> Update the translation from the Pubsub proto message to the Dataflow message:
> https://github.com/apache/beam/blob/2e275264b21db45787833502e5e42907b05e28b8/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubUnboundedSource.java#L976
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)