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
So in v3 under channel you need to provide a list of messages ad s key/value, where key is unique messageId
What is the use case for still having messageId in a Message Object then?
From current description, messageId on Message Object level is to Unique string used to identify the message so like it was before v3. But when I'm sharing messages across documents, I think better to treat key of the message under channel messages as unique identifier.
Let's take the opportunity and remove it now. Otherwise, we would have to deprecate it and carry it until v4. I say not to complicate our lives in v3 with messageId. If we see a use case for it afterward, we add it back (maybe with a different name to avoid confusion). Adding is easy.
@jonaslagoni@smoya can you folks confirm how complicated will that be (removal of messageId now) from parser perspective. In latest parser, what is considered to be messageId?
Spec says below, and it is in case of Messages under a Channel.
There is one problem if we remove messageId from Message object. That if someone uses AsyncAPI as a collection of messages, without channels, they do not have a way to assign a unique messageId
Prior to removing messageId, the id for those messages will be the one on that field, fallbacking to other options (See next point I'm commenting).
However, what would be the expected message id for the messages under the channel if we remove the messageId field? one or two will be, even though they are pointing to #/components/messages/{userSignedUp|userSignedUpWithExpandedData}.
Would you then consider channel one is different from userSignedUp one just because the key on that messages map is different?
@jonaslagoni@smoya can you folks confirm how complicated will that be (removal of messageId now) from parser perspective. In latest parser, what is considered to be messageId?
I don't think it is hard. However, this is the current logic:
This double messageId identifier actually makes a bit of mess, but I would support @smoya point about potentially different messageId in channel object and in message object or even different messageId for the same message object in different channel objects.
For me as template maintainer and from programming point of view, it's more logical to rely on messageId in the message object to name the object (by means of programming language). Why I should name the object different (by messageId from channel object) if it's the same object underneath?
So, I would create an object (by means of programming language) with name from messageId in the message object and MAY BE create an empty extensions objects (by means of programming language) which will simply inherit original object with names from messageId in channel object.
Also, the point I would like to highlight, that Operation Object doesn't have a map and simply use the list of message objects which is nice and do not make any disruption.
Just want to remark that being able to set the message ID in place by one or two can also be a great feature. It lets you add IDs that are custom to your document and make sure it doesn't change when the referenced message changes, which may be on a external file/url.
And also would love to remind that for code generation purposes, we have the name property already.
Activity
jonaslagoni commentedon Oct 10, 2023
I stand pretty firm not to alter v3 at all.
fmvilas commentedon Oct 27, 2023
Let's take the opportunity and remove it now. Otherwise, we would have to deprecate it and carry it until v4. I say not to complicate our lives in v3 with
messageId. If we see a use case for it afterward, we add it back (maybe with a different name to avoid confusion). Adding is easy.derberg commentedon Oct 30, 2023
@jonaslagoni @smoya can you folks confirm how complicated will that be (removal of
messageIdnow) from parser perspective. In latest parser, what is considered to bemessageId?Spec says below, and it is in case of

Messagesunder aChannel.There is one problem if we remove
messageIdfromMessageobject. That if someone uses AsyncAPI as a collection of messages, without channels, they do not have a way to assign a uniquemessageIdsmoya commentedon Oct 30, 2023
Considering the following doc:
Prior to removing
messageId, the id for those messages will be the one on that field, fallbacking to other options (See next point I'm commenting).However, what would be the expected message id for the messages under the channel if we remove the
messageIdfield?oneortwowill be, even though they are pointing to#/components/messages/{userSignedUp|userSignedUpWithExpandedData}.Would you then consider channel
oneis different fromuserSignedUpone just because the key on thatmessagesmap is different?I don't think it is hard. However, this is the current logic:
Note that
this._meta.idis the key on the key/val map if exists (I think always in the case of v3).jonaslagoni commentedon Oct 30, 2023
Just another breaking changes, which of course will cause break stuff here and there 😄
Tenischev commentedon Nov 2, 2023
This double
messageIdidentifier actually makes a bit of mess, but I would support @smoya point about potentially differentmessageIdinchannel objectand inmessage objector even differentmessageIdfor the samemessage objectin differentchannel objects.For me as template maintainer and from programming point of view, it's more logical to rely on
messageIdin themessage objectto name the object (by means of programming language). Why I should name the object different (bymessageIdfromchannel object) if it's the same object underneath?So, I would create an object (by means of programming language) with name from
messageIdin themessage objectand MAY BE create an empty extensions objects (by means of programming language) which will simply inherit original object with names frommessageIdinchannel object.Also, the point I would like to highlight, that Operation Object doesn't have a
mapand simply use thelistofmessage objects which is nice and do not make any disruption.fmvilas commentedon Nov 2, 2023
Following Sergio's example:
Just want to remark that being able to set the message ID in place by
oneortwocan also be a great feature. It lets you add IDs that are custom to your document and make sure it doesn't change when the referenced message changes, which may be on a external file/url.And also would love to remind that for code generation purposes, we have the
nameproperty already.So yeah, I'm all in for removing
messageId.fmvilas commentedon Nov 3, 2023
BTW, I'm picking up this issue and I commit to have it done by next week.
fmvilas commentedon Nov 3, 2023
PR for the spec: #984. Will follow up with PRs for parser-js and JSON Schemas.
fmvilas commentedon Nov 3, 2023
So here's the full list of PRs:
fmvilas commentedon Nov 6, 2023
Added the PR to fix the converter to the list above.
fmvilas commentedon Nov 7, 2023
I'm closing this issue as it's been addressed already. Thanks for the fast reviews and support 🙏
WaleedAshraf commentedon Jul 20, 2024
Eh, I missed this conversation.
messageId was really useful for tooling. It was added here: asyncapi/parser-js#414
The main difference between
messageIdandnamewas the messageId was to be machine-readable and unique across the complete document.