title: How to extract Google PubSub publish time in Apache Beam
body: <p>My goal is to be able to access PubSub message Publish Time as recorded and set by Google PubSub in Apache Beam (Dataflow).</p>
  
  <pre><code>    PCollection&lt;PubsubMessage&gt; pubsubMsg
              = pipeline.apply("Read Messages From PubSub",
              PubsubIO.readMessagesWithAttributes()
                  .fromSubscription(pocOptions.getInputSubscription()));
  </code></pre>
  
  <p>Does not seem to contain one as an attribute.
  I have tried </p>
  
  <pre><code> .withTimestampAttribute("publish_time")
  </code></pre>
  
  <p>No luck either. What am I missing? Is it possible to extract Google PubSub publish time in dataflow?</p>