This repository contains Azure Service Bus samples implemented in F# using the Azure Service Bus client library for .NET. I started from the C# samples, using functional F# idioms where relevant, but always trying to keep the original structure so that it is easier from someone coming from C# to see how to implement such code in F#. So far, I have got the following samples:
- Get started with Service Bus queues, the C# tutorial is here, follow the setup instructions there to make this sample work
- The src/CoreQueueSenderApp folder contains a console app which sends 10 messages to a Service Bus queue, please replace the
serviceBusConnectionString
andqueueName
string values with the ones in your services bus account and queue, as explained in the setup instructions, then executedotnet run
on this folder - The src/CoreQueueReceiverApp folder contains a console app which processes the messages sent by previous app to a Service Bus queue, please replace the
serviceBusConnectionString
andqueueName
string values with the ones in your services bus account and queue, as explained in the setup instructions, then executedotnet run
on this folder
- The src/CoreQueueSenderApp folder contains a console app which sends 10 messages to a Service Bus queue, please replace the
- Get started with Service Bus topics and subscriptions, the C# tutorial is here, follow the setup instructions there to make this sample work
- The src/CoreTopicSenderApp folder contains a console app which publishes 10 messages to a Service Bus topic, please replace the
serviceBusConnectionString
andtopicName
string values with the ones in your services bus account and topic, as explained in the setup instructions, then executedotnet run
on this folder - The src/CoreTopicReceiverApp folder contains a console app which subscribes to the topic on the previous app, please replace the
serviceBusConnectionString
,topicName
andsubscriptionName
string values with the ones in your services bus account, topic, and subscription respectively, as explained in the setup instructions, then executedotnet run
on this folder
- The src/CoreTopicSenderApp folder contains a console app which publishes 10 messages to a Service Bus topic, please replace the
- Get started sending and receiving messages from Service Bus queues, based on this sample. This is basically the same sample as the first one, but consolidated in one single console app that does both jobs: sending messages to a queue and consuming them concurrently in independent threads. It is an interesting example for comparing C# async/await with F# async computations.
- To execute this sample get into the src/BasicSendReceiveQuickStart folder and enter
dotnet run -ConnectionString "your-service-bus-connection-string" -QueueName "your-service-bus-queue"
- To execute this sample get into the src/BasicSendReceiveQuickStart folder and enter
- Auto-Forward, based on this sample.The sample shows how to automatically forward messages from a queue or topic into another queue.
- For compiling this sample you need both the src/AutoForward and src/Common folders side by side.
- You need to set up a Service Bus account and queues correctly, you can see how to do this here
- Furthermore, you need to set up the AutoForwardTargetQueue, the AutoForwardSourceTopic, and the Forwarder subscription, as described in the template down this readme.md file.
- After successfully completing these steps, get into the src/AutoForward folder and enter
dotnet run
- DuplicateDetection, based on this sample.The sample shows duplicate message detection performed by the Service Bus queue, by way of sending two messages with the same id and seeing the app process only the first one, as the second one is discarded by the queue.
- For compiling this sample you need both the src/DuplicateDetection and src/Common folders side by side.
- You need to set up a Service Bus account and queues correctly, you can see how to do this here
- After successfully completing the previous setup, get into the src/DuplicateDetection folder and enter
dotnet run
Comments and suggestions welcomed, especially about which additional examples you would like to see implemented from the Azure Service Bus samples repo.