processingGroup )) .sequencingPolicy(sequencingPolicy(processingGroup)) .build()); });
@Before public void setUp() { tokenStore = spy(new InMemoryTokenStore()); mockHandler = mock(EventMessageHandler.class); when(mockHandler.canHandle(any())).thenReturn(true); eventHandlerInvoker = SimpleEventHandlerInvoker.builder() .eventHandlers(singletonList(mockHandler)) .sequencingPolicy(event -> { if (event instanceof DomainEventMessage) { return ((DomainEventMessage) event) .getSequenceNumber(); } return event.getIdentifier(); }) .build(); eventBus = EmbeddedEventStore.builder().storageEngine(new InMemoryEventStorageEngine()).build(); // A processor config, with a policy which guarantees segmenting by using the sequence number. configureProcessor(TrackingEventProcessorConfiguration.forParallelProcessing(2)); }
processingGroup )) .sequencingPolicy(sequencingPolicy(processingGroup)) .build()); });