You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 19:00:55 UTC

[GitHub] [beam] damccorm opened a new issue, #20686: Specify the event time when consuming pubsub data.

damccorm opened a new issue, #20686:
URL: https://github.com/apache/beam/issues/20686

   I need to specify the event time when consuming pubsub data.
   ```
   
   PCollection<PubsubMessage> pubsubMessages = pipeline.apply("Read Pub/Sub Data",
          PubsubIO.readMessagesWithAttributes()
   
                  .withTimestampAttribute(options.getTimeAttribute())
                   .fromSubscription(options.getInputSubscription()));
   
   ```
   
   The only way to do this is to use the {color:#ff0000}withTimestampAttribute(){color} method.
   
   But if  I use a timestamp in some other format, such as a 19-bit nanosecond, or if save the event time in the payload. The method won't work !
   
   So I had to extend the PubsubClient class and override the PubsubClient. extractTimestamp() method.
   
   I'am hoping to provide a way to pass in some implementation class that would allow to parse out timestamp from the current pubsub message.
   
    
   
   My beam version is 2.19.0.
   
    
   
    
   
    
   
   Imported from Jira [BEAM-10926](https://issues.apache.org/jira/browse/BEAM-10926). Original Jira may contain additional context.
   Reported by: j.zheng.


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org