Skip to content
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

KafkaMessage is deprecated use KafkaRecord instead #115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

agoncal
Copy link

@agoncal agoncal commented Sep 23, 2020

io.smallrye.reactive.messaging.kafka.KafkaMessage is marked as deprecated linking to io.smallrye.reactive.messaging.kafka.KafkaRecord

`io.smallrye.reactive.messaging.kafka.KafkaMessage` is marked as deprecated linking to `io.smallrye.reactive.messaging.kafka.KafkaRecord`
@eclipse-microprofile-bot
Copy link
Contributor

Can one of the admins verify this patch?

@Azquelt
Copy link
Member

Azquelt commented Sep 23, 2020

I think that KafkaMessage in this part of the spec is given as a hypothetical connector provided class, rather than a reference to any specific class in a particular implementation, so I'm not sure it's necessary to change it.

In addition, I think that leaving the name as KafkaMessage makes it more obvious that it's a subclass of Message

@agoncal
Copy link
Author

agoncal commented Sep 23, 2020

I should have been more precise in the issue, sorry. There are several references of KafkaMessage in the documentation. So it's a bit more work than just renaming KafkaMessage to KafkaRecord. KafkaMessage is actually used in several pieces of code, which means changing the all the code to KafkaRecord.

@Azquelt if KafkaMessage refers to a "hypothetical connector provided class, rather than a reference to any specific class" then why not renaming "KafkaMessage" with just "Kafka Message" or "Kafka Message" (in italic). KafkaMessage reads as code, don't you think?

@Azquelt
Copy link
Member

Azquelt commented Sep 23, 2020

why not renaming "KafkaMessage" with just "Kafka Message" or "Kafka Message" (in italic). KafkaMessage reads as code, don't you think?

Yes, it's an example class name, so it's formatted as a class name and used in the code example.

Certainly the wording could be improved so that it's clearer that KafkaMessage is given as an example of a class which a connector could provide, rather than a class which implementers of the spec are required to provide or which users can expect to exist in all implementations.

For example, the OpenLiberty implementation has a Kafka connector, but does not provide any specialized Message class (instead it allows users to call Message.unwrap(ConsumerRecord.class) to get the underlying ConsumerRecord instance from the Kafka API)

@danielkec
Copy link
Contributor

The spec wording makes it quite clear that it is an example:

However, the user may decide to consume a specific subclass of Message (e.g. KafkaMessage in the following example)

@Emily-Jiang
Copy link
Member

Maybe we edit the spec to say MyMessage to make it clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants