C
C#14mo ago
McMahone

❔ Sending a message to ServiceBus topic from ASP.NET Web API controller

Hello, I want to send a simple message to ServiceBus topic from a ASP.NET Web API. I created a very simple customer controller which includes (name, last name, email and phone) and made HttpGet request, which I tested with Postman. I have already created a servicebus namespace, topic name and subscription on Azure. My next task is to use azure function app to take the message from the topic subscription and stored into a blob storage. Thanks in advance!
9 Replies
David_F
David_F14mo ago
where is the question? 🙂
McMahone
McMahoneOP14mo ago
Sorry if my question was not clear. How can I send a message to the ServiceBus topic from the controller?
David_F
David_F14mo ago
Check out MassTransit library, it's recommended by Microsoft
McMahone
McMahoneOP14mo ago
I can't find specific to topics and subscriptions and don't get how I can implement it into my web api
David_F
David_F14mo ago
Configuration
MassTransit is usable in most .NET application types. MassTransit is easily configured in ASP.NET Core or .NET Generic Host applications (using .NET 6 or later).
David_F
David_F14mo ago
Modern .NET Messaging using MassTransit - Events
A modern look at messaging, and how MassTransit provides a consistent programming model on top of Azure Service Bus, Azure Event Hub, and other transports such as RabbitMQ, ActiveMQ, and Amazon SQS. By decoupling services from the message transport, services are more portable and can be unit tested in-memory.https://aka.ms/dotNETConf2021-GetdotN...
McMahone
McMahoneOP14mo ago
Thanks for the info. I think I got it finally, but now I have another problem I get http error 405 But I am able to send it to the service bus and when I peek the messsge, it shows the correct data
Accord
Accord14mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server