I implemented some workflows (Multi-tenancy every client has their set of jobs) and I used cron scheduler to run it periodically
that used Quarkus container services.
The problem is I’m some time stop Quarkus container for redeploying. I there’s any way to register the app to temporal server and get the jobs executed again based on their schedules ?
or i have to loop over my tenants in app loading and start them again like that
WorkflowClient client = configuration.getClient(); WorkflowOptions workflowOptions = WorkflowOptions.newBuilder() .setCronSchedule(EVERY_FIVE_MINUTES) .setWorkflowId("getAllListings-"+1000) .setTaskQueue(TemporalConfiguration.TASK_QUEUE) .setMemo(ImmutableMap.of("action", "getAllListings", "userId", 1000)) .setWorkflowExecutionTimeout(Duration.ofMinutes(10)) .setWorkflowRunTimeout(Duration.ofMinutes(10)) .setWorkflowTaskTimeout(Duration.ofMinutes(10)) .build(); // Create a new workflow stub per each workflow start GetListingWorkFlow workflow = client.newWorkflowStub(GetListingWorkFlow.class, workflowOptions); WorkflowExecution workflowExecution = WorkflowClient .start(workflow::startImport, 1000, 154, 100); String message = "Started process file workflow with workflowId=\"" + workflowExecution.getWorkflowId() + "\" and runId=\"" + workflowExecution.getRunId() + "\"";