#208 Parse fedmsg messages correctly.
Merged 9 months ago by jkaluza. Opened 10 months ago by ralph.

@@ -86,18 +86,8 @@ 

              raise ValueError(

                  'The messaging format "{}" is not supported'.format(conf.messaging_backend))

  

-         # Fallback to message['headers']['message-id'] if msg_id not defined.

-         if ('msg_id' not in message and

-                 'headers' in message and

-                 "message-id" in message['headers']):

-             message['msg_id'] = message['headers']['message-id']

- 

-         if 'msg_id' not in message:

-             raise ValueError(

-                 'Received message does not contain "msg_id" or "message-id": '

-                 '%r' % (message))

- 

          inner_msg = message.get('body')

+         inner_msg = inner_msg.get('msg', inner_msg)

          return message["topic"], inner_msg

  

      @retry(wait_on=RuntimeError)

I ran into this setting up odcs stg for @otaylor and @cverna (OSBS).

If this, then why were all the things done with msg_id above?

Why is msg_id important? Will message['body']['msg'] have it?

I ... don't know. :( It seems to be dropped/ignored. Maybe this was copied from a different codebase and has lost its relevance?

I'm inclined to remove it. Let's wait for @cqi, @qwan, or @jkaluza to weigh in, though.

Yes, the lines of 'msg_id' comes from code of freshmaker (freshmaker create events with these message ids), it's unused in odcs, I think we can remove these lines.

1 new commit added

  • Remove unused msg_id checking.
10 months ago

Pull-Request has been merged by jkaluza

9 months ago