Skip to content

Lower the priority of the EntityType used by ServiceBusTemplate #45417

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

moarychan
Copy link
Member

@moarychan moarychan commented May 21, 2025

Description

Cherry-pick from #45011 and fix compatibility-tests failures

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Copilot Copilot AI review requested due to automatic review settings May 21, 2025 00:54
@github-actions github-actions bot added the azure-spring All azure-spring related issues label May 21, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the entity type handling in ServiceBusTemplate by lowering the priority of the provided EntityType and ensuring that the producer and consumer factories only override the entity type when it is not already set.

  • Change the parameter passed to createProducer and createReceiver in ServiceBusTemplate from defaultEntityType to currentEntityType.
  • Update conditional logic in producer and consumer factories to only set the entity type if it isn’t already defined.
  • Update CHANGELOG to reflect the bug fix.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/core/ServiceBusTemplate.java Update sender and receiver client creation to use currentEntityType
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/core/DefaultServiceBusNamespaceProducerFactory.java Add conditional check for entityType assignment in producer properties
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/core/DefaultServiceBusNamespaceConsumerFactory.java Add conditional check for entityType assignment in consumer properties
sdk/spring/CHANGELOG.md Update changelog to document the bug fix in entity type priority
Comments suppressed due to low confidence (1)

sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/core/ServiceBusTemplate.java:157

  • Consider adding unit tests to verify the behavior when entityType is already set in properties versus when it is provided externally, ensuring both sender and receiver use the correct entity type.
public <U> ServiceBusReceivedMessage sendAndReceive(String destination,...

@moarychan moarychan marked this pull request as draft May 21, 2025 06:34
@moarychan moarychan marked this pull request as ready for review May 21, 2025 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant