Package org.apache.camel.component.wal
Class WriteAheadResumeStrategy
java.lang.Object
org.apache.camel.component.wal.WriteAheadResumeStrategy
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.resume.ResumeStrategy,org.apache.camel.Service,org.apache.camel.spi.HasCamelContext
@JdkService("write-ahead-resume-strategy")
public class WriteAheadResumeStrategy
extends Object
implements org.apache.camel.resume.ResumeStrategy, org.apache.camel.CamelContextAware
A resume strategy that uses a write-ahead strategy to keep a transaction log of the in-processing and processed
records. This strategy works by wrapping another strategy. This increases the reliability of the resume API by
ensuring that records are saved locally before being sent to the remote data storage used by the resume strategy,
thus guaranteeing that records can re recovered in case of crash of that system.
Among other things, it implements data recovery on startup, so that records cached locally, are automatically
recovered
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.camel.resume.ResumeStrategy
org.apache.camel.resume.ResumeStrategy.UpdateCallBack -
Field Summary
Fields inherited from interface org.apache.camel.resume.ResumeStrategy
DEFAULT_NAME -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new write-ahead resume strategyWriteAheadResumeStrategy(WriteAheadResumeStrategyConfiguration resumeStrategyConfiguration) Creates a new write-ahead resume strategy -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.resume.ResumeAdapterorg.apache.camel.CamelContextorg.apache.camel.resume.ResumeStrategyConfigurationvoidvoidsetAdapter(org.apache.camel.resume.ResumeAdapter adapter) voidsetCamelContext(org.apache.camel.CamelContext camelContext) voidsetResumeStrategyConfiguration(org.apache.camel.resume.ResumeStrategyConfiguration resumeStrategyConfiguration) voidstart()voidstop()voidupdateLastOffset(org.apache.camel.resume.OffsetKey<?> offsetKey, org.apache.camel.resume.Offset<?> offsetValue) voidupdateLastOffset(org.apache.camel.resume.OffsetKey<?> offsetKey, org.apache.camel.resume.Offset<?> offsetValue, org.apache.camel.resume.ResumeStrategy.UpdateCallBack updateCallBack) <T extends org.apache.camel.resume.Resumable>
voidupdateLastOffset(T offset) <T extends org.apache.camel.resume.Resumable>
voidupdateLastOffset(T offset, org.apache.camel.resume.ResumeStrategy.UpdateCallBack updateCallBack) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.resume.ResumeStrategy
getAdapterMethods inherited from interface org.apache.camel.Service
build, close, init
-
Constructor Details
-
WriteAheadResumeStrategy
public WriteAheadResumeStrategy()Creates a new write-ahead resume strategy -
WriteAheadResumeStrategy
Creates a new write-ahead resume strategy- Parameters:
resumeStrategyConfiguration- the configuration to use for this strategy instance
-
-
Method Details
-
setAdapter
public void setAdapter(org.apache.camel.resume.ResumeAdapter adapter) - Specified by:
setAdapterin interfaceorg.apache.camel.resume.ResumeStrategy
-
getAdapter
public org.apache.camel.resume.ResumeAdapter getAdapter()- Specified by:
getAdapterin interfaceorg.apache.camel.resume.ResumeStrategy
-
updateLastOffset
public <T extends org.apache.camel.resume.Resumable> void updateLastOffset(T offset) throws Exception - Specified by:
updateLastOffsetin interfaceorg.apache.camel.resume.ResumeStrategy- Throws:
Exception
-
updateLastOffset
public <T extends org.apache.camel.resume.Resumable> void updateLastOffset(T offset, org.apache.camel.resume.ResumeStrategy.UpdateCallBack updateCallBack) throws Exception - Specified by:
updateLastOffsetin interfaceorg.apache.camel.resume.ResumeStrategy- Throws:
Exception
-
updateLastOffset
public void updateLastOffset(org.apache.camel.resume.OffsetKey<?> offsetKey, org.apache.camel.resume.Offset<?> offsetValue) throws Exception - Specified by:
updateLastOffsetin interfaceorg.apache.camel.resume.ResumeStrategy- Throws:
Exception
-
updateLastOffset
public void updateLastOffset(org.apache.camel.resume.OffsetKey<?> offsetKey, org.apache.camel.resume.Offset<?> offsetValue, org.apache.camel.resume.ResumeStrategy.UpdateCallBack updateCallBack) throws Exception - Specified by:
updateLastOffsetin interfaceorg.apache.camel.resume.ResumeStrategy- Throws:
Exception
-
loadCache
- Specified by:
loadCachein interfaceorg.apache.camel.resume.ResumeStrategy- Throws:
Exception
-
start
public void start()- Specified by:
startin interfaceorg.apache.camel.Service
-
stop
public void stop()- Specified by:
stopin interfaceorg.apache.camel.Service
-
setResumeStrategyConfiguration
public void setResumeStrategyConfiguration(org.apache.camel.resume.ResumeStrategyConfiguration resumeStrategyConfiguration) - Specified by:
setResumeStrategyConfigurationin interfaceorg.apache.camel.resume.ResumeStrategy
-
getResumeStrategyConfiguration
public org.apache.camel.resume.ResumeStrategyConfiguration getResumeStrategyConfiguration()- Specified by:
getResumeStrategyConfigurationin interfaceorg.apache.camel.resume.ResumeStrategy
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-