Skip to content

Commit

Permalink
handle events in ordered serial fashion
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Nov 25, 2024
1 parent 1d372f3 commit 9caa89a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/cryostat/rules/RuleService.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void onStop(@Observes ShutdownEvent evt) throws SchedulerException {
quartz.shutdown();
}

@ConsumeEvent(value = Target.TARGET_JVM_DISCOVERY, blocking = true)
@ConsumeEvent(value = Target.TARGET_JVM_DISCOVERY, blocking = true, ordered = true)
void onMessage(TargetDiscovery event) {
switch (event.kind()) {
case MODIFIED:
Expand Down Expand Up @@ -123,7 +123,7 @@ void onMessage(TargetDiscovery event) {
}
}

@ConsumeEvent(value = Rule.RULE_ADDRESS, blocking = true)
@ConsumeEvent(value = Rule.RULE_ADDRESS, blocking = true, ordered = true)
@Transactional
public void handleRuleModification(RuleEvent event) {
Rule rule = event.rule();
Expand All @@ -148,7 +148,7 @@ public void handleRuleModification(RuleEvent event) {
}
}

@ConsumeEvent(value = Rule.RULE_ADDRESS + "?clean", blocking = true)
@ConsumeEvent(value = Rule.RULE_ADDRESS + "?clean", blocking = true, ordered = true)
@Transactional
public void handleRuleRecordingCleanup(Rule rule) {
cancelTasksForRule(rule);
Expand Down

0 comments on commit 9caa89a

Please sign in to comment.