# Global domain registration in java sdk

**URL:** <https://community.temporal.io/t/global-domain-registration-in-java-sdk/282>\
**Category:** Community Support\
**Tags:** java-sdk, springboot, domain, cadence\
**Created:** [July 27, 2020, 8:53am UTC](https://community.temporal.io/t/global-domain-registration-in-java-sdk/282 "2020-07-27T08:53:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.temporal.io/u/madhu)\
**Post date:** [July 27, 2020, 8:53am UTC](https://community.temporal.io/t/global-domain-registration-in-java-sdk/282/1 "2020-07-27T08:53:26Z")

</div>

I am using temporal 27 ,when i try to register a global domain, its failing unable to register domain

Version temporal 27

Request sent :

RegisterNamespaceRequest request = RegisterNamespaceRequest.newBuilder().setName(ns)  
.setEmitMetric(true)  
.setHistoryArchivalState(ArchivalState.ARCHIVAL\_STATE\_ENABLED)  
.setIsGlobalNamespace(true)  
.setOwnerEmail(“[me@myself.me](mailto:me@myself.me)”)  
.setWorkflowExecutionRetentionPeriodDays(5).build();  
int retryCount = 0;

```
				// in while loop i attempt registration with this call ->service.blockingStub().registerNamespace(request);

```

Response :  
io.grpc.StatusRuntimeException: INVALID\_ARGUMENT: Cannot register global namespace when not enabled  
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:244)  
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:225)  
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:142)  
at io.temporal.api.workflowservice.v1.WorkflowServiceGrpc$WorkflowServiceBlockingStub.registerNamespace(WorkflowServiceGrpc.java:2554)…

If i set the isGlobalDomain to false i am able to register succesfully.

How should i enable global domain?

---

<div class="post-metadata">

**Author:** ![samar](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/samar/32/12_2.png) [@samar](https://community.temporal.io/u/samar)\
**Post date:** [July 27, 2020, 7:30pm UTC](https://community.temporal.io/t/global-domain-registration-in-java-sdk/282/5 "2020-07-27T19:30:06Z")

</div>

Hey @madhu,  
We have renamed the `domain` concept as `namespace` in Temporal. So I’m going to assume you meant GlobalNamespace in rest of the response. Based on the error you are seeing looks like `GlobalNamespace` feature is not turned on for the cluster. You need to configure [clusterMetadata](https://docs.temporal.io/docs/configuring-temporal-server#clustermetadata) section of the config to enable cross datacenter with namespace replication. Here is an example:

ClusterMetadata for Cluster A

```auto
clusterMetadata:
  enableGlobalNamespace: true
  replicationConsumer:
    type: kafka
  failoverVersionIncrement: 10
  masterClusterName: "ClusterA"
  currentClusterName: "ClusterA"
  clusterInformation:
    ClusterA:
      enabled: true
      initialFailoverVersion: 1
      rpcName: "frontend"
      rpcAddress: "localhost:7933"
    ClusterB:
      enabled: true
      initialFailoverVersion: 2
      rpcName: "frontend"
      rpcAddress: "localhost:8933"

```

Configure Kafka for replication on Cluster A:

```auto
kafka:
  clusters:
    test:
      brokers:
        - 127.0.0.1:9092
  topics:
    ClusterA:
      cluster: test
    ClusterA-dlq:
      cluster: test
    ClusterB:
      cluster: test
    ClusterB-dlq:
      cluster: test
  temporal-cluster-topics:
    ClusterA:
      topic: ClusterA
      dlq-topic: ClusterA-dlq
    ClusterB:
      topic: ClusterB
      dlq-topic: ClusterB-dlq

```

And finally make sure publicClient section is also setup correctly in case of call forwarding from one cluster to another:

```auto
publicClient:
  hostPort: "localhost:7933"

```

Here is how the config should look like of `ClusterB`:

```auto
clusterMetadata:
  enableGlobalNamespace: true
  replicationConsumer:
    type: kafka
  failoverVersionIncrement: 10
  masterClusterName: "ClusterA"
  currentClusterName: "ClusterB"
  clusterInformation:
    ClusterA:
      enabled: true
      initialFailoverVersion: 1
      rpcName: "frontend"
      rpcAddress: "localhost:7933"
    ClusterB:
      enabled: true
      initialFailoverVersion: 2
      rpcName: "frontend"
      rpcAddress: "localhost:8933"

kafka:
  clusters:
    test:
      brokers:
        - 127.0.0.1:9092
  topics:
    ClusterA:
      cluster: test
    ClusterA-dlq:
      cluster: test
    ClusterB:
      cluster: test
    ClusterB-dlq:
      cluster: test
  temporal-cluster-topics:
    ClusterA:
      topic: ClusterA
      dlq-topic: ClusterA-dlq
    ClusterB:
      topic: ClusterB
      dlq-topic: ClusterB-dlq

publicClient:
  hostPort: "localhost:8933"

```

The documentation on setting up Temporal with CrossDC setup is very thin at the moment but we will provide more content around it after our V1 release.

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.temporal.io/u/madhu)\
**Post date:** [July 29, 2020, 10:06am UTC](https://community.temporal.io/t/global-domain-registration-in-java-sdk/282/6 "2020-07-29T10:06:33Z")

</div>

Thanks @samar i was under impression that i can create a global namespace by just setting the global = true while creating namespace 😃

Thanks for clarifying that the server got to be configured to accept global namespace registration.

---

<div class="post-metadata">

**Author:** ![samar](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/samar/32/12_2.png) [@samar](https://community.temporal.io/u/samar)\
**Post date:** [July 29, 2020, 2:20pm UTC](https://community.temporal.io/t/global-domain-registration-in-java-sdk/282/7 "2020-07-29T14:20:41Z")

</div>

Hey @madhu,  
Global namespace requires running Temporal with CrossDC setup.

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.temporal.io/u/madhu)\
**Post date:** [August 23, 2021, 7:36am UTC](https://community.temporal.io/t/global-domain-registration-in-java-sdk/282/8 "2021-08-23T07:36:26Z")

</div>

after the Kafa replication is deprecated, is this configuration still valid?

if not whats the alternative config to be used?

not sure how this is related to [Configure the Temporal Server | Temporal documentation](https://docs.temporal.io/docs/server/configuration#global)

and how is this related to

services:  
frontend:  
rpc:  
grpcPort: 8233  
**membershipPort: 8933**  
bindOnLocalHost: true  
metrics:  
statsd:  
hostPort: “127.0.0.1:8125”  
prefix: “temporal\_standby”

---

<div class="post-metadata">

**Author:** ![samar](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/samar/32/12_2.png) [@samar](https://community.temporal.io/u/samar)\
**Post date:** [September 26, 2021, 6:53pm UTC](https://community.temporal.io/t/global-domain-registration-in-java-sdk/282/9 "2021-09-26T18:53:18Z")

</div>

@madhu if you are talking about `clusterMetadata` config then it is still valid. The only difference is `replicationConsumer` is gone as all Kafka related replication code now removed and we only support `rpc`.  
`Global` section in the config has nothing to do with `Cross DC Setup`. This is to configure services which are generically applicable to all parts of the system, like `membership`, `pprof handler`, `tls`, etc.  
Same goes for the `services` section. Which has the config settings for individual roles within Temporal.

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.temporal.io/u/madhu)\
**Post date:** [September 27, 2021, 6:59am UTC](https://community.temporal.io/t/global-domain-registration-in-java-sdk/282/10 "2021-09-27T06:59:50Z")

</div>

Thanks @smar, i looked thorough he samples and found that these are still valid.
