# Configuring Kafka Client ID Features

{% hint style="info" %}
Note that configuring the client id is optional, and that if you set the client id to a string that WarpStream does not recognize, no optional feature will be enabled.
{% endhint %}

WarpStream parses the Apache Kafka client id for key value pairs that are separated with commas. Each key value pair is defined as `key=value`

This means that WarpStream parses the following Apache Kafka client id:

`a=b,c=d,rest_of_the_client_id`

into two key/value pairs: `key: a, value: b` and `key:c, value: d`

These keys/values pair are referred to as "client id features" and are used to implement WarpStream-specific functionality while still remaining within the confines of the Kafka protocol.

## Available Features

### warpstream\_az

```
kgo.NewClient(...,
    kgo.ClientID("warpstream_az=us-east-1a"),
)
```

The `warpstream_az` feature enables zone-aware routing to eliminate inter-zone networking costs. The example above creates a new Apache Kafka client that will tell the WarpStream service discovery system that it's running in the `us-east-1a` availability zone.

The service discovery system will use this information to route the client to Agents in the same zone to eliminate inter-zone networking fees.

Note however that the service discovery system favors availability, so if it cannot find Agents in specified availability zone, it will direct the clients to Agents that are in other zones.

Accepted aliases:

* `warpstream_az`
* `ws_az`

For more information, check out [our documentation about configuring Kafka clients to eliminate inter-AZ networking costs](https://docs.warpstream.com/warpstream/kafka/configure-kafka-client/configure-clients-to-eliminate-az-networking-costs).

### warpstream\_cluster\_id

```
kgo.NewClient(...,
    kgo.ClientID("warpstream_cluster_id=vci_077f2fed"),
)
```

The `warpstream_client_id` makes sure that the agent your are connecting to belongs to the correct Virtual Cluster ID. After a client resolved the DNS of your virtual cluster, it might hit an agent belonging to another virtual cluster if the previous agent stopped and the IP got reused. If you always send the virtual cluster in the client ID, you have the guarantee that the agent will reject the connection if they do not match.

The ID passed should be a prefix of the full virtual cluster ID containing at least 9 characters overall (including the `vci_` prefix). For instance if the full ID is `vci_38fb01d8_e846_4d8b_be8d_dbcc0d23fdbd` the client can set `warpstream_cluster_id=vci_38fb0`.

Accepted aliases:

* `warpstream_client_id`
* `ws_cluster_id`
* `ws_vci`

### warpstream\_proxy\_target

```
kgo.NewClient(...,
    kgo.ClientID("warpstream_proxy_target=proxy-consume"),
)
```

The `warpstream_proxy_target` feature is used in conjunction with WarpStream's [Agent Roles](https://docs.warpstream.com/warpstream/kafka/advanced-agent-deployment-options/splitting-agent-roles) functionality to route individual Kafka clients to Agents that are running specific roles.

If you have split your Agents into distinct roles (as described [here](https://docs.warpstream.com/warpstream/kafka/advanced-agent-deployment-options/splitting-agent-roles)), you should configure your Apache Kafka Client by setting the `warpstream_proxy_target` feature to either `proxy-produce` (this client will connect to the nodes with the `proxy-produce` role) or to `proxy-consume` (and this client will connect to the nodes with the `proxy-consume` role).

Accepted aliases:

* `warpstream_proxy_target`
* `ws_proxy_target`
* `ws_pt`

### warpstream\_agent\_group

```
kgo.NewClient(...,
    kgo.ClientID("warpstream_agent_group=internal"),
)
```

The `warpstream_agent_group` feature is used in conjunction with WarpStream's [Agent Groups](https://docs.warpstream.com/warpstream/kafka/advanced-agent-deployment-options/agent-groups) functionality to route individual Kafka clients to Agents that belong to a specific group.

If you have split your Agents into multiple groups (as described [here](https://docs.warpstream.com/warpstream/kafka/advanced-agent-deployment-options/agent-groups)), you can configure your Apache Kafka client by setting the `warpstream_agent_group` feature to the name of the Agent group you want target.

If your clients use this client ID setting, then they have to set as bootstrap brokers something that exactly matches the same agent group (for instance [our bootstrap URL for the same group](https://docs.warpstream.com/warpstream/advanced-agent-deployment-options/agent-groups#non-kubernetes)): if an Agent in group A receives a request from a client that indicated its intended target is Agents in group b, then the Agent in group A will reject the request with an error before closing the connection. This prevents issues that can occur where clients end up connected Agents in the wrong group due to IP reuse in high-churn environments like Kubernetes.

Accepted aliases:

* `warpstream_agent_group`
* `ws_agent_group`
* `ws_ag`

### warpstream\_partition\_assignment\_strategy

```
kgo.NewClient(...,
    kgo.ClientID("warpstream_partition_assignment_strategy=single_agent"),
)
```

WarpStream Agents are stateless, therefore it is possible to direct your Kafka clients writes or reads to any Agent in the cluster. That said, the WarpStream service discovery system still does have to pick which Agents to route individual clients to. WarpStream supports a number of different strategies for handling this routing.

Accepted aliases:

* `warpstream_partition_assignment_strategy`
* `ws_partition_assignment_strategy`
* `ws_pas`

The possible values for this configuration are:

* `consistent_random_jump`
* `single_agent`

See our [partition assignment strategy documentation](https://docs.warpstream.com/warpstream/kafka/reference/partition-assignment-strategies) for more details on how each strategy works.

### **ws\_host\_override**

```
kgo.NewClient(...,
    kgo.ClientID("ws_host_override=agent-lb.yourcompany.com"),
)
```

`ws_host_override` instructs the Kafka client to connect to the specified hostname instead of the Agent's advertised address. This is particularly useful when agents are:

* Running behind load balancers **or**
* Deployed within containers where the advertised address is not routable from the outside
  * For example when [port-forwarding](https://docs.warpstream.com/warpstream/kafka/configure-kafka-client/port-forwarding-k8s) for local development.

For example, if your Warpstream agent is accessible via a load balancer with the DNS name `agent-lb.yourcompany.com`, you would set `ws_host_override` in your Kafka client configuration to this value.

Accepted aliases:

* `warpstream_partition_assignment_strategy`
* `warpstream_hostname_override`
* `ws_host_override`
* `ws_ho`

### **warpstream\_disable\_fetch\_auto\_tune**

```
kgo.NewClient(...,
    kgo.ClientID("warpstream_disable_fetch_auto_tune=true"),
)
```

`warpstream_disable_fetch_auto_tune` instructs the WarpStream Agents to explicitly disable [fetch size auto-tuning](https://docs.warpstream.com/warpstream/kafka/configure-kafka-client/client-configuration-auto-tuning), but only for this particular client. This is particularly useful when you want to keep fetch size auto-tuning enable at the cluster level, but one or more applications are sensitive to it (using excessive amounts of memory) and you want to disable it for just those applications.

Accepted aliases:

* `ws_dfat`

## Configuring Multiple Features

It is possible to combine these, for example

{% code overflow="wrap" fullWidth="true" %}

```
kgo.NewClient(...,
    kgo.ClientID("warpstream_proxy_target=proxy-produce,warpstream_partition_assignment_strategy=equal_spread,warpstream_az=us-east-1a,my_client_id"),
)
```

{% endcode %}

will configure an Apache Kafka client that

* indicates it is in the `us-east-1a` zone.
* will write different partitions to different agents to spread its load to multiple Agents
* will connect only to the `proxy-produce` agents
* also has a custom string of your choosing, unused by WarpStream, in its id.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.warpstream.com/warpstream/kafka/configure-kafka-client/configuring-kafka-client-id-features.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
