Revise pulsar
This MR revises parts of the pulsar configuration such that we can now also use other systems than pulsar. The ModuleConfig
does not inherit the PulsarConfig
anymore but instead, it takes it as a parameter in the messaging_config
. This let's exchange it with different classes for connecting to the message brokers.
I also added a new class here, the WebsocketURLConfig
as an alternative to the PulsarConfig
. The WebsocketURLConfig
just takes a websocket_url
(instead of namespace
, tenant
, etc.) and attaches a topic to it. This can be used together with the dasf-broker-django
for instance.
Further changes:
- The
demessaging.PulsarMessageConstants.PulsarConfigKeys
got depreceated. ThePulsarConnection
instead now just takes pydantic modelsPulsarConfig
(orWebsocketURLConfig
) as it is. - the call to the
main
function is notmain(topic="...")
anymore, but insteadmain(messaging_config(topic="..."))
. The same is true for all other attributes of thePulsarConfig
(this was necessary as theModuleConfig
does not inherit thePulsarConfig
anymore. I added depreceations. - The command-line-interface does now support the
--websocket-url
argument (e.g.python ExampleMessageConsumer.py --websocket-url ws://localhost:8081
). If this is specified, we will use aWebsocketURLConfig
instead of aPulsarConfig
.
Edited by Philipp S. Sommer