Hi
I am using flink-connector-kafka-0. while producing i am getting error as java.lang. at org.apache.kafka.clients. at org.apache.flink.streaming. at org.apache.flink.streaming. how do i put timestamp in my object before producing ? Thanks Archit |
Hi Archit! You’ll need to assign timestamps to the records in your stream before producing them to Kafka (i.e. before the FlinkKafkaProducer operator). Have a look at [1] and [2] on how to do that. Feel free to ask further questions if you bump into any! Cheers, Gordon [1] https://ci.apache.org/projects/flink/flink-docs-release-1.2/dev/event_timestamps_watermarks.html On April 2, 2017 at 6:38:13 PM, Archit Mittal ([hidden email]) wrote:
|
Hi Gordon This is the function snippet i am using but i am getting invalid timestamp Properties properties = new Properties(); properties.setProperty("bootstrap.servers", "localhost:9092"); On Mon, Apr 3, 2017 at 8:20 AM, Tzu-Li (Gordon) Tai <[hidden email]> wrote:
|
Hi Archit, The problem is that you need to assign the returned `DataStream` from `stream.assignTimestampsAndWatermarks` to a separate variable, and use that when instantiating the Kafka 0.10 sink. The `assignTimestampsAndWatermarks` method returns a new `DataStream` instance with records that have assigned timestamps. Calling it does not affect the original `DataStream` instance. Gordon
On April 3, 2017 at 5:15:03 PM, Archit Mittal ([hidden email]) wrote:
|
Free forum by Nabble | Edit this page |