Skip to content

Revise pulsar

Philipp Sommer requested to merge revise-pulsar into master

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. The PulsarConnection instead now just takes pydantic models PulsarConfig (or WebsocketURLConfig) as it is.
  • the call to the main function is not main(topic="...") anymore, but instead main(messaging_config(topic="...")). The same is true for all other attributes of the PulsarConfig (this was necessary as the ModuleConfig does not inherit the PulsarConfig 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 a WebsocketURLConfig instead of a PulsarConfig.
Edited by Philipp Sommer

Merge request reports

Loading