Hi,

I looked into many nice Examples with Akka Websockets (like 
https://markatta.com/codemonkey/blog/2016/04/18/chat-with-akka-http-websockets/),
 
but sadly the used flows only handle strict Messages.

Is is possible to write a Flow from Message to Bytestring that handles 
Strict and streamed Messages?

Here my (java-)code so far: 

public static final BidiFlow<Message, ByteString, ByteString, Message, NotUsed> 
codec2 =
>             BidiFlow.fromFunctions((x -> {
>                 if(x.isText()) {
>                     log.info("textmessage currently not supported");
>                     return null;
>                 }else{
>                     BinaryMessage binaryMessage = x.asBinaryMessage();
>                     if(binaryMessage.isStrict()) {
>                         log.info("strict Binary Message");
>                         return binaryMessage.getStrictData();
>                     }else{
>                         Source<ByteString, ?> streamedData = 
> binaryMessage.getStreamedData();
> //                        TODO: WHAT NOW???.
>                         return null;
>                     }
>                 }
>             }), (x -> BinaryMessage.create(x)));
>
>

I'm happy for all tips, java/scala-code-snippets and so on :) 

Big Thanks
Qux

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to