GistTree.Com
Entertainment at it's peak. The news is by your side.

Saturday? What a Day for Beer, Apache Kafka, PHP and Swoole

0

🎸 Just a couple of fun with Kafka, PHP and Swoole.

Requirements

Instructions

Kafka

  • Download it from https://kafka.apache.org/downloads
  • Extract to /kafka
    • take a look at -f kafka/bin/kafka-server-launch.sh && echo OK (will absorb to level-headed print OK).

Delivery the services

  • kafka/bin/zookeeper-server-launch.sh kafka/config/zookeeper.properties
  • kafka/bin/kafka-server-launch.sh kafka/config/server.properties

Invent a topic topic

  • kafka/bin/kafka-themes.sh --accomplish --topic my-topic --bootstrap-server localhost: 9092
    • Created topic my-topic. will absorb to level-headed be the response

PHP

Whenever you happen to would not absorb Swoole already:

  • pecl install swoole

Install dependencies

Mainly https://github.com/easy-swoole/kafka

  • composer install

Delivery the actual person

  • php particular person.php

Let’s play!

Write some events

  • kafka/bin/kafka-console-producer.sh --topic my-topic --bootstrap-server localhost: 9092

Then factual style some messages to the stdin. Press Ctrl+C to discontinue.

Screenshot 01

A PHP producer

Just checkout producer.php.

Screenshot 02

Let’s Rock

Easy

Screenshot 03

Screenshot 04

Medium

Screenshot 05

Laborious

Screenshot 06

Basically, I’m not particular if right here is rocking. Whenever you happen to’ve got a factual methodology to benchmark a particular person, please self-discipline me.

Read More

Leave A Reply

Your email address will not be published.