❔ 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
where is the question? 🙂
Sorry if my question was not clear. How can I send a message to the ServiceBus topic from the controller?
Check out MassTransit library, it's recommended by Microsoft
Introduction
What is MassTransit
I can't find specific to topics and subscriptions and don't get how I can implement it into my web api
see configuration in https://masstransit.io/documentation/configuration
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).
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...
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
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.