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

Dummy messenger should log the messages #543

Merged
merged 2 commits into from
Mar 1, 2018

Conversation

lubomir
Copy link
Member

@lubomir lubomir commented Feb 28, 2018

Instead of ignoring them all, it should log them. This can be easily disabled in the LOGGING settings by adding following snippet:

'pdc.apps.utils.messaging': {
    'level': 'WARNING',
}

JIRA: PDC-2583


def send_message(self, topic, msg):
pass
logger.info('Sending to %s:\n%s' % (topic, json.dumps(msg, sort_keys=True, indent=2)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't msg already string?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, it is. That will have to change probably.

For some messaging backends it may not be necessary to do the encoding
(e.g. fedmsg), and it's simpler when creating the message.
Instead of ignoring them all, it should log them. This can be easily
disabled in the LOGGING settings by adding following snippet:

    'pdc.apps.utils.messaging': {
        'level': 'WARNING',
    }

JIRA: PDC-2583
@lubomir
Copy link
Member Author

lubomir commented Mar 1, 2018

I added another commit that encodes the message to JSON only in the messenger. This saves us the parsing in Fedmsg, and will be needed for UMB to construct the headers based on message data.

Copy link
Contributor

@hluk hluk left a comment

Choose a reason for hiding this comment

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

Nice.

@lubomir lubomir merged commit 2eac15c into product-definition-center:master Mar 1, 2018
@lubomir lubomir deleted the debug-messenger branch March 1, 2018 11:51
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.

None yet

2 participants