-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[service-bus] Add support for sending AmqpAnnotatedMessage (and control destination section of body) #14703
Conversation
the body is encoded in the sent message (via the `bodyType`) field.
/azp run js - service-bus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, especially for a preview.
export function isRheaAmqpSection( | ||
possibleSection: any | RheaAmqpSection | ||
): possibleSection is RheaAmqpSection { | ||
return possibleSection != null && typeof possibleSection.typecode === "number"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt it also have a "content"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean this?
/** @internal */
export function isRheaAmqpSection(
possibleSection: any | RheaAmqpSection
): possibleSection is RheaAmqpSection {
return (
possibleSection != null &&
typeof possibleSection.typecode === "number" &&
isDefined(possibleSection.content)
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to that.. let me know what you think.
return ( | ||
possibleSection != null && | ||
typeof possibleSection.typecode === "number" && | ||
isDefined(possibleSection.content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for the content
to be null/undefined? What if I had sent a message with no body, but all other properties set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd leave out the content check . We could possibly improve this by making sure typecode is one of the 3 values we accept, otherwise I think it's a "good enough" check for something used internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked.. it can be undefined/null.
One observation.. If set undefined and sent, it comes back as null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the check to make sure the received typecode is of the expected ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this in the preview!
Hello @HarshaNalluru! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
#14703 missed a few things while translating Annotated message into RheaMessage. This PR attempts to fill the gaps.
Adding in support to send AmqpAnnotatedMessage and also to control where the body is encoded in the sent message (via the
bodyType
) field.