@ComponentProfile(summary="No exceptions if pooled-split-join-service recorded \'some work\'", since="3.11.1", tag="service,splitjoin") public class NoExceptionIfWorkDone extends ServiceExceptionHandler
This strategy is useful if messages within a split-join are transient, and can be ignored
provided some of them work; it allows you to ignore exceptions processing individual mesages
provided one or more messages have set a specific metadata to the value true | 1
.
There are some caveats to using this class as part of a PooledSplitJoinService
Condition
to filter the message somehow. Presumably via the same metadata flag that
you've set here.AppendingMessageAggregator
then you may still end up with a mix of JSON/XMLsplitter
.In the adapter configuration file this class is aliased as no-exception-if-work-done which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_METADATA_KEY |
Constructor and Description |
---|
NoExceptionIfWorkDone() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMetadataKey()
Set the metadata key that captures if any service did work.
|
void |
markSuccessful(AdaptrisMessage msg) |
void |
setMetadataKey(java.lang.String metadataKey)
Set the metadata key that captures if any service did work.
|
void |
throwExceptionAsRequired() |
NoExceptionIfWorkDone |
withMetadataKey(java.lang.String k) |
clearExceptions, getFirstThrowableException, throwFirstException, uncaughtException
public static final java.lang.String DEFAULT_METADATA_KEY
public void throwExceptionAsRequired() throws ServiceException
throwExceptionAsRequired
in interface ServiceErrorHandler
throwExceptionAsRequired
in class ServiceExceptionHandler
ServiceException
public void markSuccessful(AdaptrisMessage msg)
msg
- the message that was successfulpublic NoExceptionIfWorkDone withMetadataKey(java.lang.String k)
public java.lang.String getMetadataKey()
Defaults to "serviceResult" if not specified.
public void setMetadataKey(java.lang.String metadataKey)
Defaults to "serviceResult" if not specified.