Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AE95E200D11 for ; Mon, 2 Oct 2017 18:01:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ACC981609DE; Mon, 2 Oct 2017 16:01:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CB7A41609EF for ; Mon, 2 Oct 2017 18:01:37 +0200 (CEST) Received: (qmail 53197 invoked by uid 500); 2 Oct 2017 16:01:36 -0000 Mailing-List: contact user-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@beam.apache.org Delivered-To: mailing list user@beam.apache.org Received: (qmail 53187 invoked by uid 99); 2 Oct 2017 16:01:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2017 16:01:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0C62C181292 for ; Mon, 2 Oct 2017 16:01:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.679 X-Spam-Level: * X-Spam-Status: No, score=1.679 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ZZ-Is4hs-afo for ; Mon, 2 Oct 2017 16:01:34 +0000 (UTC) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DDD555FB4E for ; Mon, 2 Oct 2017 16:01:33 +0000 (UTC) Received: by mail-it0-f53.google.com with SMTP id 85so7908885ith.2 for ; Mon, 02 Oct 2017 09:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=57tPkwcfiJLvpmqL6Hj5f6tJ7lpHRvSeu3XpQUOU62I=; b=GGPExxcT75hM9j4PW59qpSaCoex/Im6ARw31cMFKiUwcDuNM59QiV63bBIcTk3+78P mC38m4UtzFtitHUESg0HsgloE6yZtC4nproxAO3me7xRMcL3Cbz8Gd4mb9mzwOuDChdL ytqvu6S/MWmVGRiJg6W9rm34woqpQoAPR6RG7Nfh4WFVTWZrLj+Gq0rT6GUK3r4cGx/C oWr/m6f7xzGSscttTAn1nLfZoLur6O11mk8lu/DmEl+JkiK1esGo73sTKlawcjndMRwr 1Ht7algyA79LNS9fs8nuMg2nUR0dYXMxoUVt2GrCnG99gR6GFsqJ1pBtMRF2Ik9zrnr7 M8Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=57tPkwcfiJLvpmqL6Hj5f6tJ7lpHRvSeu3XpQUOU62I=; b=N21HVMRCpCbB5m1ezDKp/dYr1V3hKMIlABaR7KFfEGUe7f0waC5bi1lKtO7bEX9zBl S5vKsW7LIjU1wfsJvIsyEKBkGBUHTdG6iVKT3Y4KqKiXLr27LUbA3Sji73iV7XGnUaBi KheX2INXN/JNW4xH9mK4ri0ES4Nog6IiACdmZOfvMTl5OXCnqS4599Dqp5TsvAL+Oj4/ SZHQQhEhH9kbUIbQHnLrtZWWmAkYJ44xHP3gPmBZ2hucRYlbXsjOxI2NLXM46R8LkelZ HY4LbAThMWu02H/nnAdJhdUE6jb8YUq90POsiJ6AMNc3wV6evVUWD4IRsPndoVauN0Jh nlrQ== X-Gm-Message-State: AHPjjUgR/b9Hp4hgZ1h7DrVNY9ESpz3DQZug/p0m2wguVeA3P0GQERUq CnbGlnR9Q2SqDN/gkij0jm9/0znNtSCk86ZIw/tbXcgD X-Google-Smtp-Source: AOwi7QAk+HNKaj3njucSUyMDTx+WqJroFwnAEfRR9yBeDX6/DRLeAP+n1i6IiJkkcQKly9guC58fEcKxdBxB58vJQqw= X-Received: by 10.36.34.20 with SMTP id o20mr19407516ito.11.1506960091259; Mon, 02 Oct 2017 09:01:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.76.212 with HTTP; Mon, 2 Oct 2017 09:01:10 -0700 (PDT) In-Reply-To: References: From: Derek Hao Hu Date: Mon, 2 Oct 2017 09:01:10 -0700 Message-ID: Subject: Re: How to get the PublishTime of PubsubMessages? To: user@beam.apache.org Content-Type: multipart/alternative; boundary="001a113f7a80ee2e99055a927c55" archived-at: Mon, 02 Oct 2017 16:01:38 -0000 --001a113f7a80ee2e99055a927c55 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Reinier! Is it easy to get the [MessageId]( http://googleapis.github.io/googleapis/java/proto-google-cloud-pubsub-v1/0.= 1.19/apidocs/com/google/pubsub/v1/PubsubMessage.html#getMessageId--) of the PubsubMessages? PS: If you are familiar with this part of the Beam implementation, can you also point out where it gets the timestamp attribute? I'm trying to understand the implementation as well. :) Cheers, Derek On Sat, Sep 30, 2017 at 5:58 AM, Reinier Kip wrote: > Hi Derek, > > > The publish time is the element's timestamp, retrievable via > DoFn.ProcessContext#timestamp, unless you've configured a timestamp > attribute with PubsubIO.Read#withTimestampAttribute. As far as I know, > payload, attributes and publish time is all you get. What other informati= on > from Google's PubsubMessage are you looking for? > > > Reinier > ------------------------------ > *From:* Derek Hao Hu > *Sent:* 30 September 2017 03:18:13 > *To:* user@beam.apache.org > *Subject:* How to get the PublishTime of PubsubMessages? > > Hi, > > =E2=80=8BI'm trying to use [PubsubIO](=E2=80=8Bhttps://beam.apache.org/do= cumentation/sdks/ > javadoc/2.1.0/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.html) to read > [PubsubMessage](https://beam.apache.org/documentation/sdks/ > javadoc/2.1.0/org/apache/beam/sdk/io/gcp/pubsub/PubsubMessage.html). > > I've noticed that the PubsubMessage class in Beam only exposes Attribute > and Payload but the [PubSubMessage in Google Cloud](http://googleapis. > github.io/googleapis/java/proto-google-cloud-pubsub-v1/ > 0.1.19/apidocs/com/google/pubsub/v1/PubsubMessage.html?is-external=3Dtrue= ) > exposes a lot more information like `getPublishTime()`. > > Is there a way for us to get the same amount information in Beam easily? > -- > Derek Hao Hu > > Software Engineer | Snapchat > Snap Inc. > --=20 Derek Hao Hu Software Engineer | Snapchat Snap Inc. --001a113f7a80ee2e99055a927c55 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

PS: If you are familiar with this part of the Beam implementation, can y= ou also point out where it gets the timestamp attribute? I'm trying to = understand the implementation as well. :)

Cheers,

Derek

On Sat, Sep 30, 2017 at 5:58 AM, Re= inier Kip <rkip@bol.com> wrote:

Hi Derek,


The publish time is the element's timestamp, retrievable via=C2=A0DoFn.ProcessContext#timestamp, unless you've configured= a timestamp attribute with=C2=A0PubsubIO.Read#withTimestampAttr= ibute. As far as I know, payload, attributes and publish time is all you get.=C2=A0What other information from Google's PubsubMessag= e=C2=A0are you looking for?


Reinier


From:= Derek Hao Hu <phoenixinter@gmail.com>
Sent: 30 September 2017 03:18:13
To: user@b= eam.apache.org
Subject: How to get the PublishTime of PubsubMessages?
=C2=A0
Hi,


I've n= oticed that the PubsubMessage class in Beam only exposes Attribute and Payl= oad but the [PubSubMessage in Google Cloud](http= ://googleapis.github.io/googleapis/java/proto-google-cloud-pubsub= -v1/0.1.19/apidocs/com/google/pubsub/v1/PubsubMessage.html?i= s-external=3Dtrue) exposes a lot more information like `getPublishTime()`.

Is there a= way for us to get the same amount information in Beam easily?
--
Derek Hao Hu

Software Engineer | Snapchat
Snap Inc.



--
Derek Hao Hu

Software Engineer | Sn= apchat
Snap Inc.
--001a113f7a80ee2e99055a927c55--