How Orleans can be used in an IoT project? #7258
Replies: 3 comments 10 replies
-
Hi @staviloglu, I would generally use an If anyone has opinions here, please feel free to chime in. I'll convert this to a discussion, since I think it's more suited for that |
Beta Was this translation helpful? Give feedback.
-
I am thinking of using HostedService as an MQTT Broker and accessing Grains directly using GrainFactory. instead of using ClusterClient. I'm not sure at this point that this approach will allow the MQTT Broker to become a cluster. If not, is there another way to do clustering?Using Stateless Worker Grains? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi.
First of all thanks for the Orleans framework. I appreciate your efforts to make distributed application development a lot easier.
Orleans seems to be an exact match for IoT business where we need device twins on backend.
But unfortunately I can not seem to find a suitable example rather than the old GPS Tracker example which is working with an HTTP Frontend.
I was wondering if you could point me in the right direction and your thoughts on the following architectures that come to my mind.
I will use RabbitMQ and its MQTT Plugin to support MQTT connections from the devices on the field. They will periodically publish sensor data to given topics.
1- Each grain can create its own connection + channel and subscribe/publish to related queue on RabbitMQ. This does not seem to be a reasonable solution to me, because each device already makes connections if the device twins do that too we double the connection count which will lead to performance loss on RabbitMQ.
2- Each silo will have 2 connections (one for publish and one for subscribe) but each grain will create their own channels using the shared connections. This solution is ok for connection count but increase in channel count creates a lot less but almost the same effect on RabbitMQ. And how should I share the connections (1 stateless worker, IHostedService, GrainService?) Pooling connections come to my mind but first need to be sure.
3- I may create different processes for subscribing and publishing, each create their own connections and subscribe/publish to RabbitMQ. When a message arrived I can use GrainClient to send data to Orleans cluster. That seems totally fine to me, this way I can scale subscription process seperate from the silos. But I'm not sure how can I publish from grains to RabbitMQ which requires orleans to communicate with the publisher process. (gRPC etc? Orleans streams?)
4- I may have the subscriber process mentioned above but rather than a seperate publisher process, each grain can create their connection + channel and publish the data when required. And close the connection + cannel. Or share one connection per silo but seperate channel opened/closed in each grain.
5- Stream Providers? I have seen some documentation about pulling agents but I want to use RabbitMQ push based. I have seen Stream provider for RabbitMQ bu I think that does not solve the problem here. Am I wrong?
Tihs is might be too much to ask and time consuming to read. :(
Hope to see an answer from your side.
Thanks for your time.
Beta Was this translation helpful? Give feedback.
All reactions