C
C#9mo 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_F9mo ago
where is the question? 🙂
McMahone
McMahone9mo ago
Sorry if my question was not clear. How can I send a message to the ServiceBus topic from the controller?
David_F
David_F9mo ago
Check out MassTransit library, it's recommended by Microsoft
McMahone
McMahone9mo 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_F9mo 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_F9mo 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
McMahone9mo 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
Accord9mo 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.