-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKafkaProducerBuilderInterface.php
68 lines (56 loc) · 1.7 KB
/
KafkaProducerBuilderInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
declare(strict_types=1);
namespace PhpKafka\Producer;
use PhpKafka\Message\Encoder\EncoderInterface;
interface KafkaProducerBuilderInterface
{
/**
* @return KafkaProducerInterface
*/
public function build(): KafkaProducerInterface;
/**
* @return KafkaProducerBuilderInterface
*/
public static function create(): self;
/**
* @param string $broker
* @return KafkaProducerBuilderInterface
*/
public function withAdditionalBroker(string $broker): self;
/**
* @param string[] $config
* @return KafkaProducerBuilderInterface
*/
public function withAdditionalConfig(array $config): self;
/**
* @param callable $deliveryReportCallback
* @return KafkaProducerBuilderInterface
*/
public function withDeliveryReportCallback(callable $deliveryReportCallback): self;
/**
* @param callable $errorCallback
* @return KafkaProducerBuilderInterface
*/
public function withErrorCallback(callable $errorCallback): self;
/**
* Callback for log related events
*
* @param callable $logCallback
* @return KafkaProducerBuilderInterface
*/
public function withLogCallback(callable $logCallback): self;
/**
* Callback for OAuth Bearer Token refresh
*
* @param callable $oauthBearerCallback
* @return KafkaProducerBuilderInterface
*/
public function withOAuthBearerTokenRefreshCallback(callable $oauthBearerCallback): self;
/**
* Lets you set a custom encoder for produce message
*
* @param EncoderInterface $encoder
* @return KafkaProducerBuilderInterface
*/
public function withEncoder(EncoderInterface $encoder): self;
}