Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 443 Bytes

5-publishing-to-kafka.md

File metadata and controls

18 lines (14 loc) · 443 Bytes
title weight
Publishing to kafka
5

After configuring all your message options, you must use the send method, to send the message to kafka.

use Junges\Kafka\Facades\Kafka;

/** @var \Junges\Kafka\Producers\ProducerBuilder $producer */
$producer = Kafka::publishOn('topic')
    ->withConfigOptions(['key' => 'value'])
    ->withKafkaKey('kafka-key')
    ->withHeaders(['header-key' => 'header-value']);

$producer->send();