Class FilesystemRetryStore
- All Implemented Interfaces:
ComponentLifecycle
,ComponentLifecycleExtension
,RetryStore
While not tightly coupled with RetryFromJetty
it is designed somewhat exclusively for
that. You may be able to make use of it in other ways, but behaviour may change unexpectedly due
to changes in RetryFromJetty
.
The behaviour of this store will assume that each message-id
will form a sub-directory
off baseUrl
. Metadata will be stored [baseUrl]/[msgId]/metadata.properties
as a
standard properties file; the payload will be stored in [baseUrl]/[msgId]/payload.blob
.
- Since:
- 3.11.1
In the adapter configuration file this class is aliased as retry-store-filesystem which is the preferred alternative to the fully qualified classname when building your configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
acknowledge
(String acknowledgeId) Acknowledge that the message with the passed ID has now been successfully processed and should not be retried again.buildForRetry
(String msgId, Map<String, String> metadata, AdaptrisMessageFactory msgFac) Build the message for retrying from the store.protected static RemoteBlob
createForReport
(File baseDir) boolean
Delete a message from the store (optional operation).void
Delete any messages that have been successfully Acknowledged.The base URLfile:///...
where we can discover files.getMetadata
(String msgId) Retrieve the metadata associated with the msgId the store.void
makeConnection
(AdaptrisConnection connection) Used for any implementations that have a connected RetryStorevoid
prepare()
Prepare for initialisation.report()
Report on a list of blobs that is present in the store (optional operation).void
setBaseUrl
(String baseUrl) The base URLfile:///...
where we can discover files.void
updateRetryCount
(String messageId) Update the number of retries which have taken place for the message with the passed ID.void
write
(AdaptrisMessage msg) Write a message to the store.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.ComponentLifecycle
close, init, start, stop
Methods inherited from interface com.adaptris.core.http.jetty.retry.RetryStore
buildForRetry, buildForRetry, obtainExpiredMessages, obtainMessagesToRetry
-
Constructor Details
-
FilesystemRetryStore
public FilesystemRetryStore()
-
-
Method Details
-
prepare
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Specified by:
prepare
in interfaceRetryStore
- Throws:
CoreException
-
write
Description copied from interface:RetryStore
Write a message to the store.- Specified by:
write
in interfaceRetryStore
- Throws:
InterlokException
-
buildForRetry
public AdaptrisMessage buildForRetry(String msgId, Map<String, String> metadata, AdaptrisMessageFactory msgFac) throws InterlokExceptionDescription copied from interface:RetryStore
Build the message for retrying from the store.- Specified by:
buildForRetry
in interfaceRetryStore
- Parameters:
msgId
- the message id.metadata
- the metadata you want to apply to the messagemsgFac
- the message factory to use- Returns:
- a message.
- Throws:
CoreException
InterlokException
-
getMetadata
Description copied from interface:RetryStore
Retrieve the metadata associated with the msgId the store.This is used to assert that the workflow exists in this instance for that message; there is no point building the whole message only to fail because the workflow doesn't exist.
- Specified by:
getMetadata
in interfaceRetryStore
- Throws:
InterlokException
- if no metadata could be retrieved (e.g the msgId doesn't exist)
-
report
Description copied from interface:RetryStore
Report on a list of blobs that is present in the store (optional operation).- Specified by:
report
in interfaceRetryStore
- Throws:
InterlokException
-
delete
Description copied from interface:RetryStore
Delete a message from the store (optional operation).- Specified by:
delete
in interfaceRetryStore
- Throws:
InterlokException
-
createForReport
-
withBaseUrl
-
acknowledge
Description copied from interface:RetryStore
Acknowledge that the message with the passed ID has now been successfully processed and should not be retried again. NB this method does not throw an Exception if the acknowledge ID does not exist in the store.
- Specified by:
acknowledge
in interfaceRetryStore
- Parameters:
acknowledgeId
- the acknowledge ID of the message to acknowledge- Throws:
InterlokException
- wrapping anyException
which occurs
-
deleteAcknowledged
Description copied from interface:RetryStore
Delete any messages that have been successfully Acknowledged.- Specified by:
deleteAcknowledged
in interfaceRetryStore
- Throws:
InterlokException
- wrapping anyException
which occurs
-
updateRetryCount
Description copied from interface:RetryStore
Update the number of retries which have taken place for the message with the passed ID. NB this method does not throw an Exception if an attempt is made to update the retry count for a message ID which does not exist in the store.
- Specified by:
updateRetryCount
in interfaceRetryStore
- Parameters:
messageId
- the ID of the message to update- Throws:
InterlokException
- wrapping anyException
which occurs
-
makeConnection
Description copied from interface:RetryStore
Used for any implementations that have a connected RetryStore
- Specified by:
makeConnection
in interfaceRetryStore
-
getBaseUrl
The base URLfile:///...
where we can discover files. -
setBaseUrl
The base URLfile:///...
where we can discover files.
-