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

[Service Bus] [Core AMQP] Merge AmqpMessage{Header|Properties} exported from both the libraries #12091

Merged
28 commits merged into from
Oct 29, 2020

Conversation

HarshaNalluru
Copy link
Member

@HarshaNalluru HarshaNalluru commented Oct 27, 2020

Issue #12004

Previously

// Service Bus
AmqpAnnotatedMessage {
 header: AmqpMessageHeader;
 properties: AmqpMessageProperties;
}
AmqpMessageHeader {}
AmqpMessageProperties {}
// Core AMQP
      Imports 
       MessageProperties as AmqpMessageProperties and 
       MessageHeader as AmqpMessageHeader
      from rhea and re-exports them 
       (Have `underscore`s in the attributes instead of camel-case for the props from rhea)
// Exports new MessageProperties and new MessageHeader too (these are similar to AmqpMessage{Header|Properties} defined in service-bus)

Updates

  • Re-exporting rhea types as RheaAmqpMessage{Header|Properties} instead of AmqpMessage{Header|Properties} from core-amqp Removed these re-exports
  • Renamed Message{Header|Properties} to AmqpMessage{Header|properties} in core-amqp (still being exported)
  • Deleted the AmqpMessage{Header|properties} defined in service-bus and using AmqpMessage{Header|Properties} from core-amqp instead
  • Re-exporting AmqpMessage{Header|properties} from core-amqp in service-bus
  • Should we consider it non-breaking for core-amqp?
    • API shape has been changed for core-amqp
    • Event-hubs doesn't use any of the interfaces or types specified above, so it is not affected
    • Service Bus V1 uses amqp-common, so not affected
    • Only Service Bus V7 is affected(still in preview)

@ramya-rao-a
Copy link
Contributor

I would recommend to take this opportunity to have a v2 for @azure/core-amqp and clean up as many things as possible (not in this PR, but future PRs before Service Bus GA)

@check-enforcer
Copy link

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run js - [service] - ci

@HarshaNalluru HarshaNalluru marked this pull request as ready for review October 28, 2020 23:24
@HarshaNalluru
Copy link
Member Author

/azp run js - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

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

Please pin the version of core-amqp in event hubs and service bus packages as we are using the preview version. Other than that, this looks good.

@@ -438,7 +438,7 @@ export interface ServiceBusReceivedMessage extends ServiceBusMessage {
* @property {AmqpMessage} _amqpMessage The underlying raw amqp message.
* @readonly
*/
readonly _amqpAnnotatedMessage: AmqpAnnotatedMessage;
readonly _amqpAnnotatedMessage?: AmqpAnnotatedMessage;
Copy link
Contributor

Choose a reason for hiding this comment

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

Making this optional will not be an accurate representation of a received message. I would recommend reverting the commit a745549 and revisiting the refactoring later.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

## 2.0.0-beta.1 (Unreleased)

- `AmqpAnnotatedMessage` interface that closely represents the AMQP annotated message from the [AMQP spec](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-message-format) has been added. New `AmqpMessageHeaders` and `AmqpMessageProperties` interfaces(properties with camelCasing) have been added in the place of re-exports from "rhea" library(properties with snake_casing).
[PR 12091](https://github.com/Azure/azure-sdk-for-js/pull/12091)
Copy link
Contributor

Choose a reason for hiding this comment

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

Love the changelog update. Its perfect :)

@@ -8,13 +8,13 @@ import { AbortSignalLike } from '@azure/abort-controller';
import { AccessToken } from '@azure/core-auth';
import { AmqpError } from 'rhea-promise';
import { Message as AmqpMessage } from 'rhea-promise';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can we keep this as Message and not use the Amqp prefix here? Everywhere else where we use the Amqp prefix, we are referring to the type/interface defined in core-amqp which has camel casing. Where as this AmqpMessage is from rhea-promise. To be consistent with MessageHeader and MessageProperties from rhea-promise, this should just Message as well

Copy link
Contributor

Choose a reason for hiding this comment

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

We either do that or use the Rhea prefix

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking it, but refrained from doing since it would change service-bus and event-hubs.
But it is probably worth doing it.. will do!

@ghost
Copy link

ghost commented Oct 29, 2020

Hello @HarshaNalluru!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants