Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-xiaodong committed Oct 15, 2024
1 parent 0c3142c commit 4d69d3e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 40 deletions.
41 changes: 22 additions & 19 deletions docs/content/user-guide/en/transport/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,30 @@ The Kafka configuration parameters provided directly by the CAP:
NAME | DESCRIPTION | TYPE | DEFAULT
:---|:---|---|:---
Servers | Broker server address | string |
MainConfig | librdkafka configuration parameters | Dictionary<string, string> | See below
ConnectionPoolSize | connection pool size | int | 10
CustomHeadersBuilder | Custom subscribe headers | Func<> | N/A
RetriableErrorCodes | Retriable error codes when ConsumeException | IList<ErrorCode> | See code
TopicOptions | The configuraiton of NumPartitions and ReplicationFactor | KafkaTopicOptions | -1

#### Kafka MainConfig Options

If you need **more** native Kakfa related configuration options, you can set them in the `MainConfig` configuration option:

```csharp
services.AddCap(capOptions =>
{
capOptions.UseKafka(kafkaOption=>
{
// kafka options.
// kafkaOptions.MainConfig.Add("", "");
});
});
```

`MainConfig` is a configuration dictionary, you can find a list of supported configuration options through the following link.

[https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)

#### CustomHeadersBuilder Options

Expand Down Expand Up @@ -76,22 +98,3 @@ public void HeadersTest(DateTime value, [FromCap]CapHeader header)
}
```


#### Kafka MainConfig Options

If you need **more** native Kakfa related configuration options, you can set them in the `MainConfig` configuration option:

```csharp
services.AddCap(capOptions =>
{
capOptions.UseKafka(kafkaOption=>
{
// kafka options.
// kafkaOptions.MainConfig.Add("", "");
});
});
```

`MainConfig` is a configuration dictionary, you can find a list of supported configuration options through the following link.

[https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)
46 changes: 25 additions & 21 deletions docs/content/user-guide/zh/transport/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,32 @@ CAP 直接对外提供的 Kafka 配置参数如下:
NAME | DESCRIPTION | TYPE | DEFAULT
:---|:---|---|:---
Servers | Broker 地址 | string |
MainConfig | librdkafka 的配置参数 | Dictionary<string, string> | 见下
ConnectionPoolSize | 用户名 | int | 10
CustomHeadersBuilder | 设置自定义头 | Function |
CustomHeadersBuilder | 设置自定义头 | Function | 见下
RetriableErrorCodes | ConsumeException 异常时的重试错误码集合 | IList<ErrorCode> | 见代码
TopicOptions | 配置 NumPartitions 和 ReplicationFactor | KafkaTopicOptions | -1

#### Kafka MainConfig Options

如果你需要 **更多** 原生 Kakfa 相关的配置项,可以通过 `MainConfig` 配置项进行设定:

```csharp
services.AddCap(capOptions =>
{
capOptions.UseKafka(kafkaOption=>
{
// kafka options.
// kafkaOptions.MainConfig.Add("", "");
});
});
```

MainConfig 为配置字典,你可以通过以下链接找到其支持的配置项列表。

[https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)

#### CustomHeadersBuilder Options

有关 `CustomHeadersBuilder` 的说明:

Expand Down Expand Up @@ -72,23 +96,3 @@ public void HeadersTest(DateTime value, [FromCap]CapHeader header)
var partition = header["my.kafka.partition"];
}
```

#### Kafka MainConfig Options

如果你需要 **更多** 原生 Kakfa 相关的配置项,可以通过 `MainConfig` 配置项进行设定:


```csharp
services.AddCap(capOptions =>
{
capOptions.UseKafka(kafkaOption=>
{
// kafka options.
// kafkaOptions.MainConfig.Add("", "");
});
});
```

MainConfig 为配置字典,你可以通过以下链接找到其支持的配置项列表。

[https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)

0 comments on commit 4d69d3e

Please sign in to comment.