Hi Roland,

I followed up very close the full example of the Akka HTTP JS chat in Scala 
but I couldn't translate it to Java with my little knowledge of Scala and 
Akka Streams/HTTP, are there parts of it that are not fully implemented for 
Java?

Any hints? I'm quite stuck at the moment.

https://github.com/jrudolph/akka-http-scala-js-websocket-chat/tree/master/backend/src/main/scala/example/akkawschat

Best regards and thanks a lot,

Best regards,

Guido.

On Thursday, August 13, 2015 at 7:28:06 AM UTC+1, Akka Team wrote:
>
> Hi Guido,
>
> for server-sent events (i.e. SSE) there is this example 
> <https://github.com/hseeberger/akka-sse/blob/master/akka-sse-example/src/main/scala/de/heikoseeberger/akkasse/example/TimeServer.scala>,
>  
> although it only covers the case where the stream of events is already 
> known at the time the request is handled. Instead of the timer source that 
> is used in there you could also use a Source.actorRef() whose materialized 
> value (the ActorRef) you send to the session Actor so that it know where to 
> send events later-on (using normal Actor messaging). You can see how this 
> is done in another example 
> <https://github.com/jrudolph/akka-http-scala-js-websocket-chat/blob/bc807a7c27e52f75179c19fdedcafc7ebb864e3a/backend/src/main/scala/example/akkawschat/Chat.scala#L55>
>  that 
> actually does use websockets to send events both ways.
>
> Regards,
>
> Roland
>
> On Mon, Aug 10, 2015 at 12:23 PM, Guido Medina <[email protected] 
> <javascript:>> wrote:
>
>> Basically I think what I really need is an implementation/example of Akka 
>> HTTP/Streams server sent events to the web socket client in Java, the rest 
>> should be easy to implement, any pointers will be of a great help I much 
>> need.
>>
>>
>> On Thursday, August 6, 2015 at 11:39:34 AM UTC+1, Guido Medina wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to implement the following workflow or checking if there is 
>>> an example (preferably in Java) somewhere:
>>>
>>>    1. Connect via web-socket, authenticate and receive a session ID 
>>>    identifier.
>>>    2. Using that session ID an actor is created which will handle all 
>>>    subsequent requests coming from that user.
>>>    3. That session ID can also subscribe to specific events which will 
>>>    make the server send data back events to that session using the created 
>>>    actor.
>>>    4. The actor of course has a session timeout so it will expire after 
>>>    few minutes.
>>>
>>>
>>> So my question is, what is the data structure that I need to wrap inside 
>>> that actor in order to respond back to that session ID? A Source<T, T>, I 
>>> might not completely understood Akka HTTP and Streams documentation so I'm 
>>> wondering if there is an example with such or similar scenario.
>>>
>>> The examples I have seen so far are very straight forward, send request, 
>>> handle request and return a Message, but I'm looking for a data structure 
>>> that can continuously stream data back on the already established 
>>> web-socket connection, maybe it is more obvious than what I think and I 
>>> have just not seen it.
>>>
>>> Best regards,
>>>
>>> Guido.
>>>
>> -- 
>> >>>>>>>>>> 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 the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Akka Team
> Typesafe - Reactive apps on the JVM
> Blog: letitcrash.com
> Twitter: @akkateam
>

-- 
>>>>>>>>>>      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 the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to