public class ProactorStreamProcessingStrategyFactory extends ReactorStreamProcessingStrategyFactory
ReactorProcessingStrategyFactory.ReactorProcessingStrategy instance that implements the proactor pattern by
de-multiplexing incoming events onto a single event-loop using a ring-buffer and then using using the
SchedulerService.cpuLightScheduler() to process these events from the ring-buffer. In contrast to the
ReactorStreamProcessingStrategy the proactor pattern treats ReactiveProcessor.ProcessingType.CPU_INTENSIVE and
ReactiveProcessor.ProcessingType.BLOCKING processors differently and schedules there execution on dedicated
SchedulerService.cpuIntensiveScheduler() and SchedulerService.ioScheduler() ()} schedulers.
This processing strategy is not suitable for transactional flows and will fail if used with an active transaction.| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractStreamProcessingStrategyFactory.AbstractStreamProcessingStrategy
Abstract
ProcessingStrategy to be used by implementations that de-multiplex incoming messages using a ring-buffer
which can then be subscribed to n times. |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE |
static int |
DEFAULT_SUBSCRIBER_COUNT |
static String |
DEFAULT_WAIT_STRATEGY |
protected static String |
RING_BUFFER_SCHEDULER_NAME_SUFFIX |
| Constructor and Description |
|---|
ProactorStreamProcessingStrategyFactory() |
| Modifier and Type | Method and Description |
|---|---|
ProcessingStrategy |
create(MuleContext muleContext,
String schedulersNamePrefix) |
protected int |
getBufferSize() |
protected int |
getSubscriberCount() |
protected String |
getWaitStrategy() |
void |
setBufferSize(int bufferSize)
Configure the size of the ring-buffer size used to buffer and de-multiplexes events from multiple source threads.
|
void |
setSubscriberCount(int subscriberCount)
Configure the number of ring-buffer subscribers.
|
void |
setWaitStrategy(String waitStrategy)
Configure the wait strategy used to wait for new events on ring-buffer.
|
getMaxConcurrency, setMaxConcurrencypublic static final int DEFAULT_BUFFER_SIZE
public static final int DEFAULT_SUBSCRIBER_COUNT
public static final String DEFAULT_WAIT_STRATEGY
protected static String RING_BUFFER_SCHEDULER_NAME_SUFFIX
public ProactorStreamProcessingStrategyFactory()
public ProcessingStrategy create(MuleContext muleContext, String schedulersNamePrefix)
create in interface ProcessingStrategyFactorycreate in class ReactorStreamProcessingStrategyFactoryProcessingStrategy.public void setBufferSize(int bufferSize)
bufferSize - buffer size to use.public void setSubscriberCount(int subscriberCount)
subscriberCount - public void setWaitStrategy(String waitStrategy)
waitStrategy - protected int getBufferSize()
protected int getSubscriberCount()
protected String getWaitStrategy()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.