/** * Initialize a configuration for a Saga of given {@code sagaType}, using a Tracking Event Processor to process * incoming Events. Note that a Token Store should be configured in the global configuration, or the Saga Manager * will default to an in-memory token store, which is not recommended for production environments. * * @param sagaType The type of Saga to handle events with * @param <S> The type of Saga configured in this configuration * @return a SagaConfiguration instance, ready for further configuration */ public static <S> SagaConfiguration<S> trackingSagaManager(Class<S> sagaType) { return trackingSagaManager(sagaType, Configuration::eventBus); }
/** * Initialize a configuration for a Saga of given {@code sagaType}, using a Tracking Event Processor (with provided * name) to process incoming Events. Note that a Token Store should be configured in the global configuration, or * the Saga Manager will default to an in-memory token store, which is not recommended for production environments. * * @param sagaType The type of Saga to handle events with * @param processingGroup The name of the processing group to be used for this saga * @param <S> The type of Saga configured in this configuration * @return a SagaConfiguration instance, ready for further configuration */ public static <S> SagaConfiguration<S> trackingSagaManager(Class<S> sagaType, String processingGroup) { return trackingSagaManager(sagaType, processingGroup, Configuration::eventBus); }
@Bean public SagaConfiguration<SellTradeManagerSaga> sellTradeSagaConfiguration() { return SagaConfiguration.trackingSagaManager(SellTradeManagerSaga.class); } }
@Bean public SagaConfiguration<BuyTradeManagerSaga> buyTradeSagaConfiguration() { return SagaConfiguration.trackingSagaManager(BuyTradeManagerSaga.class); }
@Bean public SagaConfiguration bankTransferManagementSagaConfiguration() { return SagaConfiguration.trackingSagaManager(BankTransferManagementSaga.class); }