Multiple Namespace Creation (Springboot)

Hi folks,

I’m integrating temporal with my springboot application. I can’t seem to figure out how to create multiple namespaces. I read on a different forum that a new instance of WorkflowClient has to be used with the desired namespace set using WorkflowClientOptions, but I don’t know how to integrate that with a new worker factory. Any pointers for this?

This is the current structure that I have working in my temporal config class:

@Bean
public WorkflowServiceStubs workflowServiceStubs() {
return WorkflowServiceStubs.newInstance(WorkflowServiceStubsOptions.newBuilder().setTarget(temporalServiceAddress).build());
}

@Bean
public WorkflowClient workflowClient(WorkflowServiceStubs workflowServiceStubs) {
    return WorkflowClient.newInstance(workflowServiceStubs, WorkflowClientOptions.newBuilder().setNamespace(temporalNameSpace).build());
}


@Bean
public WorkerFactory workerFactory(WorkflowClient workflowClient) {
    return WorkerFactory.newInstance(workflowClient);
}

If you want to interact with multiple namespaces you need to produce separate WorkflowClient objects (one for each namespace). This means you would have to produce separate WorkflowClient, WorkerFactory and your workers from the factory for each of the namespaces.

Would look into applying qualifiers to your bean definitions that might help.

Thanks for the reply. I was able to do it with qualifiers, as well as register a new namespace via tctl. However, I’m seeing on the temporal server UI when I switch namespaces, the workflow list from the old namespace (default) remains on the screen. When I click on one of these workflows in the new namespace, I get Error 404 Workflow executionsRow not found.

Upon web refresh, the list does a load animation indefinitely. When I switch back to the old namespace (default), I can see the list of workflows running for that space. But, Im not able to see the workflow list at all for any namespace besides default. The workflows are running fine in the backend, and I can tell that they are running in the new namespace since they dont pop up in the ui under Default namespace, but are accomplishing tasks.

Is this a bug with the UI? Please advise, thanks!

@tihomir friendly ping :slight_smile:
Would love to know if this is a bug on temporal side or an error on my setup.

Can you share what image you deploy? temporalio/web or temporalio/ui and also what version?

I’m using temporalio/ui. From your reply, I realized my temporal server was outdated. Just pulled changes and the bug went away.

Can confirm it was a bug with older version but now it’s working fine :+1: Thanks for the help!