Did anyone succesfully use Kafka API with SASL Configuration?
This is what I have tried: (like in the documentation)
I get no messages but tSC is:
tSC="0 "_$lb($lb(8104,"<GATEWAY> java.lang.OutOfMemoryError java.nio.Bits.reserveMemory(Unknown Source) Direct buffer memory",,,,,,,,$lb(,"USER",$lb("e^OnAsStatus+1^%Net.Remote.Exception.1^1","e^AsStatus+1^%Exception.AbstractException.1^1","e^ReceiveMessage+5^%External.Messaging.Client.1^1","e^CreateConsumer+18^myKafka^1","d^^^0","E^^myKafka^0","d^^myKafka^0","E^^myKafka^0","d^^myKafka^0","E^^myKafka^0","d^^myKafka^0","E^^myKafka^0","d^^^0","E^^myKafka^0","d^^^0"))))/* FEHLER #8104: Gateway-Ausnahme: <GATEWAY> java.lang.OutOfMemoryError java.nio.Bits.reserveMemory(Unknown Source) Direct buffer memory *
I am not sure if the connection is working anyway? How could I check this?
CreateSettings
Set settings = ##class(%External.Messaging.KafkaSettings).%New()
Set settings.username = "username"
Set settings.password = "password"
Set settings.servers = "server<:9094"
quit
CreateConsumer
Set client = ##class(%External.Messaging.Client).CreateClient(settings, .tSC)
Set consumerSettings = "{""key.deserializer"":""org.apache.kafka.common.serialization.StringDeserializer""}"
set sasl="""listener.name.sasl_ssl.scram-sha-512.sasl.jaas.config"":""org.apache.kafka.common.security.scram.ScramLoginModule required username=\""username\"" password=\""password\"";"
Set adminSettings = "{"_sasl_""",""security.protocol"":""SASL_SSL"",""ssl.protocol"":""TLSv1.3"",""sasl.mechanism"":""SCRAM-SHA-512""}"
Set tSC = client.UpdateAdminConfig(adminSettings)
w "adminConfig:",tSC,!
Set tSC = client.UpdateConsumerConfig(consumerSettings)
Set rset = ##class(%External.Messaging.KafkaReceiveSettings).%New()
Set rset.pollTimeout = 2000
Set tSC = client.ReceiveMessage("bsiakbwe-m1", .messages, rset.ToJSON())
For i=1:1:messages.Size {
Set msg = messages.GetAt(i)
Write "Message: ", msg.ToJSON(), !
}
q
ObjectScriptObjectScript
Hello, Helmut. I also tried to integrate IRS with Kafka. My problem is our cluster requires SCRAM-512 authentication. Apparently IRIS only offers SASL plain without tls encryption. I just entered an enhacement idea here:
https://ideas.intersystems.com/ideas/DPI-I-484
Hello Oliver, my cluster is using SASL_Plain.
Would be great, if you could send me your code. So I could look if I generally do it right.
Thanks a lot
Helmut
@Oliver Wilms thank you for creating the idea on the Ideas Portal related to this discussion.