Skip to content

Commit

Permalink
all topics
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Gorzala committed Dec 27, 2023
1 parent dfe0889 commit 571c502
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public void handle(ProfileUpdatedEvent profileUpdatedEvent) {
eventCreator.createEventlog(
"profile-updated",
profileUpdatedEvent.getDancer()));
scheduleMessagePort.schedule(
profileUpdatedEvent,
profileUpdatedEvent.getDancer().getId().toString(),
BACKEND_SOURCE,
"profile-updated");
scheduleMessagePort.schedule(
profileUpdatedEvent,
profileUpdatedEvent.getDancer().getId().toString(),
BACKEND_SOURCE,
"profile-updated");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.dancier.dancer.authentication.model.Role;
import net.dancier.dancer.core.ScheduleMessagePort;
import net.dancier.dancer.core.exception.ApplicationException;
import net.dancier.dancer.core.exception.BusinessException;
Expand Down Expand Up @@ -39,6 +38,11 @@ public class EventlogService {
EventlogConfig.of("navigated_to_page", NO_SPECIAL_ROLE_NEEDED),
EventlogConfig.of("human_session_created", AT_LEAST_HUMAN),
EventlogConfig.of("contact_message_sent", AT_LEAST_HUMAN),

EventlogConfig.of("app-instance-id-created", NO_SPECIAL_ROLE_NEEDED),
EventlogConfig.of("navigated-to-page", NO_SPECIAL_ROLE_NEEDED),
EventlogConfig.of("human-session-created", AT_LEAST_HUMAN),
EventlogConfig.of("contact-message-sent", AT_LEAST_HUMAN),
EventlogConfig.of("profile-updated", DEFAULT_AUTHENTICATED) // will not go over the eventlog stuff in the future...
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@
public class TopicConfiguration {
@Bean
public KafkaAdmin.NewTopics createTopics() {

NewTopic profileUpdated = new NewTopic("profile-updated", 1, (short) 1);
NewTopic appInstanceIdCreated = new NewTopic("app-instance-id-created", 1, (short) 1);
NewTopic navigatedToPage = new NewTopic("navigated-to-page", 1, (short) 1);
NewTopic humanSessionCreated = new NewTopic("human-session-created", 1, (short) 1);
NewTopic contactMessageSent = new NewTopic("contact-message-sent", 1, (short) 1);

return new KafkaAdmin.NewTopics(profileUpdated, appInstanceIdCreated);
return new KafkaAdmin.NewTopics(
profileUpdated,
appInstanceIdCreated,
navigatedToPage,
humanSessionCreated,
contactMessageSent);
}

}

0 comments on commit 571c502

Please sign in to comment.