dapr / dotnet-sdk

Dapr SDK for .NET
Apache License 2.0
1.12k stars 340 forks source link

Unable to use EventHub or Service Bus Dapr Component #1268

Open mshashi0306 opened 7 months ago

mshashi0306 commented 7 months ago

Hi Team,

I am not able to use Event Hub Binding or Service Bus using Dapr component.

But same connectivity is working using TransportType = AmqpWebSockets using .NET lib.

Can someone help me to achieve the same using Dapr Config i.e. use of TransportType in dapr

philliphoff commented 7 months ago

@mshashi0306 Can you be more specific about what you've tried, what error or unexpected behavior you're getting, and what versions of Dapr runtime, Dapr SDK, and .NET you're using. Dapr logs are often helpful (set --log-level debug), too. A sample project that produces the issue is even better.

mshashi0306 commented 3 months ago

Hi @philliphoff,

I am using Dapr.AspNetCore version 1.30.0 and trying to configure the transport type for the Service Bus component, but it's not working as expected.

The following code works correctly with standard .NET code:

var clientOptions = new ServiceBusClientOptions(); clientOptions.TransportType = ServiceBusTransportType.AmqpWebSockets;

I am attempting to set the transportType : AmqpWebSockets in the metadata of the Service Bus component, but this configuration does not seem to be effective.

For reference, here is the documentation for ServiceBusTransportType: https://learn.microsoft.com/en-us/dotnet/api/azure.messaging.servicebus.servicebustransporttype?view=azure-dotnet

WhitWaldo commented 1 month ago

@mshashi0306 Dapr isn't a full-feature replacement for the various vendor-specific SDKs and instead is a generalized abstraction. I don't see anything in the current binding implementation documentation for a Service Bus queue or in the pubsub documentation for queues or topics that would suggest support for the transport type you're looking for.

If it's something you really need and feel like contributing, we'd be happy to take a look at such a pull request, but I don't believe this is something that's currently supported.