在 spring-kafka 消费者上实施 SSL

Implementing SSL on the spring-kafka Consumer

我在容器工厂中使用以下配置。添加此配置后,我无法看到 spring-kafka 消费者正在使用任何东西。 是否有使用 spring 为 kafka 消费者设置 SSL 的标准方法。 当我删除这些配置时,我能够获取消息并使用它们。

config.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL")
config.put("ssl.keystore.location", "location_to/abc.keystore.jks"); //
config.put("ssl.keystore.password", "pwd1122");
config.put("ssl.truststore.location", "location_to/serv.truststore.jks");
config.put("ssl.truststore.password", "pwd11223");

When i remove these configs, i am able to get the messages and consume[r] them.

这仅仅意味着代理未配置 SSL - 客户端和服务器必须同意使用或不使用 SSL。

如果代理配置了 SSL 侦听器,它必须在另一个端口上。