[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-24 Thread Andrew Schenck
Ya that's what I was attempting to use, but I think I am doing something fundamentally wrong. These flows and graphs are still new to me... I tried: first to create the consumer source: (with offset atomic long setting to keep track of the offset in the most basic way) Source

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-24 Thread Julian Howarth
https://github.com/akka/reactive-kafka makes it pretty easy to use Kafka as a Source and then it will get broadcast to all connected clients On Monday, April 24, 2017 at 4:08:31 PM UTC+1, Andrew Schenck wrote: > > Wow that's a pretty neat solution thanks! > > It does achieve what I want, now I

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-24 Thread Andrew Schenck
Wow that's a pretty neat solution thanks! It does achieve what I want, now I wonder could the source be a kafka source? So whenever something is writing to a kafka topic it could be sent to the WS... On Friday, April 21, 2017 at 6:09:19 PM UTC-5, Julian Howarth wrote: > I may have

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-24 Thread 'Johannes Rudolph' via Akka User List
Thanks Julian for sharing the example. Indeed, using the BroadcastHub is the recommended way to implement something like this. On Saturday, April 22, 2017 at 1:09:19 AM UTC+2, Julian Howarth wrote: > > I may have misunderstood what you want to achieve, but you don't have to > use actors if

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-21 Thread workingdog
Hi Andy, I made a server (Play/Akka/websocket) that receives and sends json messages to clients at: https://github.com/workingDog/mikan This may give you some ideas for publish/subscribe using the actor model. On Saturday, 22 April 2017 06:38:11 UTC+9, Andrew Schenck wrote: > > I also found

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-21 Thread Julian Howarth
I may have misunderstood what you want to achieve, but you don't have to use actors if you'd prefer to just use akka-http / akka-streams. As long as you can provide the data you want to broadcast in the form of an akka-streams Source, it is straightforward to connect that to websocket clients

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-21 Thread Andrew Schenck
I also found out I can simply do PubRef.tell(msg) and it will send the message to the client. So this is pretty much what that one post described. Just wanted to make sure if anyone came across this issue they had all the information I've found. -- >> Read the docs:

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-21 Thread Andrew Schenck
So I am not sure but I think this is doing what I wanted to accomplish, the flow is public Flow createWebSocketFlow() { pub = system.actorOf(Props.create(AbsPublisher.class)); System.out.println("out actor ref: " + pub.path().name());

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-21 Thread Andrew Schenck
To maybe further elaborate on what I've attempted... I read a response that the gist of being able to 'server push' a message to a client was to first "do an ActorPublisher to push the msg to client, then create