# Can we add mutil temporal connnect target in the spring config file?

**URL:** <https://community.temporal.io/t/can-we-add-mutil-temporal-connnect-target-in-the-spring-config-file/8768>\
**Category:** Community Support\
**Created:** [July 7, 2023, 10:52am UTC](https://community.temporal.io/t/can-we-add-mutil-temporal-connnect-target-in-the-spring-config-file/8768 "2023-07-07T10:52:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_Li](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/william_li/32/3977_2.png) [@William\_Li](https://community.temporal.io/u/William_Li)\
**Post date:** [July 7, 2023, 10:52am UTC](https://community.temporal.io/t/can-we-add-mutil-temporal-connnect-target-in-the-spring-config-file/8768/1 "2023-07-07T10:52:35Z")

</div>

Hi, everyone:  
For now, we want to add mutil target and i have change config file like this:

```auto
server:
  port: 3030
spring:
  application:
    name: temporal-samples 
temporal:
    connection:
      target: ip:port,ip:port

```

But i gor this errror:: **Invalid DNS name: ip:poer,ip:port.**

So I’m not sure temporal have this function to support this config that add mutil target.  
anyone can help me with this issue? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [July 10, 2023, 10:55pm UTC](https://community.temporal.io/t/can-we-add-mutil-temporal-connnect-target-in-the-spring-config-file/8768/2 "2023-07-10T22:55:52Z")

</div>

No not via config. Config uses this to create a single instance of WorkflowClient which is used to create your workers and can be injected in client code / activities / tests with:

@Autowired WorkflowClient client; // bean name is temporalWorkflowClient

Note that WorkflowClient is per namespace anyways.

If you need second WorkflowClient for your app thats used only in client code you would need to produce it yourself, for example in a @Configuration class:

```auto
@Bean(name = "secondClient")
  public WorkflowClient secondClient() {
    WorkflowServiceStubs service = WorkflowServiceStubs.newLocalServiceStubs();
    return WorkflowClient.newInstance(
        service, WorkflowClientOptions.newBuilder().setNamespace("xyz").build());
  }

```

and then you can autowire the default one from your config and your second one, for example:

```auto
  @Autowired
  @Qualifier("temporalWorkflowClient")
  WorkflowClient client;

  @Autowired
  @Qualifier("secondClient")
  WorkflowClient secondClient;

```
