AKKA FSM ( Java ) Design guide line

74 views
Skip to first unread message

Mahesh Govind

unread,
Jan 30, 2016, 12:08:18 PM1/30/16
to Akka User List
Dear Experts ,

Could you please help me  with some design guideline for designing an FSM for a network protocol based on Actors .
( I am newbie to AKKA  hence requesting help )

My Scenario     .
I have to implement a protocol to manage various devices in the network .

How do i model the scenario . Do I need to create actor for each of the devices .( Which stores the states for each of the devices )

Do we have some example for a similiar  problem ?

Thanks in advance ...

regards
Mahesh


Brian Topping

unread,
Jan 30, 2016, 12:39:47 PM1/30/16
to Akka User List
Hi Mahesh, welcome to Akka.

If you have multiple devices, you are right to think about this with multiple actors. Think about those actors as proxies for the internal device state of each device. To whatever degree your system must react to the changes in those devices, your proxies will be the first to detect the changes in each device. And for each of those device types, there is an individual FSM that allows you to track them.

What I think you are also asking is to do something with that information, You don't have enough information here to give strong guidance, but the theory is the same. Once you have proxies for all the devices in the form of actors in a system, it is a far easier modeling job for additional actors to orchestrate a view. If the proxy actors understand the state of individual devices, these "orchestration actors" can show the overall network. Imagining there is a UI, the network graph would talk to the orchestration actor to draw the graph, talking to each proxy actor for information like uptime, other devices they are connected to, etc, but at the level of the proxy, not by talking to the device when that graph needs to be drawn. 

Spend time understanding supervision and monitoring. I mentioned this idea a network graph UI. Imagine the whole idea of that graph is live updates and that many people could watch the same graph on their screens with different reasons for links between devices to be highlighted (one user might want a flashing link when the network is down, another might want to see a flashing link when data is moving across it). This is the correct use for another actor, one for each user view, and by using monitoring, the view actor can start with basic information about any changes in existence of a proxy for that view. Monitoring at the Akka level does not send state change events (that's for you to work out), but does deal with the existential problem of whether an actor has suddenly died.

That should get you started...

Brian

Brian Topping

unread,
Jan 30, 2016, 8:00:42 PM1/30/16
to akka...@googlegroups.com
Mahesh, You might also want to look at the slides Konrad just posted from Japan: http://www.slideshare.net/ktoso/zen-of-akka. They will explain better what I referred to here. 

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/17KDkHngoeQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Mahesh Govind

unread,
Jan 31, 2016, 8:43:54 PM1/31/16
to Akka User List
Thanks ...
Reply all
Reply to author
Forward
0 new messages