-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should KafkaProducerMessage & KafkaConsumerMessage extend AbstractMessage? #64
Comments
Heya, can you elaborate a bit more, sry i am not sure that i am following. |
I mean right now they are defined as public function __construct(
string $topicName,
int $partition,
int $offset,
int $timestamp,
$key,
$body,
?array $headers
) { I thought both of them should be |
body for sure is mixed, it can be anything ( |
Aren't they all persisted as nullable string in Kafka? |
Only in the PHP implementation (at least from what i know), in Java you are able to send an int and other types as well. |
Even if it is handled as string internally, you can have an avro encoded key, which can have any structure ( |
Again thx for the input, i quickly tested this out and yeah i can send an array (avro) as key, so we should open even more and make |
What is the reason of extending both of
KafkaProducerMessage
andKafkaConsumerMessage
from theAbstractKafkaMessage
?I might be wrong, but it looks like we cannot make
$key
and$body
parameters of theKafkaConsumerMessage::__construct
method strictly typed because we don't know what type of value could be passed toKafkaProducerMessage
, but inKafkaConsumerMessage
we are always getting a strings.The text was updated successfully, but these errors were encountered: