orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Orleans Reliable Stream Providers - SMS and Persistent Stream Provider

Open mvbaffa opened this issue 11 years ago • 6 comments

Hi,

I am reading about Orleans Streams. This a great feature. As far as I could understand Orleans currently ships with SMS and Azure Queue Stream Provider.

According to the text SMS message delivery is best effort. That is the message can be lost. To Deploy on premise I cannot use Azure Queue, so I have to develop a Stream Provider using other queue technology.

Is there any example of a Custom Stream Provider, using for instance Apache Kafka or any other ?

Thanks in advance

mvbaffa avatar May 05 '15 22:05 mvbaffa

Hi. Great question. SMS is indeed best effort over TCP (over Orleans messaging). BUT: By default it is not fire and forget. What that means is that the producer (the side that publishes events via OnNextAsync call) gets the task back that represent both the delivery and the processing by the consumer. So if the consumer does not get this event (message lost) or the consumer throws, the SMS producer gets the exception back. You can optionaly configure this to be fire and forget true and then you really get best effort without the way to know if it was processed or not. With fire and forget false (the default) you can now built your own reliability/retry logic. If for example the data comes from the front end client, you can re-throw it back to the client and he can retry or what ever. So there are ways to build a reliable delivery with SMS as well.

If you want to use queues, then we have just refactored the part we call queue adapters. It means you do not need to write a full blown stream provider. You can use our built in Persistent Stream Provider and only write the relatively small part that abstracts the actual queue - IQueueAdapter interface. You basically just need to implement the raw queue transport - how to put and get msg to the queue. All the rest is done by the persistent stream provider. To write a new queue adapter take a look at the built in AzureQueueAdapter.

For Kafka you will need C# Kafka client. I know people tried that, unrelated to Orleans, but not sure how far is that. You can use Azure Events Hubs instead.

And BTW, to Deploy on premise, of course you can use Azure Queues. You don't have to run in Azure to use Azure storage services.

gabikliot avatar May 05 '15 22:05 gabikliot

Hi,

Well as you can see I have very little experience with Azure. if I can use Azure Queues on Premise that's solved.

I know this is not an Orleans issue but can you send me a reference of how to deploy Azure Queues, or any other Azure features on Premise. I have read that Microsoft is deploying Azure Stack on Premise but I am assuming this is not affordable.

I will Google it but if you could help me I would appreciate.

Thanks

mvbaffa avatar May 05 '15 22:05 mvbaffa

Azure Queues do not need to be deployed. It is an Azure Based Storage service, it is just a service. You access it remotely, from the internet, or from within the Azure Cloud, in the same way, via either REST API or the built in C# wrappers over REST APIs. For you to use Azure queue stream provider with Orleans, all you need is a storage account with Azure and you are ready to go.

gabikliot avatar May 05 '15 22:05 gabikliot

Sorry I am not an expert in Azure but of course I know that. I had a trial account and I have used also Visual Studio Azure SDK. But I do not have an Azure account and most of my users will not use their data in the cloud.

My application if for financial market and they typically do not put their data outside their servers.

I will use Orleans on Premise, so I will not have Azure Queues. Except if Microsoft, as published, release the Azure Stack to be installed on Premise, and this is affordable, what I strongly doubt.

So returning to my original question, do you have an example of IQueueAdapter.

Thanks

mvbaffa avatar May 05 '15 23:05 mvbaffa

Yes, we have an example of IQueueAdapter, it is the AzureQueueAdapter. You can follow this example to write your own Kafka based or what ever IQueueAdapter.

gabikliot avatar May 05 '15 23:05 gabikliot

Thank you again

mvbaffa avatar May 05 '15 23:05 mvbaffa