built-in kafka support #1654
Answered
by
carltongibson
aryaniyaps
asked this question in
Ideas
|
I was thinking if channels could support kafka built-in. (The kafka-python client installation is optional, but we'll warn if any KafkaWebsocketConsumer is used without the package). This way, projects can start using kafka immediately and will have horizontal scalability. I was thinking that the kafka consumers and producers could be modified by these settings. # settings.py
CHANNELS_KAFKA = {
'cluster': 'localhost:4327',
'consumers': {},
}class KafkaWebsocketConsumer(WebsocketConsumer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
try:
# kafka support is optional
import kafka-python
except ImportError:
raise AssertionError(
'kafka-python is not installed.'
'kafka websocket consumers will not be supported.'
)this way, projects can choose between the groups API or kafka as the message distribution system. I just wanted to ask, is this worth doing? |
Answered by
carltongibson
Mar 8, 2021
Replies: 1 comment 1 reply
|
Happy to link to a third party package, but not a consumer I'd want to support in channels itself. |
1 reply
Answer selected by
aryaniyaps
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Happy to link to a third party package, but not a consumer I'd want to support in channels itself.