Pick a protocol by the interaction you need: request/response, streaming, real-time push, messaging or file transfer.
Need an answer now?REST / gRPC
Push to a browser live?WebSocket / SSE
Tell a partner something happened?Webhook / event
Decouple internal systems?AMQP / Kafka
Big daily volume?SFTP batch file
.NET 10 How to implement it
| Protocol | Package | Notes |
| REST | built-in minimal APIs / controllers, HttpClient; Microsoft.AspNetCore.OpenApi | Default choice for public and partner APIs |
| gRPC | Grpc.AspNetCore, Grpc.Net.Client, Grpc.Net.ClientFactory | Browser access: Grpc.AspNetCore.Web; expose as REST too: Microsoft.AspNetCore.Grpc.JsonTranscoding |
| GraphQL | HotChocolate.AspNetCore | Server, with DataLoader to avoid N+1 queries |
| SOAP | Server: CoreWCF.Http. Client: System.ServiceModel.Http + dotnet-svcutil | svcutil generates the client from the WSDL |
| WebSocket / SSE | built-in UseWebSockets, TypedResults.ServerSentEvents; SignalR (built-in) | See 2.6 for details |
| AMQP / Kafka / MQTT | Azure.Messaging.ServiceBus, RabbitMQ.Client, Confluent.Kafka, MQTTnet | Messaging and event streaming clients |
| SFTP / FTPS / SMTP | SSH.NET, FluentFTP, MailKit | File transfer and email. Don't use the old SmtpClient; Microsoft recommends MailKit |
AS2/AS4 has no well-known free .NET library. It is usually handled by an MFT or B2B gateway product, not app code.
REST, gRPC, GraphQL, WebSocket, SSE, Webhooks, AMQP, Kafka, SFTP… which one? 🤔
Ask one question: what interaction do I need?
✅ Answer now → REST / gRPC ✅ Live push → WebSocket / SSE ✅ "Something happened" → Webhook / Event ✅ Decouple → Queue ✅ Bulk → File
The protocol follows the interaction, not the hype.
#Integration #APIs #Architecture