@SupportsOutputStreaming public class MessageSendingPipe extends StreamingPipe implements HasSender, HasStatistics
sender
and optionally receives a reply from the same sender, or
from a listener
.ISenderWithParameters
Modifier and Type | Class and Description |
---|---|
static class |
MessageSendingPipe.LinkMethod |
HasStatistics.Action
Modifier and Type | Field and Description |
---|---|
static String |
INPUT_VALIDATOR_NAME_PREFIX |
static String |
INPUT_VALIDATOR_NAME_SUFFIX |
static String |
INPUT_WRAPPER_NAME_PREFIX |
static String |
INPUT_WRAPPER_NAME_SUFFIX |
static int |
MAX_RETRY_INTERVAL |
static String |
MESSAGE_LOG_NAME_PREFIX |
static String |
MESSAGE_LOG_NAME_SUFFIX |
static int |
MIN_RETRY_INTERVAL |
protected org.apache.logging.log4j.Logger |
msgLog |
static String |
OUTPUT_VALIDATOR_NAME_PREFIX |
static String |
OUTPUT_VALIDATOR_NAME_SUFFIX |
static String |
OUTPUT_WRAPPER_NAME_PREFIX |
static String |
OUTPUT_WRAPPER_NAME_SUFFIX |
static String |
PIPE_CLEAR_TIMEOUT_MONITOR_EVENT |
static String |
PIPE_EXCEPTION_MONITOR_EVENT |
static String |
PIPE_TIMEOUT_MONITOR_EVENT |
AUTOMATIC_STREAMING
parameterNamesMustBeUnique
log
LONG_DURATION_MONITORING_EVENT, MESSAGE_SIZE_MONITORING_EVENT, PIPE_EXCEPTION_MONITORING_EVENT
Constructor and Description |
---|
MessageSendingPipe() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canProvideOutputStream()
returns true when:
a) the pipe might be able to accept an input by providing an OutputStream, and
b) there are no side effects configured that prevent handing over its PipeRunResult to the calling pipe (e.g.
|
protected boolean |
canStreamToNextPipe()
called if the pipe implementation requests an OutputStream, to determine if there are side effects configured
that require the output of this pipe to be available at the return of the doPipe() method.
|
void |
configure()
checks for correct configuration of forward
|
boolean |
consumesSessionVariable(String sessionKey)
returns
true if the pipe or one of its children use the named session variable. |
PipeRunResult |
doPipe(Message input,
PipeLineSession session)
This is where the action takes place.
|
boolean |
hasSizeStatistics() |
int |
increaseRetryIntervalAndWait(PipeLineSession session,
int retryInterval,
String description) |
void |
iterateOverStatistics(StatisticsKeeperIterationHandler hski,
Object data,
HasStatistics.Action action) |
protected void |
preserve(Message input)
Call
Message.preserve() so it can be consumed multiple times, and wrap potential IOException
in a PipeRunException . |
protected void |
propagateName() |
protected MessageOutputStream |
provideOutputStream(PipeLineSession session)
provide the outputstream, or null if a stream cannot be provided.
|
protected PipeRunResult |
sendMessage(Message input,
PipeLineSession session,
ISender sender,
Map<String,Object> threadContext) |
void |
setAuditTrailNamespaceDefs(String auditTrailNamespaceDefs)
Namespace defintions for auditTrailXPath.
|
void |
setAuditTrailSessionKey(String string)
Key of a PipelineSession-variable.
|
void |
setAuditTrailXPath(String string)
XPath expression to extract audit trail from message
|
void |
setCheckRootTag(String s)
If set, besides the XML Well-Formedness the root element of the result is checked to be equal to the value set
|
void |
setCheckXmlWellFormed(boolean b)
If set
true , the XML Well-Formedness of the result is checked |
void |
setCorrelationIDNamespaceDefs(String correlationIDNamespaceDefs)
Namespace defintions for correlationIDXPath.
|
void |
setCorrelationIDSessionKey(String string)
Key of a PipelineSession-variable.
|
void |
setCorrelationIDStyleSheet(String string)
Stylesheet to extract correlationid from message
|
void |
setCorrelationIDXPath(String string)
XPath expression to extract correlationid from message
|
void |
setExceptionOnResult(String string)
If not empty, a PipeRunException is thrown when the result equals this value (for testing purposes only)
|
void |
setHideMethod(IMessageBrowser.HideMethod hideMethod)
(Only used when hideRegex is not empty and only applies to error/logstore)
|
void |
setHideRegex(String hideRegex)
Regular expression to mask strings in the log.
|
void |
setInputValidator(IValidator inputValidator)
specification of Pipe to validate request messages, or request and response message if configured as mixed mode validator
|
void |
setInputWrapper(IWrapperPipe inputWrapper)
specification of Pipe to wrap or unwrap request messages
|
void |
setLabelNamespaceDefs(String labelXNamespaceDefs)
Namespace defintions for labelXPath.
|
void |
setLabelStyleSheet(String string)
Stylesheet to extract label from message
|
void |
setLabelXPath(String string)
XPath expression to extract label from message
|
void |
setLinkMethod(MessageSendingPipe.LinkMethod method)
For asynchronous communication, the server side may either use the messageID or the correlationID
in the correlationID field of the reply message.
|
protected void |
setListener(ICorrelatedPullingListener listener)
Listener for responses on the request sent
|
void |
setMaxRetries(int i)
The number of times a processing attempt is retried after a timeout or an exception is caught or after an incorrect reply is received (see also
retryXPath ) |
void |
setMessageLog(ITransactionalStorage messageLog)
log of all messages sent
|
void |
setName(String name)
The functional name of this pipe.
|
void |
setOutputValidator(IValidator outputValidator)
specification of Pipe to validate response messages
|
void |
setOutputWrapper(IWrapperPipe outputWrapper)
specification of Pipe to wrap or unwrap response messages
|
void |
setPresumedTimeOutInterval(int i)
If the previous call was a timeout, the maximum time in seconds after this timeout to presume the current call is also a timeout.
|
void |
setResultOnTimeOut(String newResultOnTimeOut)
The message (e.g.
|
void |
setRetryMaxInterval(int i)
The maximum number of seconds waited after an unsuccessful processing attempt before another processing attempt is made
|
void |
setRetryMinInterval(int i)
The starting number of seconds waited after an unsuccessful processing attempt before another processing attempt is made.
|
void |
setRetryNamespaceDefs(String retryNamespaceDefs)
Namespace defintions for retryXPath.
|
void |
setRetryXPath(String string)
XPath expression evaluated on each technical successful reply.
|
protected void |
setSender(ISender sender)
The sender that should send the message
|
void |
setStreamResultToServlet(boolean b)
Deprecated.
|
void |
setStubFilename(String filename)
If set, the pipe returns a message from a file, instead of doing the regular process
|
void |
setStubFileName(String fileName)
Deprecated.
|
void |
setTimeOutOnResult(String string)
If not empty, a TimeoutException is thrown when the result equals this value (for testing purposes only)
|
void |
setUseInputForExtract(boolean b)
If set
true , the input of the Pipe is used to extract audit trail, correlationid and label (instead of the wrapped input) |
void |
start()
Perform necessary action to start the pipe.
|
void |
stop()
Perform necessary actions to stop the
Pipe .For instance, closing JMS connections, DBMS connections etc. |
boolean |
supportsOutputStreamPassThrough()
Implementations should return
true when they do not require an OutputStream, but can
provide one to the preceding pipe if they are themselves provided with one from the next pipe. |
getNextPipe, getTargetStream, isStreamingActive, provideOutputStream, setStreamingActive
getParameterValue, setIfParam, setIfValue, setOnlyIfSessionKey, setOnlyIfValue, setSkipOnEmptyInput, setUnlessSessionKey, setUnlessValue, skipPipe
addParameter, createBean, findForward, getAdapter, getEventSourceName, getForwards, getInSizeStatDummyObject, getOutSizeStatDummyObject, getParameterList, registerEvent, registerForward, setApplicationContext, setChompCharSize, setDurationThreshold, setElementToMove, setElementToMoveChain, setElementToMoveSessionKey, setEmptyInputReplacement, setGetInputFromFixedValue, setGetInputFromSessionKey, setLocker, setLogIntermediaryResults, setMaxThreads, setPreserveInput, setRemoveCompactMsgNamespaces, setRestoreMovedElements, setSecLogSessionKeys, setSizeStatistics, setStoreResultInSessionKey, setWriteToSecLog, throwEvent
configureTransactionAttributes, isTransacted, isTransacted, setTransacted, setTransactionTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
getChompCharSize, getDurationThreshold, getElementToMove, getElementToMoveChain, getElementToMoveSessionKey, getEmptyInputReplacement, getGetInputFromFixedValue, getGetInputFromSessionKey, getLocker, getSecLogSessionKeys, getStoreResultInSessionKey, isPreserveInput, isRemoveCompactMsgNamespaces, isRestoreMovedElements, isWriteToSecLog, setPipeLine, throwEvent
getMaxThreads
getApplicationContext, getName
getConfigurationClassLoader
getName
getTransactionAttribute, getTransactionTimeout, getTxDef, setTransactionAttribute
protected org.apache.logging.log4j.Logger msgLog
public static final String PIPE_TIMEOUT_MONITOR_EVENT
public static final String PIPE_CLEAR_TIMEOUT_MONITOR_EVENT
public static final String PIPE_EXCEPTION_MONITOR_EVENT
public static final int MIN_RETRY_INTERVAL
public static final int MAX_RETRY_INTERVAL
public static final String INPUT_VALIDATOR_NAME_PREFIX
public static final String INPUT_VALIDATOR_NAME_SUFFIX
public static final String OUTPUT_VALIDATOR_NAME_PREFIX
public static final String OUTPUT_VALIDATOR_NAME_SUFFIX
public static final String INPUT_WRAPPER_NAME_PREFIX
public static final String INPUT_WRAPPER_NAME_SUFFIX
public static final String OUTPUT_WRAPPER_NAME_PREFIX
public static final String OUTPUT_WRAPPER_NAME_SUFFIX
public static final String MESSAGE_LOG_NAME_PREFIX
public static final String MESSAGE_LOG_NAME_SUFFIX
public void configure() throws ConfigurationException
FixedForwardPipe
configure
in interface IConfigurable
configure
in interface IPipe
configure
in class StreamingPipe
ConfigurationException
protected void propagateName()
public void setName(String name)
AbstractPipe
path
attribute of a PipeForward
.setName
in interface INamedObject
setName
in class AbstractPipe
public boolean supportsOutputStreamPassThrough()
IOutputStreamingSupport
true
when they do not require an OutputStream, but can
provide one to the preceding pipe if they are themselves provided with one from the next pipe.supportsOutputStreamPassThrough
in interface IOutputStreamingSupport
supportsOutputStreamPassThrough
in class StreamingPipe
protected boolean canProvideOutputStream()
StreamingPipe
canProvideOutputStream
in class StreamingPipe
protected boolean canStreamToNextPipe()
StreamingPipe
canStreamToNextPipe
in class StreamingPipe
protected MessageOutputStream provideOutputStream(PipeLineSession session) throws StreamingException
StreamingPipe
StreamingPipe.getNextPipe()
.provideOutputStream
in class StreamingPipe
StreamingException
protected void preserve(@Nonnull Message input) throws PipeRunException
Message.preserve()
so it can be consumed multiple times, and wrap potential IOException
in a PipeRunException
.input
- The Message
to be preserved.PipeRunException
- If an IOException
is thrown from Message.preserve()
, wrap and rethrow it
in a PipeRunException
.public PipeRunResult doPipe(@Nonnull Message input, @Nonnull PipeLineSession session) throws PipeRunException
IPipe
FixedResultPipe
, the Pipe
can schedule the input to be closed at session exit, by calling Message.closeOnCloseOf(PipeLineSession, String)
This allows the previous Pipe to release any resources (e.g. connections) that it might have kept open
until the message was consumed. Doing so avoids connections leaking from pools, while it enables
efficient streaming processing of data while it is being read from a stream.doPipe
in interface IPipe
PipeRunException
protected PipeRunResult sendMessage(Message input, PipeLineSession session, ISender sender, Map<String,Object> threadContext) throws SenderException, TimeoutException, IOException, InterruptedException
public int increaseRetryIntervalAndWait(PipeLineSession session, int retryInterval, String description) throws InterruptedException
InterruptedException
public void start() throws PipeStartException
IPipe
IPipe.configure()
method, for each start and stop command of the
adapter.start
in interface IPipe
start
in class AbstractPipe
PipeStartException
public void stop()
IPipe
Pipe
.stop
in interface IPipe
stop
in class AbstractPipe
public void iterateOverStatistics(StatisticsKeeperIterationHandler hski, Object data, HasStatistics.Action action) throws SenderException
iterateOverStatistics
in interface HasStatistics
SenderException
public boolean hasSizeStatistics()
hasSizeStatistics
in interface IExtendedPipe
hasSizeStatistics
in class AbstractPipe
public boolean consumesSessionVariable(String sessionKey)
IPipe
true
if the pipe or one of its children use the named session variable.
Callers can use this to determine if a message needs to be preserved.consumesSessionVariable
in interface IPipe
consumesSessionVariable
in class AbstractPipe
protected void setSender(ISender sender)
protected void setListener(ICorrelatedPullingListener listener)
public void setMessageLog(ITransactionalStorage messageLog)
public void setInputValidator(IValidator inputValidator)
public void setOutputValidator(IValidator outputValidator)
public void setInputWrapper(IWrapperPipe inputWrapper)
public void setOutputWrapper(IWrapperPipe outputWrapper)
public void setLinkMethod(MessageSendingPipe.LinkMethod method)
public void setCorrelationIDStyleSheet(String string)
public void setCorrelationIDXPath(String string)
public void setCorrelationIDNamespaceDefs(String correlationIDNamespaceDefs)
prefix=namespaceUri
-definitionspublic void setCorrelationIDSessionKey(String string)
public void setLabelStyleSheet(String string)
public void setLabelXPath(String string)
public void setLabelNamespaceDefs(String labelXNamespaceDefs)
prefix=namespaceUri
-definitionspublic void setAuditTrailXPath(String string)
public void setAuditTrailNamespaceDefs(String auditTrailNamespaceDefs)
prefix=namespaceUri
-definitionspublic void setAuditTrailSessionKey(String string)
public void setUseInputForExtract(boolean b)
true
, the input of the Pipe is used to extract audit trail, correlationid and label (instead of the wrapped input)public void setHideRegex(String hideRegex)
AbstractPipe
(?<=<password>).*?(?=</password>)
will replace every character between keys '<password>' and '</password>'. note: this feature is used at adapter level,
so one pipe affects all pipes in the pipeline (and multiple values in different pipes are merged)setHideRegex
in class AbstractPipe
public void setHideMethod(IMessageBrowser.HideMethod hideMethod)
public void setCheckXmlWellFormed(boolean b)
true
, the XML Well-Formedness of the result is checkedpublic void setCheckRootTag(String s)
public void setResultOnTimeOut(String newResultOnTimeOut)
public void setMaxRetries(int i)
retryXPath
)public void setRetryMinInterval(int i)
retryMaxInterval
public void setRetryMaxInterval(int i)
public void setRetryXPath(String string)
public void setRetryNamespaceDefs(String retryNamespaceDefs)
prefix=namespaceUri
-definitionspublic void setPresumedTimeOutInterval(int i)
@Deprecated @ConfigurationWarning(value="Please use a base64pipe to decode the message and send the result to the pipeline exit") public void setStreamResultToServlet(boolean b)
@Deprecated @ConfigurationWarning(value="attribute \'stubFileName\' is replaced with \'stubFilename\'") public void setStubFileName(String fileName)
public void setStubFilename(String filename)
public void setTimeOutOnResult(String string)
public void setExceptionOnResult(String string)
Copyright © 2023 Frank!Framework. All rights reserved.