Kafka
Forwarding
For the moment, the solution supports Kafka only as a southbound communication protocol.
Early implementations to have Kafka as a northbound protocol were already been made but not tested.
Topic regex pattern
In the current implementation, the solution uses one consumer per channel, and each consumer will use regex wildcard patterns to subscribe to different topics, which enables a consumer to read messages from different topics belonging to different tenants.
For example, a consumer subscribing with a topic pattern like "^.\\.ppmp\\.v3\\.message$" would be able to consume incoming messages from the following tenants: 7311ea8c-5d48-43fe-acf9-980eedf24b6c and baf04077-a3c0-454b-ac6f-9fec00b8e170
-
7311ea8c-5d48-43fe-acf9-980eedf24b6c .ppmp.v3.message
-
baf04077-a3c0-454b-ac6f-9fec00b8e170 .ppmp.v3.message
Further improvements & suggestions
Config & initialization
-
In the current implementation, we are having one subscriber per channel. These are hard coded in the appsettings.json. One suggestion would be to have these subscribers get generated more dynamically at startup depending on the number of the channels.
-
If the topics are not already created in the broker, the Kafka broker will return a warning when subscribing to them. This warning will get intercepted by the used library (
Foundation.Components.Messaging) and get logged as an error, which is noticeable at the startup logs.