Skip to content
Snippets Groups Projects
  1. Dec 20, 2020
    • Seok Won's avatar
      Java: Create Kafka Streams Twitter filter · ea219736
      Seok Won authored
      Run StreamsFilterTweets.java and TwitterProducerOptimized.java
      
      See result using:
      kafka-console-consumer --bootstrap-server localhost:9092 --topic famous-tweets
      
      Tweets that go into a topic named "twitter-tweets", will be filtered with a tweet that is posted by a user who has 10K followers and they will go into a topic named "famous-tweets"
      ea219736
  2. Dec 07, 2020
    • Seok Won's avatar
      Create Optimized Producer for Twitter · 42444e1b
      Seok Won authored
      + Create app.config to load twitter api tokens
      
      Safe + High throughput by using
      
      compression = snappy,
      linger ms = 20,
      batch size = 32 * 1024,
      acks = all,
      idempotence = true,
      retries = INT32_MAX
      max.in.flight = 5
      42444e1b
  3. Nov 30, 2020
    • Seok Won's avatar
      Update TwitterProducer to send data to kafka · 9b667d5a
      Seok Won authored
      Create a topic named "twitter-tweets" with below command,
      
      kafka-topics --zookeeper localhost:2181 --create --topic twitter-tweets --partitions 6 --replication-factor 1
      
      and run this application.
      9b667d5a
    • Seok Won's avatar
      Create TwitterProducer with just TwitterAPI · cebbd832
      Seok Won authored
      Next we will build kafka producer to send tweets to kafka.
      
      https://github.com/twitter/hbc
      cebbd832
    • Seok Won's avatar
      Create Consumer with Assign&Seek · 768e01ea
      Seok Won authored
      In this example, we read "first-topic", in partition 0, from offset 5 until offset becomes 10.
      
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Key: null, Value: five
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Partition:  0, Offset: 5
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Key: null, Value: Hello World!
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Partition:  0, Offset: 6
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Key: id_1, Value: Hello 1
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Partition:  0, Offset: 7
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Key: id_3, Value: Hello 3
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Partition:  0, Offset: 8
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Key: key_1, Value: world
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Partition:  0, Offset: 9
      [main] INFO csw.kafka.study.lesson2.ConsumerDemoAssignSeek - Exiting...
      768e01ea
    • Seok Won's avatar
      Create Consumer with a thread · 047cbae2
      Seok Won authored
      + python config updates for consumers
      
      + README updates
      047cbae2
    • Seok Won's avatar
      Create Simple Producer in Python · 3886280c
      Seok Won authored
      3886280c
  4. Nov 29, 2020
    • Seok Won's avatar
      Create Simple Consumer · c998f7bf
      Seok Won authored
      it reads all datas in three partitions from a topic named "first-topic".
      
      I sent datas in String, like "hello world".
      c998f7bf
  5. Nov 28, 2020
    • Seok Won's avatar
      Create Producer using key · 539ce491
      Seok Won authored
      At line 34, we added key parameter.
      
      Whenever we use same key when sending a data, same key always use same partition.
      
      i.e)
      i = 0, key = "truck_1" -> partition_0
      i = 1, key = "truck_1" -> partition_0
      ...
      539ce491
    • Seok Won's avatar
      Create Simple Producer with Callback function · a624b66d
      Seok Won authored
      for example,
      
      whenever we send a data, this callback function will execute.
      
      새 메타데이터
      Topic: first-topic
      Partition: 2
      Offset: 13
      Timestamp: 1606555474565
      a624b66d
    • Seok Won's avatar
      Kafka Producer · 55c9af5c
      Seok Won authored
      Send "Hello World!" string to topic named "first-topic".
      
      Producer sends a data to Consumer asynchronous, so we have to flush to see results right away.
      
      Execute below command to see "Hello World!"
      
      >> kafka-console-consumer --bootstrap-server localhost:9092 --topic first-topic --group group-one
      55c9af5c
Loading