Package org.frankframework.senders
Class ShadowSender
- All Implemented Interfaces:
ICacheEnabled<String,,String> FrankElement,HasApplicationContext,HasName,IConfigurable,IScopeProvider,ISender,ISenderWithParameters,IWithParameters,NameAware,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle
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
configurationMetrics, senderWrapperProcessorFields inherited from class org.frankframework.senders.AbstractSenderWithParameters
parameterNamesMustBeUnique, paramListFields inherited from class org.frankframework.senders.AbstractSender
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddResult(SaxDocumentBuilder builder, ISender sender, Map<ISender, ParallelSenderExecutor> executorMap, String tagName) voidConfigure this component.protected voidexecuteGuarded(ISender sender, Message message, PipeLineSession session, Phaser guard, Map<ISender, ParallelSenderExecutor> executorMap) sendMessage(Message message, PipeLineSession session) Override this from the parallel sender as it should only execute the original and shadowsenders here!voidsetOriginalSender(String senderName) Name of the sender that is considered that is considered to be the golden standard, i.e. the source of truth.voidsetResultSender(String senderName) The sender name which will process the resultsvoidsetWaitForShadowsToFinish(boolean waitForShadowsToFinish) Iftruethe sender will wait for all shadows to have finished.Methods inherited from class org.frankframework.senders.ParallelSenders
addSender, createTaskExecutor, doSendMessage, setMaxConcurrentThreads, setSynchronousMethods inherited from class org.frankframework.senders.SenderSeries
consumesSessionVariable, getSenders, getStatisticsKeeper, isSenderConfigured, setSender, start, stopMethods inherited from class org.frankframework.senders.AbstractSenderWrapper
setGetInputFromFixedValue, setGetInputFromSessionKey, setName, setPreserveInput, setStoreInputInSessionKey, setStoreResultInSessionKeyMethods inherited from class org.frankframework.senders.AbstractSenderWithParameters
addParameter, checkStringAttributeOrParameter, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueListMethods inherited from class org.frankframework.senders.AbstractSender
createBean, getLogPrefix, getName, isRunning, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.cache.ICacheEnabled
getCache, setCacheMethods inherited from interface org.frankframework.core.ISender
isSynchronous, sendMessageOrThrow
-
Constructor Details
-
ShadowSender
public ShadowSender()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classParallelSenders- Throws:
ConfigurationException- in case it was not able to configure the component.
-
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:
sendMessagein interfaceISender- Overrides:
sendMessagein classAbstractSenderWrapper- Throws:
SenderExceptionTimeoutException
-
addResult
protected void addResult(SaxDocumentBuilder builder, ISender sender, Map<ISender, ParallelSenderExecutor> executorMap, String tagName) throws SAXException, IOException- Throws:
SAXExceptionIOException
-
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) Iftruethe sender will wait for all shadows to have finished. Otherwise the collection of results will happen in a background thread.- Default value
- false
-