google cloud dataflow - can I get "event-time" from meta-data? -


greeting developers,

know dataflow(df) can event-time i/o (like pubsub), , can assign "event-time" data. but, can attribute value data?

understanding, can input timestamp(processing-time) data, not event-time.

q1: can event-time data ?

q2: if can, how ?

thanks helping :d

to timestamp of element in dofn, can call processcontext.timestamp(). set timestamp of element according own application logic, can use context.outputwithtimestamp().

like so:

@override public void processelement(processcontext c) {   // generate timestamp falls somewhere in 2 hours after event time.   long randmillis = (long) (math.random() * duration.standardhours(2).getmillis());   instant randomtimestamp = c.timestamp().plus(randmillis);   c.outputwithtimestamp(c.element(), new instant(randomtimestamp)); } 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -