Please elaborate on "unable to handle it" -- are you getting an exception, 
message does no arrive, something other?
Also it would be helpful if you showed your code for TextMessage.Streamed 
case because that's how large messages would show up. 
I don't know the specifics but there appears to be a buffer in Akka 
WebSockets client code: if the incoming message fits into this buffer in 
full it's sent to the client code as Strict message, but when the message 
is too large to fit in the buffer Akka switches to streaming mode: Streamed 
message is sent to client code, carrying a stream that will deliver the 
message contents in buffer-sized chunks.

Cheers,
aRafał


W dniu poniedziałek, 10 października 2016 08:21:14 UTC+2 użytkownik Narayan 
Kumar napisał:
>
>
>
> On Friday, October 7, 2016 at 7:52:03 PM UTC+5:30, √ wrote:
>>
>> Why are you assuming that it is a Strict message?
>>
>> On Fri, Oct 7, 2016 at 2:11 PM, Narayan Kumar <[email protected]> wrote:
>>
>>> Hi everyone,
>>> Actually i was trying to handle a Web Socket message for base64 encoded 
>>> string of 10mb file.but unable to handle it.
>>> is there any way to handle large message please suggest ?
>>>
>>> Here is the code:
>>>
>>> def mediaUploadHandler: Flow[Message, Message, _] = {
>>>     val (accountSource, accountQueue) = sourceQueue
>>>     Flow[Message]
>>>       .collect {
>>>         case TextMessage.Strict(txt) ⇒ {
>>>               logger.info(s"${phoneNumber}: Got the request. Now 
>>> redirecting to account api !!!!!!!!")
>>>               val userProfile = parse(txt).extractOpt[UserProfileJson]
>>>               println("user profile is ", userProfile)
>>>             }
>>>         
>>>         case _ => TextMessage(INVALID_ACTION)
>>>       }
>>>       .via(connectSource(accountSource)) // ... and route them through 
>>> the receiveNotification ...
>>>       .map {
>>>       case msg: String ⇒ {
>>>         info(s"Huhh !! Why I am getting this message ${msg}")
>>>         TextMessage.Strict(msg)
>>>       }
>>>     }
>>>   }
>>>
>>>
>>> Thanks in advance!
>>>
>>> -- 
>>> >>>>>>>>>> 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.
>>>
>>
>>
>>
>> -- 
>> Cheers,
>> √
>>
>
>
>
> Actually i have applied both approach of akka-http websocket 
> "TextMessage.Strict(txt)" and "TextMessage.Streamed(stream)",but both 
> approach didn't work.
> is there is another approach to handle it please suggest ?
>
>
>
>
>
>
>
>  
>

-- 
>>>>>>>>>>      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