Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
413 stars 181 forks source link

Azure Service Bus output binding for Azure Functions is limited to message body #2360

Open ChuckJonas opened 2 years ago

ChuckJonas commented 2 years ago

The way the service bus output bindings are implement seem to only support the message body... You can't set messageId, sessionId, applicationProperties, etc. This makes it useless almost any real world use cases.

Are there plans to properly implement this binding?

Found these related "User Voice" issues, but they are stale and have no comments addressing this issue:

https://feedback.azure.com/d365community/idea/eea36d62-f224-ec11-b6e6-000d3a4f0da0 https://feedback.azure.com/d365community/idea/df849c4f-f224-ec11-b6e6-000d3a4f0da0

ramya894 commented 1 year ago

@ChuckJonas We will check this with our next level team and update you with the information.

chrisaliotta commented 1 year ago

I would love for this issue to get some attention. We use sessions with Azure Service Bus messaging and would like to use the attribute output binding functionality.

I'd like to propose that returning an object of type ServiceBusMessage with those attributes set would be one possible solution when considering how to implement this with output bindings.

bhagyshricompany commented 1 year ago

It sounds like you are suggesting that an output binding for Azure Service Bus messaging be created that allows for setting attributes on a ServiceBusMessage object. This could be a useful feature for those using sessions with Azure Service Bus messaging, as it would allow them to easily set attributes on the messages they send. However, I am not aware of any plans to implement this feature at this time. will check with our next level team

dengere commented 1 year ago

I am really wondering that extensions ServiceBus is version="5.7.0" but it does not encapsulate ServiceBus functionality and capability already. Who can guess which version will be eligible for Azure Service Bus?

Please follow this step. 1 . create Queue on the Azure.

  1. You will see on the create panel "Enable Sessions" (bingo!) click it.
  2. Try to send any message to this queue with ServiceBusOutput.

I bet you can not send.

All people last 4 years ask this simple question. If someone know solution with ServiceBusOutput I'd like to know it.

akisiel1 commented 1 year ago

Same problem, couldn't find any other workaround then sending a message with Sender instead of output biding...

jhofer commented 1 year ago

We had the same Issue. Would realy help if it would be possible to return an instance of ServiceBusMessage

chrisaliotta commented 1 year ago

Can anyone identify where the response object is being created/handled in the dotnet code? From what I've seen is that there are several "extension classes" that are used, but I've been having a hard time finding the actual factory/builder classes for these different trigger and response types. If anyone can help me find where this occurs, I wouldn't be against trying to write the code to get this feature to work (who knows, it might actually get accepted!).

bhagyshricompany commented 1 year ago

@fabiocav pls comment and validate.

sudeep1607 commented 1 year ago

Is it possible to set the contentType for a message as text/plain while using Service Bus output bindings in Function Apps?

Petit-Pas commented 1 year ago

I have an Azure function which I'm upgrading to Isolated mode in .Net 7. The function was listening from a topic, then reposting the message in a queue with sessions enabled.

The migration of the listening part went just fine, but when the function returns, I get an error stating that the sessionId has an invalid value, and that it should be defined when posting to a queue. Problem is, nothing changed in the code that generates the message, and I though ServiceBusMessage would be supported just the way it was before, so I have an output binding with [ServiceBusOutput] set on a List of ServiceBusMessage, but then I guess that it just gets deserialized as any object and the metadata is ignored...

Is there at least any work around for this ? I don't mind not being able to play with the output binding, but if there is no way to specify the SessionId, this is really making the isolated mode unusable for certain workflows.

alex-quest commented 11 months ago

Any progress on this issue?

Scooper2 commented 10 months ago

Last week the Microsoft team added support for message settlement within isolated Azure Functions. (issue https://github.com/Azure/azure-functions-dotnet-worker/issues/226). After this release I was testing if all requirements for my projects are met when using isolated functions instead of inproc, but unfortunately I came across the shortcoming mentioned in this thread.

I really need to be able to control the metadata on my output messages (setting label, application properties, scheduled visibility, and so on).

Any information on when we can return a ServiceBusMessage (actually an array of those) from our Azure Function trigger?

DinoSourcesRex commented 6 months ago

Any update on this? I am migrating things to dotnet-isolated and I would really love this feature.

dengere commented 6 months ago

Unfortunately, there isn't any progress, but I managed to handle it temporarily with a workaround. I opened a channel queue on the resumer and attempted to clear it out. Of course I lost my chance woth the mq thought...

On Thu, Feb 22, 2024, 4:20 PM Dino @.***> wrote:

Any update on this? I am migrating things to dotnet-isolated and I really would like to avoid having to setup a service bus sender if possible.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-functions-dotnet-worker/issues/2360, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMBD4PR5IM6DNF5U33EXM3YU5AZTAVCNFSM6AAAAAAQDLFQYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGQ2DEMZTGY . You are receiving this because you commented.Message ID: @.***>

cannehag commented 5 months ago

Are there still no progress on this issue? The functionality to be able to output an entire ServiceBusMessage have been around for ages and is really importande in some scenarios. In my case controlling serialization AND setting a schedule enqueue time. Having to manually use a servicebus client to output this will mess up the code and is a step backwards compared to the support that was already there in in-process mode.

SamVanhoutte commented 3 weeks ago

I cannot believe these extremely fundamental and basic functionalities are not provided yet?