@Override public void configureModule(Configurer configurer) { configurer.registerComponent(AxonServerConfiguration.class, c -> new AxonServerConfiguration()); configurer.registerComponent(AxonServerConnectionManager.class, c -> buildAxonServerConnectionManager(c)); configurer.configureEventStore(this::buildEventStore); configurer.configureCommandBus(this::buildCommandBus); configurer.configureQueryBus(this::buildQueryBus); configurer.registerModule(new EventProcessorInfoConfiguration()); configurer.registerComponent(TokenStore.class, c -> { logger.warn("BEWARE! Falling back to an in-memory token store. It is highly recommended to configure a " + "persistent implementation, based on the activity of the handler."); return new InMemoryTokenStore(); }); }
@Before public void setUp() { EventStore eventStore = spy(EmbeddedEventStore.builder() .storageEngine(new InMemoryEventStorageEngine()) .build()); Configurer configurer = DefaultConfigurer.defaultConfiguration(); configurer.eventProcessing() .usingSubscribingEventProcessors() .registerSaga(MySaga.class); configuration = configurer.configureEventStore(c -> eventStore) .configureAggregate(MyAggregate.class) .registerComponent(DeadlineManager.class, this::buildDeadlineManager) .start(); published = new CopyOnWriteArrayList<>(); configuration.eventBus().subscribe(msgs -> msgs.forEach(msg -> published.add(msg.getPayload()))); }
@Override public void configureModule(Configurer configurer) { configurer.registerComponent(AxonServerConfiguration.class, c -> new AxonServerConfiguration()); configurer.registerComponent(AxonServerConnectionManager.class, c -> buildAxonServerConnectionManager(c)); configurer.configureEventStore(this::buildEventStore); configurer.configureCommandBus(this::buildCommandBus); configurer.configureQueryBus(this::buildQueryBus); configurer.registerModule(new EventProcessorInfoConfiguration()); configurer.registerComponent(TokenStore.class, c -> { logger.warn("BEWARE! Falling back to an in-memory token store. It is highly recommended to configure a " + "persistent implementation, based on the activity of the handler."); return new InMemoryTokenStore(); }); }
DefaultConfigurer.defaultConfiguration() .configureCommandBus(conf -> commandBus) .configureEventStore(conf -> eventStore) .configureAggregate(User.class) .configureAggregate(Company.class)