3

The question has been raised before as to if we can use Python to access Message Hub. The answer was generally no until a SASL implementation was written in Python.

Now, there is a pure Python SASL called pure-sasl!, is it now possible to call Message Hub through Python?

Does anyone in the community have examples?

Aaron B
  • 143
  • 7

2 Answers2

2

Update:

Since then, we've released a sample application demonstrating how to use Python to access with Message Hub: https://github.com/ibm-messaging/message-hub-samples/tree/master/kafka-python-console-sample

Yes it should be possible to use this library to connect to Message Hub.

Message Hub uses the SASL PLAIN mechanism to perform authentication. As this mechanism is not yet officially supported by Kafka, there's no Kafka clients out there that currently implement it. However, as Message Hub uses standard SASL PLAIN, it is possible to write one if you want. Any SASL library that implements this mechanism can be used.

SASL PLAIN requires a username and a password. You can get these values from the VCAP_SERVICES variable.

Mickael Maison
  • 18,458
  • 7
  • 48
  • 49
1

Just in addition to Mickael's answer, we're working with the Kafka community to get other SASL methods supported in Kafka base. This is being done under KIP 43 (https://cwiki.apache.org/confluence/display/KAFKA/KIP-43%3A+Kafka+SASL+enhancements). Once this is accepted into a release of Kafka, we'll update Message Hub to use this community supported mechanism, but we'll still support the existing mechanism for some time in the future.

Oliver Deakin
  • 209
  • 1
  • 8