Skip to content

Comments

Extend EventData with AmqpAnnotatedMessage#22314

Merged
conniey merged 39 commits intoAzure:mainfrom
v-hongli1:issue#21717
Jul 9, 2021
Merged

Extend EventData with AmqpAnnotatedMessage#22314
conniey merged 39 commits intoAzure:mainfrom
v-hongli1:issue#21717

Conversation

@v-hongli1
Copy link
Contributor

@v-hongli1 v-hongli1 commented Jun 16, 2021

  1. Fix issue Extend EventData with AmqpAnnotatedMessage #21717
  2. Changed files:
    1. sdk/eventhubs/azure-messaging-eventhubs/migration-guide.md
    2. sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventData.java
    3. sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java
    4. sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubMessageSerializer.java
    5. sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/BackCompatTest.java
    6. sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataTest.java
    7. sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubMessageSerializerTest.java
    8. sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java
    9. sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/InteropAmqpPropertiesTest.java
    10. sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/TestUtils.java

@jongio, @conniey for notification

@ghost ghost added Event Hubs customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jun 16, 2021
@ghost
Copy link

ghost commented Jun 16, 2021

Thank you for your contribution hongli750210! We will review the pull request and get back to you soon.

@v-hongli1 v-hongli1 marked this pull request as ready for review June 17, 2021 02:59
Copy link
Contributor

@YijunXieMS YijunXieMS left a comment

Choose a reason for hiding this comment

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

  1. EH EventData and SB Message have similar stuffs but also many different properties. We need to remove what is not need for EventData.
  2. The changes on the systemProperties looks pretty risky. Is it possible to keep existing stuffs and only expose new APIs?

Copy link
Member

Choose a reason for hiding this comment

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

This should be the message id. We're not exposing user id as a top-level property.

Copy link
Member

@conniey conniey left a comment

Choose a reason for hiding this comment

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

In general, please do not remove or add properties that are not described by the issue: #21717

v-hongli1 and others added 10 commits July 1, 2021 11:22
…r issue#21717 Extend EventData with AmqpAnnotatedMessage by lihong 202106161656
…r issue#21717 Extend EventData with AmqpAnnotatedMessage by lihong 202106161801
…r issue#21717 Extend EventData with AmqpAnnotatedMessage by lihong 202106161820
…c) for issue#21717 Extend EventData with AmqpAnnotatedMessage by lihong 202106301016
…c) for issue#21717 Extend EventData with AmqpAnnotatedMessage by lihong 202106301030
@check-enforcer
Copy link

check-enforcer bot commented Jul 1, 2021

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 java - [service] - ci

*/
public EventData(byte[] body) {
this(BinaryData.fromBytes(Objects.requireNonNull(body, "'body' cannot be null.")));
this.systemProperties = new SystemProperties();
Copy link
Member

Choose a reason for hiding this comment

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

Since AmqpAnnotatedMessage exposes byte[] as the body, I felt like it was best to store it as such rather than BinaryData that we were using before to stop a lot of the conversions to and from BinaryData.

Copy link
Member

Choose a reason for hiding this comment

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

@conniey, @yijun: This looks like SystemProperties is a copy of data that also appears on the AmqpAnnotatedMessage instance. Since the AmqpAnnotatedMessage instance is fully mutable, if callers change the data there, then the EventData projection is no longer accurate and you've got drift....

Am I overlooking something?

Copy link
Contributor

@YijunXieMS YijunXieMS left a comment

Choose a reason for hiding this comment

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

LGTM

@conniey
Copy link
Member

conniey commented Jul 9, 2021

/azp run java - eventhubs - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@conniey conniey enabled auto-merge (squash) July 9, 2021 15:34
@conniey conniey merged commit 5b16856 into Azure:main Jul 9, 2021
@conniey conniey deleted the issue#21717 branch July 9, 2021 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants