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

    Constructors
    Constructor
    Description
    Creates a new write-ahead resume strategy
    Creates a new write-ahead resume strategy
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.camel.resume.ResumeAdapter
     
    org.apache.camel.CamelContext
     
    org.apache.camel.resume.ResumeStrategyConfiguration
     
    void
     
    void
    setAdapter(org.apache.camel.resume.ResumeAdapter adapter)
     
    void
    setCamelContext(org.apache.camel.CamelContext camelContext)
     
    void
    setResumeStrategyConfiguration(org.apache.camel.resume.ResumeStrategyConfiguration resumeStrategyConfiguration)
     
    void
     
    void
     
    void
    updateLastOffset(org.apache.camel.resume.OffsetKey<?> offsetKey, org.apache.camel.resume.Offset<?> offsetValue)
     
    void
    updateLastOffset(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>
    void
    updateLastOffset(T offset)
     
    <T extends org.apache.camel.resume.Resumable>
    void
    updateLastOffset(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, wait

    Methods inherited from interface org.apache.camel.resume.ResumeStrategy

    getAdapter

    Methods inherited from interface org.apache.camel.Service

    build, close, init
  • Constructor Details

    • WriteAheadResumeStrategy

      public WriteAheadResumeStrategy()
      Creates a new write-ahead resume strategy
    • WriteAheadResumeStrategy

      public WriteAheadResumeStrategy(WriteAheadResumeStrategyConfiguration resumeStrategyConfiguration)
      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:
      setAdapter in interface org.apache.camel.resume.ResumeStrategy
    • getAdapter

      public org.apache.camel.resume.ResumeAdapter getAdapter()
      Specified by:
      getAdapter in interface org.apache.camel.resume.ResumeStrategy
    • updateLastOffset

      public <T extends org.apache.camel.resume.Resumable> void updateLastOffset(T offset) throws Exception
      Specified by:
      updateLastOffset in interface org.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:
      updateLastOffset in interface org.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:
      updateLastOffset in interface org.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:
      updateLastOffset in interface org.apache.camel.resume.ResumeStrategy
      Throws:
      Exception
    • loadCache

      public void loadCache() throws Exception
      Specified by:
      loadCache in interface org.apache.camel.resume.ResumeStrategy
      Throws:
      Exception
    • start

      public void start()
      Specified by:
      start in interface org.apache.camel.Service
    • stop

      public void stop()
      Specified by:
      stop in interface org.apache.camel.Service
    • setResumeStrategyConfiguration

      public void setResumeStrategyConfiguration(org.apache.camel.resume.ResumeStrategyConfiguration resumeStrategyConfiguration)
      Specified by:
      setResumeStrategyConfiguration in interface org.apache.camel.resume.ResumeStrategy
    • getResumeStrategyConfiguration

      public org.apache.camel.resume.ResumeStrategyConfiguration getResumeStrategyConfiguration()
      Specified by:
      getResumeStrategyConfiguration in interface org.apache.camel.resume.ResumeStrategy
    • getCamelContext

      public org.apache.camel.CamelContext getCamelContext()
      Specified by:
      getCamelContext in interface org.apache.camel.spi.HasCamelContext
    • setCamelContext

      public void setCamelContext(org.apache.camel.CamelContext camelContext)
      Specified by:
      setCamelContext in interface org.apache.camel.CamelContextAware