It returned an Akka Stream there :-) So you should learn a bit about Akka Streams to know how to handle those: http://doc.akka.io/docs/akka/2.4.6/scala/stream/stream-quickstart.html and take it from there.
It's basically as simple as streamedData.map(_.utf8String).runWith(Sink.foreach(it => println(it))) etc. Hope this helps! -- Konrad `ktoso` Malawski Akka <http://akka.io> @ Lightbend <http://lightbend.com> On 31 May 2016 at 18:28:49, Qux ([email protected]) wrote: 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. -- >>>>>>>>>> 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.
