Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

PubsubMessage readed form PubsubIO have no attributes #629

Open
chikien276 opened this issue Apr 3, 2018 · 1 comment
Open

PubsubMessage readed form PubsubIO have no attributes #629

chikien276 opened this issue Apr 3, 2018 · 1 comment

Comments

@chikien276
Copy link

chikien276 commented Apr 3, 2018

Dataflow SDK version: 2.4.0
I haven't tested with other attribute but when we use these attribute for de-duplication and timestaming we got null PubsubMessage's attribute
For example

PubsubIO.readMessages()
                        .fromSubscription("mine")
                        .withIdAttribute("id"))
                .apply("name hehe", ParDo.of(new DoFn<PubsubMessage, String>() {

                    @ProcessElement
                    public void processElement(ProcessContext c) {
                        PubsubMessage message = c.element();
                        c.output(new String(message.getPayload(), Charset.forName("UTF-8"))

                                + " id: " + message.getAttribute("id")); // id will be null here
                    }
                }))

same with .withTimestampAttribute(str)

@sx5640
Copy link

sx5640 commented Nov 7, 2018

Has this problem been resolved?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants