Managing Kafka users
The Kafka data bus is used for streaming messages. To access the message queue in the Kafka cluster's topics, you must first create a user. You assign roles to users, which determine their ability to read and send messages in a topic. You can assign a role to a user and grant access:
- for a single topic;
- multiple topics by prefix;
- all topics.
Create a user
- In the Dashboard, on the top menu, click Products and select Managed Databases.
- Open the Active tab.
- Open the database cluster page → Users tab.
- Click Create User.
- Enter a username and password. Save the password — it will not be stored in the dashboard.
- Click Create.
Change user password
After the cluster is created, the user password can be changed. Do not forget to update the password in your application.
- In the Dashboard, on the top menu, click Products and select Managed Databases.
- Open the Active tab.
- Open the cluster page → Users tab.
- In the menu for the user, select Change Password.
- Enter or generate a new password and click Save.
User roles
Users can have the following roles:
- consumer — receives and processes messages from a topic to which they have access;
- producer — sends messages to a topic to which they have access.
Read more in the Apache Kafka documentation for the consumer and the producer.
Grant access to a user
-
In the Dashboard, on the top menu, click Products and select Managed Databases.
-
Open the Active tab.
-
Open the cluster page → Users tab.
-
In the menu for the user, select Configure accesses.
-
Choose the topic access type:
- by prefix — to multiple topics identified by a repeating start of their name;
- by name — to a specific topic. Available only if topics have been created;
- all topics.
-
If you selected access by topic prefix, enter the prefix in the Value field.
-
If you selected access by topic name, select the topic name in the Value field.
-
Select a user role. You can assign one or two roles to a user.
-
Click .
-
To grant a user multiple access rules, click Add Access and repeat steps 5-9.
Change user access
In the access row, you can only change the role. If you need to change the access type or value, delete the access row you want to fix and add a new access rule.
- In the Dashboard, on the top menu, click Products and select Managed Databases.
- Open the Active tab.
- Open the cluster page → Users tab.
- In the menu for the user, select Configure accesses.
- To change the role, click in the access row.
- Change the role.
- Click .