Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6f56d4a

Browse files
committed
improve cb
1 parent fdc5f8d commit 6f56d4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/ext-php-rdkafka/pure-php/producer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// This callback processes the delivery reports from the broker
2323
// you can see if your message was truly sent, this can be especially of importance if you poll async
2424
$conf->setDrMsgCb(function (Producer $kafka, Message $message) {
25-
if ($message->err) {
25+
if (RD_KAFKA_RESP_ERR_NO_ERROR !== $message->err) {
2626
$errorStr = rd_kafka_err2str($message->err);
2727

2828
echo sprintf('Message FAILED (%s, %s) to send with payload => %s', $message->err, $errorStr, $message->payload) . PHP_EOL;

‎src/ext-php-rdkafka/pure-php/producer_transactional.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function echoTransactionError(KafkaErrorException $e) {
5656
// This callback processes the delivery reports from the broker
5757
// you can see if your message was truly sent
5858
$conf->setDrMsgCb(function (Producer $kafka, Message $message) {
59-
if ($message->err) {
59+
if (RD_KAFKA_RESP_ERR_NO_ERROR !== $message->err) {
6060
$errorStr = rd_kafka_err2str($message->err);
6161

6262
echo sprintf('Message FAILED (%s, %s) to send with payload => %s', $message->err, $errorStr, $message->payload) . PHP_EOL;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /