[MODNOTES-295] Kafka producer foundation + Note create events#373
Open
Saba-Zedginidze-EPAM wants to merge 8 commits into
Open
[MODNOTES-295] Kafka producer foundation + Note create events#373Saba-Zedginidze-EPAM wants to merge 8 commits into
Saba-Zedginidze-EPAM wants to merge 8 commits into
Conversation
Saba-Zedginidze-EPAM
requested review from
Aliaksandr-Fedasiuk,
psmagin and
viacheslavkol
July 20, 2026 11:35
Saba-Zedginidze-EPAM
force-pushed
the
MODNOTES-295
branch
from
July 20, 2026 11:37
5fc506a to
8f5400b
Compare
SerhiiNosko
reviewed
Jul 20, 2026
SerhiiNosko
approved these changes
Jul 20, 2026
Saba-Zedginidze-EPAM
force-pushed
the
MODNOTES-295
branch
from
July 20, 2026 14:51
b9c6990 to
1c855b4
Compare
|
psmagin
requested changes
Jul 21, 2026
Comment on lines
+81
to
+95
| kafka-topic-init: | ||
| image: apache/kafka:latest | ||
| depends_on: | ||
| - kafka | ||
| environment: | ||
| KAFKA_HOST: kafka | ||
| KAFKA_PORT: 9093 | ||
| ENV: ${ENV} | ||
| TENANTS: ${KAFKA_INIT_TENANTS} | ||
| KAFKA_TOPIC_PARTITIONS: ${KAFKA_TOPIC_PARTITIONS} | ||
| volumes: | ||
| - ./kafka-init.sh:/usr/bin/kafka-init.sh | ||
| entrypoint: ["bash", "/usr/bin/kafka-init.sh"] | ||
| networks: | ||
| - mod-notes-local |
Collaborator
There was a problem hiding this comment.
Don't think this is needed as mod-notes doesn't consume any topic, so no external topics should be created. Topic for produce will be created during enabling tenant in the module.
Comment on lines
+44
to
+53
| public void publish(UUID id, DomainEvent<Note> event) { | ||
| var topic = topicName(); | ||
| try { | ||
| log.debug("publish:: sending Note event [topic: {}, id: {}, type: {}]", topic, id, event.getType()); | ||
| kafkaTemplate.send(topic, id, event); | ||
| log.info("publish:: Note event sent [topic: {}, id: {}, type: {}]", topic, id, event.getType()); | ||
| } catch (Exception e) { | ||
| log.error("publish:: failed to send Note event [topic: {}, id: {}, type: {}]", topic, id, event.getType(), e); | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Kafka message must have headers.
| log.info("createNote:: created note by title: {}, domain: {}, type: {}", | ||
| note.getTitle(), note.getDomain(), note.getType()); | ||
| return notesMapper.toDto(entity); | ||
| Note newSnapshot = notesMapper.toDto(entity); |
Comment on lines
+51
to
+53
| kafka: | ||
| topics: | ||
| note: notes.note |
Collaborator
There was a problem hiding this comment.
Not see place where the topic is created.
| import tools.jackson.databind.JsonNode; | ||
|
|
||
| @DisplayName("Note create domain events") | ||
| class NoteDomainEventIT extends TestApiBase { |
Collaborator
There was a problem hiding this comment.
I don't think that separate test class is needed. It could be included in existed IT class.
Collaborator
|
Also please fix sonar issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Purpose
[MODNOTES-295] Kafka producer foundation + Note create events
Approach
Changes Checklist
Screenshots (if applicable)