org.axonframework.config.DefaultConfigurer Java Examples

The following examples show how to use org.axonframework.config.DefaultConfigurer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AxonManualApplication.java    From spring-5-examples with MIT License 6 votes vote down vote up
@SneakyThrows
public static void disabledMain(String[] args) {

  final Configuration configuration = DefaultConfigurer.defaultConfiguration()
                                                       .configureAggregate(Entrance.class)
                                                       .configureAggregate(Guest.class)
                                                       .configureEmbeddedEventStore(c -> new InMemoryEventStorageEngine())
                                                       .configureCommandBus(c -> new AsynchronousCommandBus())
                                                       .buildConfiguration();

  configuration.start();

  final CommandBus commandBus = configuration.commandBus();

  commandBus.dispatch(asCommandMessage(new RegisterEntranceCommand("main")));
  commandBus.dispatch(asCommandMessage(new UnlockEntranceCommand("main")));
  commandBus.dispatch(asCommandMessage(new UnregisterEntranceCommand("main")) );

  TimeUnit.SECONDS.sleep(1L);
}
 
Example #2
Source File: KafkaPublisherTest.java    From extension-kafka with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    this.configurer = DefaultConfigurer.defaultConfiguration();
    this.eventBus = SimpleEventBus.builder().build();
    this.monitor = new MessageCollector();
    this.configurer.configureEventBus(configuration -> eventBus);
    this.consumerFactory = transactionalConsumerFactory(kafkaBroker, ByteArrayDeserializer.class);
    this.testConsumer = mock(Consumer.class);
}