Skip to content

Latest commit

 

History

History
 
 

java

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

temporal-migration :: Java

Structure

There are two primary modules, examples and migration. Spring has been used to declutter the code and illustrate some more advanced autoconfigure features of Temporal Java SDK.

  • migration module contains an Temporal Interceptor that can be dropped into your worker to push execution state from one Namespace to another.
    • interceptor submodule has related interceptor code and should not need alot of recoding by you
    • support submodule has two utility Activities that can be used to Push and Pull execution state for a signal-lossyless migration
  • examples module has
    • a backend submodule that pretends to be a long-running workflow that needs to be migrated
    • a frontend submodule that has Starters and Simulator

Applications

  1. Start temporal local dev server
  2. Start LegacyApplication (cfg: application-legacy.yml)
    1. This represents the application already running in your self-hosted environment
  3. Start TargetApplication (cfg: application-target.yml)
    1. This represents the application running in your Temporal Cloud environment
  4. Start SimulatorApplication (cfg: application-simulation.yml)
    1. This is the Simulator you are running to cross-check signals against what you see in your target Namespace.

Starters

  1. Run SeedStarterApplication (cfg: application-starter.yml)
    1. Cleans both the target and legacy environments (BE CAREFUL)
      1. Fails occasionally due to race with batch jobs in local dev. Just re-run it
    2. Starts ${spring.simulation.execution-count} executions in your legacy application
    3. Starts simulator to send signals with timestamp every ${spring.simulation.signal-frequency-millis} milliseconds to legacy application, failing over to the target when migrated
      1. Sends only ${spring.simulation.signal-target-threshold-count} signals to the target after migration to allow exit of simulator
  2. Run MigrateStarterApplication (cfg: application-starter.yml)
    1. Sends the migrateIt batch signal into your Legacy Application to
      1. Cancel the current execution
      2. Start an execution in the Target Namespace with the current getMigrationState query result
      3. Exit the execution with Completed status

Migration.Support Package

The support package has reusable facilities for pushing and pulling getMigrationState query results between your Legacy and Target Namespaces.

The pullLegacyExecutionInfo Activity polls the corresponding legacy execution to pull Completed workflow execution state over to the Target execution.