-
Notifications
You must be signed in to change notification settings - Fork 184
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
ServiceBusSessionMessageActions not working with IsBatched=true #2873
Comments
Duplicate of #2815 |
@Meorir please see the issue I duplicated this to - you are experiencing the same problem, source gen is not running for your project. |
Re-opening, looked into this a bit more and I think there is a gap with batched receive and |
@Meorir I have identified a gap in our binding support here. Combining session, batch, and IssueServiceBusSessionMessageActionsConverter says it supports |
Description
When trying to bind
ServiceBusSessionMessageActions sessionActions
while having IsBatched = true
causes this error:
Result: Function 'ServiceBusHandler', Invocation id '5dae4abd-65bf-434d-97f9-ad28900a6c2d': An exception was thrown by the invocation. Exception: Microsoft.Azure.Functions.Worker.FunctionInputConverterException: Error converting 1 input parameters for Function 'ServiceBusHandler': Cannot convert input parameter 'sessionActions' to type 'Microsoft.Azure.Functions.Worker.ServiceBusSessionMessageActions' from type 'System.String'. Error:System.InvalidOperationException: Expecting SessionId within binding data and value was not present. Sessions must be enabled when binding to ServiceBusSessionMessageActions.
I assume batch processing in session enabled subscription (or queue) should be locked to a single session per invocation due to session locks.
[Function("ServiceBusHandler")]
public async Task ServiceBusHandler(
[ServiceBusTrigger("%ServiceBusTopicName%",
"%ServiceBusSubscriptionName%",
Connection = "ServiceBusConnectionString",
IsSessionsEnabled = true,
AutoCompleteMessages = false,
IsBatched = true)]
ServiceBusReceivedMessage[] messages,
ServiceBusMessageActions messageActions,
ServiceBusSessionMessageActions sessionActions
)
When using with single message everything works fine.
(except SetSessionStateAsync not accepting null as parameter, and not allowing to clear session state, but that is another bug)
Steps to reproduce
Create a trigger for session-enabled ASB subscription:
[Function("ServiceBusHandler")]
public async Task ServiceBusHandler(
[ServiceBusTrigger("%ServiceBusTopicName%",
"%ServiceBusSubscriptionName%",
Connection = "ServiceBusConnectionString",
IsSessionsEnabled = true,
AutoCompleteMessages = false,
IsBatched = true)]
ServiceBusReceivedMessage[] messages,
ServiceBusMessageActions messageActions,
ServiceBusSessionMessageActions sessionActions
)
After invocation the mapping throws an error
The text was updated successfully, but these errors were encountered: