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

MessageSender abstraction is broken for Path when Send-Via is used #6031

Closed
SeanFeldman opened this issue Sep 12, 2018 · 12 comments
Closed

MessageSender abstraction is broken for Path when Send-Via is used #6031

SeanFeldman opened this issue Sep 12, 2018 · 12 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Service Attention Workflow: This issue is responsible by Azure service team. Service Bus
Milestone

Comments

@SeanFeldman
Copy link
Contributor

Actual Behavior

MessageSender supports Send-Via feature. Send-Via is using a transfer queue to route message to their final destination when using transactional processing. The abstraction is represented by a public overload of MessageSender that takes in two paths

  1. entitytPath
  2. viaEntityPath
    https://github.com/Azure/azure-service-bus-dotnet/blob/e278f87b0b3aa563ab055918e988baec9ec155a3/src/Microsoft.Azure.ServiceBus/Core/MessageSender.cs#L127-L135

The abstraction has been copied from the old client and works, but it's broken when Path and TransferDestinationPath are queried back. That's because all public overloads are invoking an internal overload, swapping the two paths:
https://github.com/Azure/azure-service-bus-dotnet/blob/e278f87b0b3aa563ab055918e988baec9ec155a3/src/Microsoft.Azure.ServiceBus/Core/MessageSender.cs#L132

where internal overload is
https://github.com/Azure/azure-service-bus-dotnet/blob/e278f87b0b3aa563ab055918e988baec9ec155a3/src/Microsoft.Azure.ServiceBus/Core/MessageSender.cs#L137-L144

assigning viaEntityPath to this.Path and entityPath to this.TransferDestinationPath. Which is inverted.

Expected Behavior

Path and Send-Via/TransferDestinationPath after MessageSender constructor is invoked should be identical to the values passed in.

Repro

LinqPad repro script attached.

var sender1 = new MessageSender(connection, "path");
sender1.Path.Dump("Should be 'path'");
Assert.IsNull(sender1.TransferDestinationPath); // green

var sender2 = new MessageSender(connection, "path", "intermediate");
Assert.AreEqual("path", sender2.Path); // red, equals to "intermediate"
Assert.AreEqual("intermediate", sender2.TransferDestinationPath); // red, equals to "path"

Recommendations

The fix should be released as a major version for the following reasons:

  1. This is a breaking change. While a fix will restore the correct behaviour, it will affect any existing solution relying on the incorrect implementation.
  2. Anyone implementing a workaround will be broken if they update to a patch/minor.
@SeanFeldman
Copy link
Contributor Author

Added a validation PR against master to confirm this behaviour

@binzywu
Copy link
Contributor

binzywu commented Sep 12, 2018

Thank you @SeanFeldman for reporting this.

@SeanFeldman
Copy link
Contributor Author

@nemakam this will be handled in 4.0.0?

@nemakam
Copy link
Contributor

nemakam commented Sep 28, 2018

Yes

@AlexGhiondea AlexGhiondea transferred this issue from Azure/azure-service-bus-dotnet May 1, 2019
@triage-new-issues triage-new-issues bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label May 1, 2019
@AlexGhiondea AlexGhiondea added Client This issue points to a problem in the data-plane of the library. Service Bus labels May 1, 2019
@triage-new-issues triage-new-issues bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label May 1, 2019
@SeanFeldman
Copy link
Contributor Author

@jsquire @AlexGhiondea have you had a chance to triage this one? This is a client bug.

@AlexGhiondea
Copy link
Contributor

@SeanFeldman we will consider this for the next release of the Service Bus client. We currently do not have a release date for when that is going to be.

@SeanFeldman
Copy link
Contributor Author

@AlexGhiondea note that this will be a breaking change and will require a new major.
In that case, you might want to introduce other breaking changes, such as #6037.

@SeanFeldman
Copy link
Contributor Author

@AlexGhiondea any updates about next (major) release and when this will be addressed?

@SeanFeldman
Copy link
Contributor Author

@AlexGhiondea @jsquire would be nice to label this issue as bug to indicate what it is. Thank you.

@AlexGhiondea AlexGhiondea added bug This issue requires a change to an existing behavior in the product in order to be resolved. Service Attention Workflow: This issue is responsible by Azure service team. labels Jun 20, 2019
@AlexGhiondea
Copy link
Contributor

/cc @Binzy @nemakam

@jfggdl jfggdl added this to the Sprint 157 milestone Jul 16, 2019
nemakam added a commit that referenced this issue Jul 17, 2019
…er (#6941)

Fixing #6031 
In the case of Via-Sender defined by 
`viaSender = new MessageSender(connection, "path", "via")`,

1. Path will now point to wherever the amqp-link is created to.
2. viaEntityPath will point to via entity.
3. TransferDestinationPath will point to the final destination of the message
@nemakam
Copy link
Contributor

nemakam commented Jul 17, 2019

Closed in #6941

@nemakam nemakam closed this as completed Jul 17, 2019
@SeanFeldman
Copy link
Contributor Author

Needs to be a minor with the change made in PR.
#6941 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Service Attention Workflow: This issue is responsible by Azure service team. Service Bus
Projects
None yet
Development

No branches or pull requests

5 participants