Re: [akka-user] [Akka-Http] Consuming request entity multiple times

2017-04-10 Thread Mushtaq Ahmed
Makes sense. Thanks for explaining!


On Mon, Apr 10, 2017 at 8:40 PM, Konrad Malawski <
konrad.malaw...@lightbend.com> wrote:

> The reason it worked for the small payload is an optimisation done by Akka
> http, if it detects the entity will be a small "strict" one, the entire
> thing is loaded. So such payload can be materialized twice.
>
> We hope to make this more configurable in the future, and help with those
> scenarios even more. Hope this helps.
>
> 
>
> On Apr 11, 2017 00:06, "Mushtaq Ahmed"  wrote:
>
>> Ok, my test data was very small. If I increase the content of the
>> uploaded data I do see the exception of multiple materialization.
>>
>> Thanks.
>>
>>
>> On Mon, Apr 10, 2017 at 7:18 PM, Mushtaq Ahmed 
>> wrote:
>>
>>> Hello!
>>>
>>> I am uploading a file using fileUpload directive to an akka-http server.
>>> On server side once I get handle to the streaming request entity, I am able
>>> to successfully materialize the stream *multiple* times. How is it
>>> possible? Where does the data for the second materialization come from?
>>>
>>> On the other hand, akka-http client connected to the same server does
>>> throws exception if I materialize the response entity more than once, which
>>> is expected.
>>>
>>> Thanks.
>>>
>>> --
>>> >> Read the docs: http://akka.io/docs/
>>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>>> urrent/additional/faq.html
>>> >> Search the archives: https://groups.google.com/grou
>>> p/akka-user
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Akka User List" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/akka-user/PlMgcFxFb5Y/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> akka-user+unsubscr...@googlegroups.com.
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> 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/c
>> urrent/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 akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/PlMgcFxFb5Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] [Akka-Http] Consuming request entity multiple times

2017-04-10 Thread Konrad Malawski
The reason it worked for the small payload is an optimisation done by Akka
http, if it detects the entity will be a small "strict" one, the entire
thing is loaded. So such payload can be materialized twice.

We hope to make this more configurable in the future, and help with those
scenarios even more. Hope this helps.



On Apr 11, 2017 00:06, "Mushtaq Ahmed"  wrote:

> Ok, my test data was very small. If I increase the content of the uploaded
> data I do see the exception of multiple materialization.
>
> Thanks.
>
>
> On Mon, Apr 10, 2017 at 7:18 PM, Mushtaq Ahmed 
> wrote:
>
>> Hello!
>>
>> I am uploading a file using fileUpload directive to an akka-http server.
>> On server side once I get handle to the streaming request entity, I am able
>> to successfully materialize the stream *multiple* times. How is it
>> possible? Where does the data for the second materialization come from?
>>
>> On the other hand, akka-http client connected to the same server does
>> throws exception if I materialize the response entity more than once, which
>> is expected.
>>
>> Thanks.
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Akka User List" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/akka-user/PlMgcFxFb5Y/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] [Akka-Http] Consuming request entity multiple times

2017-04-10 Thread Mushtaq Ahmed
Ok, my test data was very small. If I increase the content of the uploaded
data I do see the exception of multiple materialization.

Thanks.


On Mon, Apr 10, 2017 at 7:18 PM, Mushtaq Ahmed  wrote:

> Hello!
>
> I am uploading a file using fileUpload directive to an akka-http server.
> On server side once I get handle to the streaming request entity, I am able
> to successfully materialize the stream *multiple* times. How is it
> possible? Where does the data for the second materialization come from?
>
> On the other hand, akka-http client connected to the same server does
> throws exception if I materialize the response entity more than once, which
> is expected.
>
> Thanks.
>
> --
> >> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/PlMgcFxFb5Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [Akka-Http] Consuming request entity multiple times

2017-04-10 Thread Mushtaq Ahmed
Hello!

I am uploading a file using fileUpload directive to an akka-http server. On 
server side once I get handle to the streaming request entity, I am able to 
successfully materialize the stream *multiple* times. How is it possible? 
Where does the data for the second materialization come from?

On the other hand, akka-http client connected to the same server does 
throws exception if I materialize the response entity more than once, which 
is expected.

Thanks.

-- 
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.