SpringCloud 使用Confluent的Schema注冊(cè)表

2023-11-27 13:57 更新

默認(rèn)配置將創(chuàng)建DefaultSchemaRegistryClient bean。如果要使用Confluent模式注冊(cè)表,則需要?jiǎng)?chuàng)建類(lèi)型為ConfluentSchemaRegistryClient的bean,該類(lèi)型將替代框架默認(rèn)配置的類(lèi)型。下面的示例說(shuō)明如何創(chuàng)建這樣的bean:

@Bean
public SchemaRegistryClient schemaRegistryClient(@Value("${spring.cloud.stream.schemaRegistryClient.endpoint}") String endpoint){
  ConfluentSchemaRegistryClient client = new ConfluentSchemaRegistryClient();
  client.setEndpoint(endpoint);
  return client;
}
ConfluentSchemaRegistryClient已針對(duì)Confluent平臺(tái)4.0.0版進(jìn)行了測(cè)試。
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)