Skip to content

Commit

Permalink
fix: add @primary annotation to HandlerRegistry bean
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresFelipe11 committed Jan 7, 2025
1 parent f712bf8 commit 6ae5e30
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {{package}}.events.handlers.QueriesHandler;
import org.reactivecommons.async.api.HandlerRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
{{/eda}}
{{#eda}}
import {{package}}.events.handlers.CommandsHandler;
Expand All @@ -14,12 +15,14 @@ import {{package}}.events.handlers.QueriesHandler;
import org.reactivecommons.async.api.HandlerRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
{{/eda}}

@Configuration
public class HandlerRegistryConfiguration {
// see more at: https://reactivecommons.org/reactive-commons-java/#_handlerregistry_2
@Primary
@Bean
public HandlerRegistry handlerRegistry(CommandsHandler commands, EventsHandler events, QueriesHandler queries) {
{{#eda}}
Expand Down

0 comments on commit 6ae5e30

Please sign in to comment.