-
Hi, I have inherited a partly/mostly written python Unix app which uses this FastKafka module. I was given a user name and password which the app's Producer presumably needs to send messages to the remote Kafka server. But nothing I can see in the FaskKafka code or documentation, nor AIOKafka which I gather FastKafka wraps, mentions user names and passwords! I know little about Kafka, but I gather there is something called SASL which can configure this via a file. I would prefer to use environment variables if possible, and specify these items in the code like my other connect parameters, e.g.: ` def get_default_config(self):
(Although this config says "local broker", the URL is actually remote, in a development staging area.) I am not fussy though. So I would very much appreciate it is someone could indicate the recommended way to specify these items. TIA |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 7 replies
-
Hello @Jrqz, I have noticed that your staging Kafka setup likely includes security measures such as usernames, passwords, and encryption. In light of this, the code to initialize the FastKafka object should resemble the following:
In the provided code, the I'd like to note that FastKafka is built on top of the AIOKafka project. If you wish to pass more arguments to AIOKafka, you can easily refer to AIOKafka's producer documentation and supply these arguments as keyword arguments during the initialization of the FastKafka object. Please review the code and make any necessary adjustments based on your specific setup. If you have any further questions or concerns, feel free to ask. |
Beta Was this translation helpful? Give feedback.
Hi!
The failing of tester because of the hyphen in the topic name has been fixed in https://github.com/airtai/fastkafka/issues/472
You can expect it to be working in the next release :)
About the producers_store: the second element in the producers_list is a reference to the concrete producer, this is set to None when you create your application by design, when FastKafka app is started, it will call a populate_producers method which will then replace this None value with the Producer object.