Bug #78332 [Fbk->NoF]: Int in JSON message formatted as string
| From: | pecl-dev at lists dot php dot net | Date: | Sun, 20 Dec 2020 04:22:15 +0000 |
| Subject: | Bug #78332 [Fbk->NoF]: Int in JSON message formatted as string | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-17121@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78332&edit=1
ID: 78332
Updated by: pecl-dev@lists.php.net
Reported by: fi at facelift-bbt dot com
Summary: Int in JSON message formatted as string
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: PECL
PHP Version: 7.2.20
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2020-12-07 12:33:33] cmb@php.net
Is this still an issue with latest rdkafka and any of the actively
supported PHP versions[1]? If so, you may be better off to report
that as issue on the Github repo[2].
[1] <https://www.php.net/supported-versions.php>
[2] <https://github.com/arnaud-lb/php-rdkafka>
------------------------------------------------------------------------
[2019-07-25 06:43:27] fi at facelift-bbt dot com
Serializing and deserializing in PHP works well, yes.
But after processing the serialized JSON object with the Kafka producer and reading the message in a
consumer written in Java, the int field has been transformed into a string - before deserializing.
------------------------------------------------------------------------
[2019-07-24 15:58:12] cmb@php.net
This is about https://pecl.php.net/package/rdkafka.
------------------------------------------------------------------------
[2019-07-24 15:24:41] danack@php.net
Hi - the script you provided does not run, https://3v4l.org/XUMYj . It gives the error Fatal error: Uncaught
Error: Class 'RdKafka\Producer' not found in /in/XUMYj:5
Running json_decode simply as you described it gives: https://3v4l.org/2VPX6 which appears to give an int.
You might find reading this http://sscce.org/ helpful as a guide on
how to write a self-contained reproduce case.
------------------------------------------------------------------------
[2019-07-24 14:14:54] fi at facelift-bbt dot com
Test script:
---------------
<?php
$message = '{"id":1639}';
$producer = new RdKafka\Producer();
$topic = $producer->newTopic('myTopic');
$topic->produce(RD_KAFKA_PARTITION_UA, 0, $message);
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=78332
--
Edit this bug report at https://bugs.php.net/bug.php?id=78332&edit=1