--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
Is there a reason why the client's couldn't just members of the cluster itself, and then you could broadcast (http://doc.akka.io/docs/akka/2.2.0/scala/routing.html#broadcast-messages) the message? It's how I would envision solving this.
On Tuesday, August 13, 2013 5:37:45 PM UTC-4, Derek wrote:What is the recommended approach for using distributed pub/sub between a server and rich, Java (Swing) clients? I'd like the clients to subscribe to topics to which the server publishes.I have looked at the Cluster Client referenced below but it appears that it only supports sending/publishing from client to the server but not the other way around. Is there any way for clients to subscribe to cluster topics externally?Would appreciate suggestions if there are better options for pushing messages from a server to subscribed Java clients. Thanks.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
On Wednesday, August 14, 2013 2:51:04 PM UTC-5, Björn Antonsson wrote:Hi Derek,On Tuesday, 13 August 2013 at 23:37, Derek wrote:
What is the recommended approach for using distributed pub/sub between a server and rich, Java (Swing) clients? I'd like the clients to subscribe to topics to which the server publishes.I have looked at the Cluster Client referenced below but it appears that it only supports sending/publishing from client to the server but not the other way around. Is there any way for clients to subscribe to cluster topics externally?Would appreciate suggestions if there are better options for pushing messages from a server to subscribed Java clients. Thanks.There actually seems to be a way to register an actor using the cluster client as a topic subscriber to the PubSubMediator.To do this you would have to register the PubSubMediator to itself (by using Put, or ClusterReceptionistExtension(system).registerService) to make it available to cluster clients. The default mediator in the DistributedPubSubExtension, ends up at the path /user/distributedPubSubMediatorYou would then send a Subscribe("topic", actorRef) wrapped inside a Send to the path "/user/distributedPubSubMediator", to register the actorRef as a subscriber to the topic.
Bjorn, Derek, et al,Perhaps I am missing something, but do we need clustering here at all? Clustering is still an experimental module, and Akka, of course, fully supports remote (and location-transparent) Actors out of the gate - isn't that all that's needed?
Here is one scenario:- On the server exists a Publisher Actor- When a client comes into existence, it creates an Actor system, a Subscriber Actor, and pings the Publisher with this reference, which then adds the Subscriber to its list of Routees. (Or, instead of the Publisher managing its Subscribers manually, we could probably use a Router that would send each pub-sub message as a Broadcast.)- To handle reconnects, the Subscribers Watch the Publisher. If it terminates, they start attempting reconnect at intervals until successful.Is this workable?
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
On Thursday, 15 August 2013 at 21:54, paul.fo...@gmail.com wrote:
Hello Bjorn,Thanks for the reply - can you please tell me if you see any holes in the simple system I proposed? Thanks much.On Thursday, August 15, 2013 1:39:52 PM UTC-5, Björn Antonsson wrote:Hi Paul,On Thursday, 15 August 2013 at 15:59, paul.fo...@gmail.com wrote:Bjorn, Derek, et al,Perhaps I am missing something, but do we need clustering here at all? Clustering is still an experimental module, and Akka, of course, fully supports remote (and location-transparent) Actors out of the gate - isn't that all that's needed?The clustering is not experimental as of Akka 2.2.0.Of course you don't need the cluster to do a client server implementation, I think that the thing here was to try to leverage existing code that gave you a more robust solution than a single server.B/Here is one scenario:- On the server exists a Publisher Actor- When a client comes into existence, it creates an Actor system, a Subscriber Actor, and pings the Publisher with this reference, which then adds the Subscriber to its list of Routees. (Or, instead of the Publisher managing its Subscribers manually, we could probably use a Router that would send each pub-sub message as a Broadcast.)
- To handle reconnects, the Subscribers Watch the Publisher. If it terminates, they start attempting reconnect at intervals until successful.
Is this workable?
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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/5sWghsQF9oc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
Hi Patrik,Today I have implemented a very simple solution as laid out by Bjorn, Paul, etc. above. It is a basic client-server pub/sub that utilizes a server-side actor that maintains it's own set of "subscribers". When clients come online they send a subscribe message to the server. Both client and server watch each other - so that the client knows if the server goes down and therefore must initiate a reconnect and so that the server knows when a client has terminated so that it can remove it from its subscribers. Surprising how little code is needed. Now, as you guys pointed out, this leaves us with a SPOF but that is ok for us for now.
Given my experience from today, I now know that it's ~trivial to set up this type of watch & re-connect behavior. What I have not done is explore further into the Cluster Client. If I understand what you guys had suggested earlier about the PubSubMediator registering with the Receptionist, etc., it sounds to me like that should all work (but I won't be trying it out for the moment b/c we are not running a server cluster yet--a project for another day!).
One quick question for you -- if using Cluster Client and registering client subscribers with the pub sub mediator, when a client is terminated is it automatically cleaned up on the server side? This is something I need to do "manually" (via watch) with what I got working today.