Package org.frankframework.senders
Class ShadowSender
- All Implemented Interfaces:
ICacheEnabled<String,
,String> AdapterAware
,IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
Collection of Senders, that are executed all at the same time. Once the results are processed, all results will be sent to the resultSender,
while the original sender will return its result to the pipeline.
Multiple sub-senders can be configured within the ShadowSender, the minimum amount of senders is 2 (originalSender + resultSender)
- Since:
- 7.0
- Author:
- Niels Meijer
-
Field Summary
Fields inherited from class org.frankframework.senders.AbstractSenderWrapper
adapter, configurationMetrics, senderWrapperProcessor
Fields inherited from class org.frankframework.senders.AbstractSenderWithParameters
parameterNamesMustBeUnique, paramList
Fields inherited from class org.frankframework.senders.AbstractSender
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addResult
(SaxDocumentBuilder builder, ISender sender, Map<ISender, ParallelSenderExecutor> executorMap, String tagName) void
configure()
is called once at startup of the framework in the configure method of the owner of this sender.protected void
executeGuarded
(ISender sender, Message message, PipeLineSession session, Phaser guard, Map<ISender, ParallelSenderExecutor> executorMap) boolean
sendMessage
(Message message, PipeLineSession session) Override this from the parallel sender as it should only execute the original and shadowsenders here!void
setOriginalSender
(String senderName) Name of the sender that is considered that is considered to be the golden standard, i.e. the source of truth.void
setResultSender
(String senderName) The sender name which will process the resultsvoid
setWaitForShadowsToFinish
(boolean waitForShadowsToFinish) If settrue
the sender will wait for all shadows to have finished.Methods inherited from class org.frankframework.senders.ParallelSenders
addSender, createTaskExecutor, doSendMessage, getExecutor, getMaxConcurrentThreads, setMaxConcurrentThreads, setSynchronous
Methods inherited from class org.frankframework.senders.SenderSeries
consumesSessionVariable, getSenders, getStatisticsKeeper, isSenderConfigured, isSynchronous, setSender, start, stop
Methods inherited from class org.frankframework.senders.AbstractSenderWrapper
getCache, getGetInputFromFixedValue, getGetInputFromSessionKey, getStoreInputInSessionKey, getStoreResultInSessionKey, isPreserveInput, setAdapter, setCache, setConfigurationMetrics, setGetInputFromFixedValue, setGetInputFromSessionKey, setPreserveInput, setSenderWrapperProcessor, setStoreInputInSessionKey, setStoreResultInSessionKey
Methods inherited from class org.frankframework.senders.AbstractSenderWithParameters
addParameter, checkStringAttributeOrParameter, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueList
Methods inherited from class org.frankframework.senders.AbstractSender
createBean, getApplicationContext, getConfigurationClassLoader, getLogPrefix, getName, setApplicationContext, setName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.IConfigurationAware
getApplicationContext, getName
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.IScopeProvider
getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.ISender
sendMessageOrThrow
-
Constructor Details
-
ShadowSender
public ShadowSender()
-
-
Method Details
-
configure
Description copied from interface:ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender. Purpose of this method is to check whether the static configuration of the sender is correct. As much as possible class-instantiating should take place in theconfigure()
oropen()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classParallelSenders
- Throws:
ConfigurationException
-
validateExecutableSenders
- Throws:
ConfigurationException
-
executeGuarded
protected void executeGuarded(ISender sender, Message message, PipeLineSession session, Phaser guard, Map<ISender, ParallelSenderExecutor> executorMap) throws SenderException- Throws:
SenderException
-
sendMessage
@Nonnull public SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException Override this from the parallel sender as it should only execute the original and shadowsenders here!- Specified by:
sendMessage
in interfaceISender
- Overrides:
sendMessage
in classAbstractSenderWrapper
- Throws:
SenderException
TimeoutException
-
addResult
protected void addResult(SaxDocumentBuilder builder, ISender sender, Map<ISender, ParallelSenderExecutor> executorMap, String tagName) throws SAXException, IOException- Throws:
SAXException
IOException
-
setOriginalSender
Name of the sender that is considered that is considered to be the golden standard, i.e. the source of truth.- Default value
- the first sender specified
-
setResultSender
The sender name which will process the results- Default value
- the last sender specified
-
setWaitForShadowsToFinish
public void setWaitForShadowsToFinish(boolean waitForShadowsToFinish) If settrue
the sender will wait for all shadows to have finished. Otherwise the collection of results will happen in a background thread.- Default value
- false
-
getOriginalSenderName
-
getResultSenderName
-
getSecondarySenders
-
isWaitForShadowsToFinish
public boolean isWaitForShadowsToFinish()
-