You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i wish to listen to topic, but not to hardcode it to code, because the prefix may differ.
i solved this in my project this way:
def__init__(self, hub):
# I'm only interested in messages from CVSself.topic=self.abs_topic(hub.config, "cvs.commit")
super(CVS2SlackConsumer, self).__init__(hub)
# no proper way to configure just topic suffix# https://github.com/fedora-infra/fedmsg/pull/428defabs_topic(self, config, topic):
""" prefix topic with topic_prefix and environment config values """topic_prefix=config.get('topic_prefix')
environment=config.get('environment')
return"%s.%s.%s"% (topic_prefix, environment, topic)
please provide official support for such approach, perhaps just implement abs_topic()fedmsg.consumers.FedmsgConsumer until new config system is in place.
i'm duplicating this logic in consumers i write for now, which is just bad practice.
The text was updated successfully, but these errors were encountered:
This makes sense to me. A pattern I've seen through-out Fedora's consumers is a "Am I in dev/stg/prod? search-and-replace the topic I listen to" approach which is not very pleasant.
spew from #428
i wish to listen to topic, but not to hardcode it to code, because the prefix may differ.
i solved this in my project this way:
please provide official support for such approach, perhaps just implement
abs_topic()
fedmsg.consumers.FedmsgConsumer
until new config system is in place.i'm duplicating this logic in consumers i write for now, which is just bad practice.
The text was updated successfully, but these errors were encountered: