Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Mautsch committed Jul 6, 2024
1 parent 9da7268 commit 75af0b0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.goafabric.eventdispatcher.consumer.kafka;
package org.goafabric.eventdispatcher.consumer;

import org.goafabric.eventdispatcher.producer.EventData;
import org.slf4j.Logger;
Expand All @@ -14,6 +14,11 @@ public class CalendarConsumer {

static final String CONSUMER_NAME = "Calendar";

public CalendarConsumer(NatsSubscription natsSubscription) {
natsSubscription.create(CONSUMER_NAME, "patient.*", (msg, eventData) -> process(msg.getSubject(), eventData));
natsSubscription.create(CONSUMER_NAME, "practitioner.*", (msg, eventData) -> process(msg.getSubject(), eventData));
}

@KafkaListener(groupId = CONSUMER_NAME, topics = {"patient", "practitioner"})
public void processKafka(@Header(KafkaHeaders.RECEIVED_KEY) String key, EventData eventData) {
process(key, eventData);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.goafabric.eventdispatcher.consumer.kafka;
package org.goafabric.eventdispatcher.consumer;

import org.goafabric.eventdispatcher.producer.EventData;
import org.goafabric.eventdispatcher.service.extensions.TenantContext;
Expand All @@ -15,6 +15,10 @@ public class LoggerConsumer {

static final String CONSUMER_NAME = "Logger";

public LoggerConsumer(NatsSubscription natsSubscription) {
natsSubscription.create(CONSUMER_NAME, "*.*", (msg, eventData) -> process(msg.getSubject(), eventData));
}

@KafkaListener(groupId = CONSUMER_NAME, topicPattern = ".*")
public void processKafka(@Header(KafkaHeaders.RECEIVED_KEY) String key, EventData eventData) {
process(key, eventData);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.goafabric.eventdispatcher.consumer.nats;
package org.goafabric.eventdispatcher.consumer;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.cbor.CBORFactory;
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 75af0b0

Please sign in to comment.