2006, 2019

Kafka 05: Kafka Consumer with ElasticSearch

By |June 20th, 2019|Categories: Technology|

Pre Configure 1. Register Bonsai: 2. Increase maximum limit: (We will demostrate batch process, so 1000 is really easy to fulfil) [crayon-5e31732686cb7697576653/] 3. Install Maven dependency [crayon-5e31732686cbf802614313/]     The Real Code 1. Setup ElasticSearch Client [crayon-5e31732686cc2805494744/] 2. Create a Kafka Consumer [crayon-5e31732686cc6863934108/] 3. Post records from Kafka into ElasticSearch (Bonsai) [crayon-5e31732686cd5737446543/]   Consumer Offset Commit Strategy Things about at [...]

1706, 2019

PHP xDebug with Docker

By |June 17th, 2019|Categories: Technology|

Single PC with Remote Debug   Step 1: Install xDebug in remote web server.  Step 2: Modify xdebug.ini (or php.ini) [crayon-5e3173268728b942139295/] Step 3: Setup PHPStorm setup File -> Settings -> Languages & Frameworks -> PHP -> CLI Interpreter -> ... -> + from Docker (one project should be Frontend, one project is Backend, they are separate.) setup File -> Settings -> Languages & Frameworks -> PHP -> Debug. [...]

1206, 2019

Kafka 04: Producer Configurations

By |June 12th, 2019|Categories: Technology|Tags: |

Overview The overview of our TwitterProducer config. [crayon-5e31732687834298326062/]     About acks [crayon-5e3173268783e926093898/] acks = 0 no response is required if the broker goes offline, we will lose data useful for data where it's ok to lose: metrics, log collection. acks = 1 leader response is requested. no replication is required. the producer may retry, if ack from leader is not received if [...]

1106, 2019

Kafka 03: Twitter Producer (Java)

By |June 11th, 2019|Categories: Technology|Tags: |

Setup Twitter Developer Account and Create an App link: You need to give good reason and detail your app description.     Get Dependencies link: [crayon-5e31732688117692847432/] Create New Producer and Consumer Step 1: Overview [crayon-5e31732688120353809708/] Step 2: Create a Twitter Client [crayon-5e31732688123170494197/] Step 3: Create a Kafka Producer [crayon-5e31732688125303404872/] Step 4: Create a Topic [crayon-5e31732688128506186325/] [...]

2705, 2019

Kafka 02: Install and CLI

By |May 27th, 2019|Categories: Technology|Tags: |

Install Download and unzip unzip and unzip paste under C:\ Create a folder data under kafka's root dir. Create two folders: kafka and zookeeper under data folder. Change properties: config\ dataDir=C:/kafka_2.12-2.2.0/data/zookeeper config\ log.dirs=C:/kafka_2.12-2.2.0/data/kafka   Launch Kafka Add environment PATH: C:\kafka_2.12-2.2.0\bin\windows Launch Zookeeper FIRST, then start Kafka: zookeeper-server-start.bat  config\ kafka-server-start.bat  config\ kafka-topics 1. Create C:\kafka_2.12-2.2.0>kafka-topics --zookeeper [...]

2205, 2019

Kafka 01: The Theory

By |May 22nd, 2019|Categories: Technology|Tags: |

Topics, Partitions and Offsets Topics: A particular stream of data. Similar to a table in a database. You can have as many topics as you want. It is identified by name Partitions: It splits a topic. Each partition is ordered. When you create a topic, you have to define how many partitions you want. Offset: Within a partition, each message gets an auto incremental id. It's infinite. Offset only [...]