jenkinsci / jms-messaging-plugin

https://plugins.jenkins.io/jms-messaging
12 stars 37 forks source link

messageId property has malformed format #218

Closed Andrei-Stepanov closed 2 years ago

Andrei-Stepanov commented 3 years ago

Hello,

The bug is in RabbitMQ part of this plugin. Messages sent with jms-messaging-plugin to RabbitMQ fedora broker have incorrect messageId property. Property messageId has prefix : year-UUID. This is bug.

From : https://fedora-messaging.readthedocs.io/en/stable/wire-format.html#message-id

The message ID field MUST be a version 4 UUID as a standard hexadecimal digit string (e.g. f81d4fae-7dec-11d0-a765-00a0c91e6bf6)

https://github.com/jenkinsci/jms-messaging-plugin/blob/master/plugin/src/main/java/com/redhat/jenkins/plugins/ci/messaging/data/RabbitMQMessage.java#L75

has code:

daee7469 (Oliver Gondža 2020-09-01 20:52:34 +0200 75)             this.msgId = Calendar.getInstance().get(1) + "-" + UUID.randomUUID().toString();

What impact is:

More info you can find at: https://pagure.io/fedora-infrastructure/issue/10084

olivergondza commented 2 years ago

No idea why it is being done this way: https://github.com/jenkinsci/jms-messaging-plugin/pull/154/files#diff-55442404b12c5e36812d6d2244165fb065f02677aa22a00fc7df400e4b4011b2R98

@Zlopez, what is the motivation to prefix the auto-generated IDs? Thanks!

Zlopez commented 2 years ago

@olivergondza If you look at message in datagrepper you can see that message id is prefixed by year, not sure why, but I try to mimic the fedora messaging publisher behavior as best as I can. It's possible that the year is added by rabbitmq server latter and the publisher shouldn't do it.

If the year is causing problem, it could be probably safely removed.