Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Spring Team,
I'm a big fan of your work. I've recently made some projects with apache kafka and found your spring-kafka library very impressive. I thought a reactive entity approach to reading/writing the kafka topics can be a good new feature. Ealier I made a spring-kafka-extension library, now I thought, I create a PR.
Imagine that you have per Topic one KafkaEntity and you can read (consume) and write (produce) them performant, easily and reactive.
When enabling with
@EnableKafkaEntity
than it create automatic a Publisher, a Subscriber or a Processor to every KafkaEntity! All you need to do is to use the custom@KafkaEntity
,@KafkaEntityKey
,@KafkaEntityPublisher
,@KafkaEntitySubscriber
and@KafkaEntityProcessor
annotations!how to use:
enable KafkaEntity
define per topic a KafkaEntity
one class or record and mark with
@KafkaEntity
(mark a field with@KafkaEntityKey
)Topic name will be the name of the entity class with included packagename
but you can use custom Topic name like this
@KafkaEntity(customTopicName = "PRODUCT")
for example:
Topic name will be
net.csini.spring.kafka.entity.Student
Topic name will be
net.csini.spring.topic.Product
write data to a topic (produce)
in a Spring Bean just inject a KafkaEntitySubscriber (we assume, that City is as KafkaEntity defined)
default is
transactional=true
if you need the RecordMetadata from the Kafka Message than you can use KafkaEntityProcessor
in a Spring Bean just inject a KafkaEntityProcessor (we assume, that User is defined as a KafkaEntity)
default is
transactional=true
read data from a topic (consume)
in a Spring Bean just inject a KafkaEntityPublisher (we assume Place is defined as a KafkaEntity)