Skip to content

Send events through Kafka when CRUDing on entities #81

@fdelbrayelle

Description

@fdelbrayelle
Overview of the feature request

When CRUDing on entities, it should send events in topics for given entities.

Maybe propose this by a prompt option?

This could be linked with #4 where consumer/producer would be created by hook when using jhipster entity Foo.

An event type could be send as a key when producing a message for instance:

byte[] key = "FOO_ENTITY_CREATION".getBytes();
byte[] value = "value".getBytes();
ProducerRecord<byte[],byte[]> record = new ProducerRecord<byte[],byte[]>("my-topic", key, value)
producer.send(record);

An enum could be generated with the different operations values (create, update, delete).

Motivation for or Use Case

Allowing the application to be event-driven.

Use case:

  1. Create a first JHipster application JH1 with a Foo entity, create a FooProducer.
  2. Create a first JHipster application JH2 with a Foo entity, create a FooConsumer.
  3. Create a Foo in the application.
  4. A creation event is send to the queuing.application_name.foo topic through FooProducer in JH1.
  5. The creation event is read in the queuing.application_name.foo topic by FooConsumer in JH2.

⚠️ On JH2 the entity could not be deserialized correctly because the entity doesn't have the same package on JH1 and JH2. Make a test with current deserialization mode or see #63 for deserialization alternatives (to be priorized ?).

Add support for akhq to be launched on multiple apps.

Related issues or PR

#4

  • Checking this box is mandatory (this is just to show you read everything)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions