Skip to content

Commit

Permalink
kafka changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Mautsch committed Jul 5, 2024
1 parent ca10763 commit ca345af
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=org.goafabric
version=3.3.1-SNAPSHOT
version=3.3.1-kafka-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ public class CalendarConsumer {

static final String CONSUMER_NAME = "Calendar";

@KafkaListener(groupId = CONSUMER_NAME, topics = "main.topic")
public void processKafka(@Header(KafkaHeaders.RECEIVED_KEY) String key, EventData eventData) {
@KafkaListener(groupId = CONSUMER_NAME,
topics = {"patient.create", "patient.update", "preactitioner.create", "practitioner.update"})
public void processKafka(@Header(KafkaHeaders.RECEIVED_TOPIC) String key, EventData eventData) {
process(key, eventData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class LoggerConsumer {

static final String CONSUMER_NAME = "Logger";

@KafkaListener(groupId = CONSUMER_NAME, topics = "main.topic")
public void processKafka(@Header(KafkaHeaders.RECEIVED_KEY) String key, EventData eventData) {
@KafkaListener(groupId = CONSUMER_NAME, topicPattern = ".*\\..*")
public void processKafka(@Header(KafkaHeaders.RECEIVED_TOPIC) String key, EventData eventData) {
process(key, eventData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void produce(ChangeEvent changeEvent) {
}

private void send(String key, String referenceId) {
kafkaTemplate.send("main.topic", key, new EventData(referenceId));
kafkaTemplate.send(key, new EventData(referenceId));
}

}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ nats:
server: "localhost:4222"

#enable kafka or rabbitmq
spring.profiles.active: nats #kafka
spring.profiles.active: kafka #kafka

#logging
logging.pattern.level: "%5p tenantId=%X{tenantId:-}"
Expand Down

0 comments on commit ca345af

Please sign in to comment.