Package com.adaptris.core.jdbc.retry
Class RetryMessagesService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.jdbc.JdbcService
-
- com.adaptris.core.jdbc.retry.RetryServiceImp
-
- com.adaptris.core.jdbc.retry.RetryMessagesService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConnectedService
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="retries a message from the retry store.", since="4.9.0", tag="retry") public class RetryMessagesService extends RetryServiceImp
Service which obtains messages from the retry store that meet the appropriate criteria and retries them. This service is intended to be used in conjunction with
PollingTrigger
.The 'appropriate criteria' are as follows:
- the message has not been acknowledged
- the total number of retries has not been exceeded
- the retry interval has elapsed since the last retry.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.jdbc.retry.RetryServiceImp
marshaller
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description RetryMessagesService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StandaloneProducer
getExpiredMessagesProducer()
boolean
getPruneExpired()
protected void
performService(AdaptrisMessage msg)
void
setExpiredMessagesProducer(StandaloneProducer sp)
void
setPruneExpired(boolean b)
Specify whether to produce messages using the configuredexpiredMessagesProducer
and subsequently deleting them.void
start()
Starts the component.void
stop()
Stop the componentprotected void
stopService()
Stop the service.-
Methods inherited from class com.adaptris.core.jdbc.retry.RetryServiceImp
closeJdbcService, doService, getConnection, getPruneAcknowledged, getRetryStore, initJdbcService, prepareService, setConnection, setPruneAcknowledged, setRetryStore, startService
-
Methods inherited from class com.adaptris.core.jdbc.JdbcService
applyTimeout, closeService, createStatement, getConnection, getStatementTimeout, initService, prepare, prepareStatement, prepareStatement, setStatementTimeout
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Method Detail
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Overrides:
start
in classRetryServiceImp
- Throws:
CoreException
- wrapping any underlyingException
s- See Also:
ServiceImp.start()
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
- Overrides:
stop
in classJdbcService
- See Also:
ServiceImp.stop()
-
stopService
protected void stopService()
Description copied from class:JdbcService
Stop the service.This is called after before the connection is stopped
- Specified by:
stopService
in classJdbcService
-
performService
protected void performService(AdaptrisMessage msg) throws ServiceException
- Specified by:
performService
in classRetryServiceImp
- Throws:
ServiceException
- See Also:
RetryServiceImpTest#performService(com.adaptris.core.AdaptrisMessage)
-
getExpiredMessagesProducer
public StandaloneProducer getExpiredMessagesProducer()
- Returns:
- the expiredMessagesProducer
-
setExpiredMessagesProducer
public void setExpiredMessagesProducer(StandaloneProducer sp)
- Parameters:
sp
- the expiredMessagesProducer to set
-
getPruneExpired
public boolean getPruneExpired()
- Returns:
- the pruneExpired
-
setPruneExpired
public void setPruneExpired(boolean b)
Specify whether to produce messages using the configuredexpiredMessagesProducer
and subsequently deleting them.- Parameters:
b
- the pruneExpired to set- See Also:
setExpiredMessagesProducer(StandaloneProducer)
-
-