Search in sources :

Example 1 with WorkQueueProcessingStrategy

use of org.mule.runtime.core.internal.processor.strategy.WorkQueueProcessingStrategyFactory.WorkQueueProcessingStrategy in project mule by mulesoft.

the class WorkQueueProcessingStrategyTestCase method rejectedExecution.

@Test
@Description("If IO pool is busy OVERLOAD error is thrown")
public void rejectedExecution() throws Exception {
    flow = flowBuilder.get().processors(blockingProcessor).processingStrategyFactory((context, prefix) -> new WorkQueueProcessingStrategy(() -> new RejectingScheduler(blocking))).build();
    flow.initialise();
    flow.start();
    expectRejected();
    processFlow(testEvent());
}
Also used : WorkQueueProcessingStrategy(org.mule.runtime.core.internal.processor.strategy.WorkQueueProcessingStrategyFactory.WorkQueueProcessingStrategy) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 2 with WorkQueueProcessingStrategy

use of org.mule.runtime.core.internal.processor.strategy.WorkQueueProcessingStrategyFactory.WorkQueueProcessingStrategy in project mule by mulesoft.

the class WorkQueueProcessingStrategyTestCase method blockingRejectedExecution.

@Test
@Description("If IO pool is busy OVERLOAD error is thrown")
public void blockingRejectedExecution() throws Exception {
    Scheduler blockingSchedulerSpy = spy(blocking);
    Scheduler rejectingSchedulerSpy = spy(new RejectingScheduler(blockingSchedulerSpy));
    flow = flowBuilder.get().processors(blockingProcessor).processingStrategyFactory((context, prefix) -> new WorkQueueProcessingStrategy(() -> rejectingSchedulerSpy)).build();
    flow.initialise();
    flow.start();
    expectRejected();
    processFlow(testEvent());
}
Also used : WorkQueueProcessingStrategy(org.mule.runtime.core.internal.processor.strategy.WorkQueueProcessingStrategyFactory.WorkQueueProcessingStrategy) Scheduler(org.mule.runtime.api.scheduler.Scheduler) Description(io.qameta.allure.Description) Test(org.junit.Test)

Aggregations

Description (io.qameta.allure.Description)2 Test (org.junit.Test)2 WorkQueueProcessingStrategy (org.mule.runtime.core.internal.processor.strategy.WorkQueueProcessingStrategyFactory.WorkQueueProcessingStrategy)2 Scheduler (org.mule.runtime.api.scheduler.Scheduler)1