Class PoolingMessageSplitterService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,EventHandlerAware
,MessageEventGenerator
,Service
,ServiceWrapper
,StateManagedComponent
AdvancedMessageSplitterService
that uses a underlying thread and object pool to execute the service on each
split message.
Note that using this splitter may mean that messages become un-ordered; if the order of the split messages is critical, then you
probably shouldn't use this service. Additionally, individual split-message failures will only be reported on after all the split
messages have been processed, so unlike AdvancedMessageSplitterService
; MessageSplitterServiceImp.setIgnoreSplitMessageFailures(Boolean)
will not halt the processing of the subsequent split messages
In the adapter configuration file this class is aliased as pooling-message-splitter-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.services.splitter.AdvancedMessageSplitterService
eventHandler
Fields inherited from class com.adaptris.core.services.splitter.MessageSplitterServiceImp
KEY_CURRENT_SPLIT_MESSAGE_COUNT, KEY_SPLIT_MESSAGE_COUNT
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Set the max number of threads to operate on split messagesActively check if the underlying object pool is ready to accept more workers.Specify if the underlying object pool should be warmed up onstart()
.protected void
handleSplitMessage
(AdaptrisMessage msg, Consumer<Exception> callback) protected void
void
setMaxThreads
(Integer maxThreads) Set the max number of threads to operate on split messagesvoid
setWaitWhileBusy
(Boolean waitWhileBusy) Actively check if the underlying object pool is ready to accept more workers.void
setWarmStart
(Boolean warmStart) Specify if the underlying object pool should be warmed up onstart()
.void
start()
Starts the component.protected void
waitQuietly
(Object monitor) Methods inherited from class com.adaptris.core.services.splitter.AdvancedMessageSplitterService
executeService, getSendEvents, getService, prepare, registerEventHandler, sendEvents, sendEvents, setSendEvents, setService, stop, wrappedServices
Methods inherited from class com.adaptris.core.services.splitter.MessageSplitterServiceImp
doService, getIgnoreSplitMessageFailures, getSplitter, ignoreSplitMessageFailures, setIgnoreSplitMessageFailures, setSplitter, waitForCompletion
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, doService, isBranching, setUniqueId
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
Constructor Details
-
PoolingMessageSplitterService
public PoolingMessageSplitterService()
-
-
Method Details
-
handleSplitMessage
protected void handleSplitMessage(AdaptrisMessage msg, Consumer<Exception> callback) throws ServiceException - Overrides:
handleSplitMessage
in classAdvancedMessageSplitterService
- Throws:
ServiceException
-
initService
- Overrides:
initService
in classAdvancedMessageSplitterService
- Throws:
CoreException
-
start
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Overrides:
start
in classAdvancedMessageSplitterService
- Throws:
CoreException
- wrapping any underlyingException
s- See Also:
-
closeService
protected void closeService()- Overrides:
closeService
in classAdvancedMessageSplitterService
-
withWarmStart
-
withMaxThreads
-
withWaitWhileBusy
-
waitQuietly
-
getMaxThreads
Set the max number of threads to operate on split messagesThe default is 10 if not explicitly specified
-
setMaxThreads
Set the max number of threads to operate on split messagesThe default is 10 if not explicitly specified
-
getWarmStart
Specify if the underlying object pool should be warmed up onstart()
.The default is false if not specified
-
setWarmStart
Specify if the underlying object pool should be warmed up onstart()
.The default is false if not specified
-
getWaitWhileBusy
Actively check if the underlying object pool is ready to accept more workers.If set to true, then we check that the underlying object pool has enough space for us to submit more jobs. This means that if you have a large number of split messages, then we don't attempt to flood the queue with thousands of messages causing possible issues within constrained environments. It defaults to false if not explicitly specified, and if set to true will have a small negative impact on performance.
-
setWaitWhileBusy
Actively check if the underlying object pool is ready to accept more workers.If set to true, then we check that the underlying object pool has enough space for us to submit more jobs. This means that if you have a large number of split messages, then we don't attempt to flood the queue with thousands of messages causing possible issues within constrained environments. It defaults to false if not explicitly specified, and if set to true will have a small negative impact on performance.
-