@ComponentProfile(summary="Produce a message where as part of a service chain; retrying once on failure", tag="service") public class RetryOnceStandaloneProducer extends StandaloneProducer
As some internal components have relationships that are persistent across their normal lifecycle, this class additionally marshals each connection and producer implementation to XML and back again prior to initialisation.
In the adapter configuration file this class is aliased as retry-once-standalone-producer which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
RetryOnceStandaloneProducer() |
Modifier and Type | Method and Description |
---|---|
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
TimeInterval |
getWaitBeforeRetry() |
void |
produce(AdaptrisMessage msg)
Produces the
AdaptrisMessage to the default destination. |
void |
produce(AdaptrisMessage msg,
ProduceDestination dest)
Produce the
AdaptrisMessage to the supplied ProduceDestination , over-riding any configured destinations. |
void |
setWaitBeforeRetry(TimeInterval waitBeforeRetry)
Sets the period to wait before trying to produce again.
|
closeService, createName, createQualifier, getConnection, getProducer, initService, prepare, setConnection, setProducer, start, stop
changeState, close, continueOnFailure, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnFailure, isBranching, setUniqueId
isTrackingEndpoint
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
getUniqueId
close, init
getLookupName
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
doService
in interface Service
doService
in class StandaloneProducer
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
sService.doService(com.adaptris.core.AdaptrisMessage)
public void produce(AdaptrisMessage msg) throws ProduceException
AdaptrisMessageSender
AdaptrisMessage
to the default destination.produce
in interface AdaptrisMessageSender
produce
in class StandaloneProducer
msg
- the @link AdaptrisMessage} to produceProduceException
- wrapping any underlying Exceptionspublic void produce(AdaptrisMessage msg, ProduceDestination dest) throws ProduceException
AdaptrisMessageSender
AdaptrisMessage
to the supplied ProduceDestination
, over-riding any configured destinations.produce
in interface AdaptrisMessageSender
produce
in class StandaloneProducer
msg
- the AdaptrisMessage
to producedest
- the ProduceDestination
to produce toProduceException
- wrapping any underlying Exceptionspublic TimeInterval getWaitBeforeRetry()
public void setWaitBeforeRetry(TimeInterval waitBeforeRetry)
waitBeforeRetry
- the period to wait before trying to produce again, if not specified defaults to 30 seconds.