-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Updating from 4.2.1 to 5.1.0 introduces issue with MessageReceiver #25375
Comments
@JoshLove-msft So I have an internal property on my function that I set in the test with a mock so that I can verify completed or deadlettered was called as expected: I did make some progress with the ServiceBusMessageActions but am struggling to find how to add the retryOptions to my host.json file. For some reason Visual Studio is reporting invalid values (even if I use the example on the microsoft page) https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus#additional-settings-for-version-5x For version 4.2.1 I was using: But trying to add the clientRetryOptions like so:
|
@JoshLove-msft - I am also facing similar issue with being able to mock I see that all of the methods on this Most of the other SDK classes like Appreciate your help, this is blocking us from migrating to .net6.0 and v4 azure functions. |
Yes, it looks like we are missing the mocking constructor for the actions types - we will get this added in an upcoming release. |
Thank you, would it be possible to give an ETA on the next release cycle? |
Will have to get back to you on this. When do you need this by? |
@JoshLove-msft any ideas on my config errors I was getting or should I create a different thread? Keen on knowing the ETA for the next release cycle too as that's a blocker for us upgrading. |
Hi @jenp-jb, I will try to repro this and get back to you. |
A new release is available with the constructors required for mocking - https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus/5.2.0 Regarding the schema validation, I was able to reproduce this and will look into getting this fixed. |
MessageReceiver provided APIs to manually renew the message lock token using |
Hi @jenp-jb. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “ |
Hi @jenp-jb, since you haven’t asked that we “ |
Query/Question
Upgrading the extension nuget package from 4.2.1 to 5.1.0 resulted in IMessageReceiver and MessageReceiver in my function / class becoming unknown. I use this in order to be able to Complete and Deadletter messages according to our logic as some failures will never succeed so there's no point retrying.
I tried to fix this by installing the deprecated Microsoft.Azure.ServiceBus nuget package 5.2.0. This allows for the code to be compiled but running the function gives me the error:
Microsoft.Azure.WebJobs.Host: Error indexing method 'XXX'. Microsoft.Azure.WebJobs.Host: Can't bind parameter 'messageReceiver' to type 'Microsoft.Azure.ServiceBus.Core.MessageReceiver'.
The reason I use IMessageReceiver is for moq unit test purposes so I can assert that a message was completed/deadlettered as expected.
Whilst there is documentation on how to instantiate a MessageReceiver - I can't seem to find any reference to accessing it within the ServiceBusTriggered Function.
It doesn't seem like MessageReceiver is part of the newer Azure.Messaging.ServiceBus package as I explored using that as well.
Environment:
-Visual Studio 16.11.5
The text was updated successfully, but these errors were encountered: