These are chat archives for arnaud-lb/php-rdkafka

3rd
Sep 2018
sonalithakkar
@sonalithakkar
Sep 03 2018 07:09
Hi all, I need to implement one producer and on topic with same message consumed by 2 consumer need code for same please help me ASAP
karavzeka
@karavzeka
Sep 03 2018 13:59
@sonalithakkar https://arnaud-lb.github.io/php-rdkafka/phpdoc/rdkafka.examples-producer.html - producer
https://arnaud-lb.github.io/php-rdkafka/phpdoc/rdkafka.examples-high-level-consumer.html - consumer
What way of consume do you suppose? You can consume in parallel (every message will be consumed twice) or you can consume consistently (first consumer retrieve one message, second consumer retrieve next, then first next etc.)
sonalithakkar
@sonalithakkar
Sep 03 2018 15:24
Consumer consume parallel. One message consumed by 2 consumer parallely
karavzeka
@karavzeka
Sep 03 2018 16:28

Ok. In consumer example you can see this code

$conf->set('group.id', 'myConsumerGroup');

If you set different group.id in your scripts they will work parallel.

Mathieu Pipet
@mpipet
Sep 03 2018 18:08
@sonalithakkar I strongly advise not to set anything in production if you do not know all kafka base concepts:
https://kafka.apache.org/quickstart
and / or
https://engineering.linkedin.com/distributed-systems/log-what-every-software-engineer-should-know-about-real-time-datas-unifying