Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add RabbitMQ message header to "rasa export" #5318

Merged
merged 7 commits into from Feb 26, 2020
Merged

add RabbitMQ message header to "rasa export" #5318

merged 7 commits into from Feb 26, 2020

Conversation

ricwo
Copy link
Contributor

@ricwo ricwo commented Feb 25, 2020

Proposed changes:

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@ricwo ricwo requested a review from wochinge February 25, 2020 20:25
rasa/core/exporter.py Outdated Show resolved Hide resolved
rasa/core/exporter.py Outdated Show resolved Hide resolved
Copy link
Contributor

@wochinge wochinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR 🚀
One question: When an EventConsumer needs to know this, how would it e.g. work for the KafkaEventBroker? Or maybe the part I'm missing is, what does the EventConsumer then do with it?

`PikaEventBroker`, else `None`.

"""
if isinstance(self.event_broker, (PikaEventBroker, PikaProducer)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: you could use issubclass and just check against PikaEventBroker which would be a tiny bit more robust


"""
if isinstance(self.event_broker, (PikaEventBroker, PikaProducer)):
return {RASA_EXPORT_PROCESS_ID_HEADER_NAME: uuid.uuid4().hex}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: we could also just have this constant at the top of the this module since it's not used anywhere else

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, you're using this in Rasa X? Then it makes sense to have this in rasa.core.constants


"""
if isinstance(self.event_broker, (PikaEventBroker, PikaProducer)):
self.event_broker.publish(event=event, headers=headers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: Should we make the headers an attribute so that we don't have different signatures? Also, I guess the headers wouldn't change between messages, right?

@wochinge
Copy link
Contributor

Ok, just saw the telemetry issue. Then my questions are answered 👍 Good to go!

@tmbo tmbo merged commit ebfcfc9 into master Feb 26, 2020
@tmbo tmbo deleted the export-header branch February 26, 2020 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tag events published through rasa export
3 participants