# KafkaServerResource Properties

- Package: [Aspire.Hosting.Kafka](/reference/api/csharp/aspire.hosting.kafka.md)
- Type: [KafkaServerResource](/reference/api/csharp/aspire.hosting.kafka/kafkaserverresource.md)
- Kind: `Properties`
- Members: `5`

A resource that represents a Kafka broker.

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Kafka/KafkaServerResource.cs#L49)

Gets the connection string expression for the Kafka broker.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## Host

- Name: `Host`
- Modifiers: `get`
- Returns: `EndpointReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Kafka/KafkaServerResource.cs#L32)

Gets the host endpoint reference for the primary endpoint.

```csharp
public EndpointReferenceExpression Host { get; }
```

## InternalEndpoint

- Name: `InternalEndpoint`
- Modifiers: `get`
- Returns: `EndpointReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Kafka/KafkaServerResource.cs#L43)

Gets the internal endpoint for the Kafka broker. This endpoint is used for container to broker communication. To connect to the Kafka broker from a host process, use [KafkaServerResource.PrimaryEndpoint](/reference/api/csharp/aspire.hosting.kafka/kafkaserverresource/properties.md#primaryendpoint).

```csharp
public EndpointReference InternalEndpoint { get; }
```

## Port

- Name: `Port`
- Modifiers: `get`
- Returns: `EndpointReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Kafka/KafkaServerResource.cs#L37)

Gets the port endpoint reference for the primary endpoint.

```csharp
public EndpointReferenceExpression Port { get; }
```

## PrimaryEndpoint

- Name: `PrimaryEndpoint`
- Modifiers: `get`
- Returns: `EndpointReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Kafka/KafkaServerResource.cs#L27)

Gets the primary endpoint for the Kafka broker. This endpoint is used for host processes to Kafka broker communication. To connect to the Kafka broker from a container, use [KafkaServerResource.InternalEndpoint](/reference/api/csharp/aspire.hosting.kafka/kafkaserverresource/properties.md#internalendpoint).

```csharp
public EndpointReference PrimaryEndpoint { get; }
```
