我已经在python中使用了这段代码,我需要将它转换成nodejs,但是我找不到sasl_oauth_token_provider这个属性的任何等效代码。
import time
from kafka import *
from kafka.errors import KafkaTimeoutError
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
producer = KafkaProducer(bootstrap_servers='x
我们使用的sasl机制是SCRAM-SHA-256,但是卡夫卡制片人只接受sasl_mechanism作为PLAIN、GSSAPI、OAUTHBEARER。
下面的配置将给出错误
sasl_mechanism must be in PLAIN, GSSAPI, OAUTHBEARER
配置
ssl_produce = KafkaProducer(bootstrap_servers='brokerCName:9093',
security_protocol='SASL_SSL',
我想要做的是- For Clients to Broker communication - use OAUTHBEARER authentication
For Broker to Broker communication - use PLAIN authentication 我有以下JAAS配置: {
KafkaServer {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="inter"
password="inter-secret