I’d recommend using the search function on the docs: http://doc.akka.io/docs/akka-http/current/scala/http/routing-dsl/directives/basic-directives/extractStrictEntity.html#extractstrictentity The search function on the left would get you to this directive as well as the toStrict method.
Also read this: http://doc.akka.io/docs/akka-http/current/scala/http/implications-of-streaming-http-entity.html#implications-of-the-streaming-nature-of-request-response-entities <http://doc.akka.io/docs/akka-http/10.0.9/scala/http/implications-of-streaming-http-entity.html#implications-of-the-streaming-nature-of-request-response-entities> which explains why / how these things work. Happy hakking! — Konrad On 10 July 2017 at 00:46:10, vishal.ve...@exadatum.com ( vishal.ve...@exadatum.com) wrote: I came across the post that says akka flushes the entity if not declated strict, If thats right can any one help me as to how do i declare my jobDetailsEntity as `strict ` On Sunday, July 9, 2017 at 9:14:14 PM UTC+5:30, vishal...@exadatum.com wrote: > > > > down votefavorite > <https://stackoverflow.com/questions/44950948/akka-http-error-substream-source-cannot-be-materialized-more-than-once-if-payl/44957248#> > > I am working with Akka Http, where I have defined a route as > > val route = (path(HttpConstants.CreateJob) & post) { > (entity(as[JobDetailsEntity]) & entity(as[JobEntity])) { > (jobDetailsEntity: JobDetailsEntity, jobEntity: JobEntity) => > val updatedJobEntity = jobEntity.copy(runningSince = > DateTime.now().getMillis) > val updatedJobDetailsEntity = jobDetailsEntity.copy(runningSince = > DateTime.now().getMillis).copy(modify_date = DateTime.now().getMillis) > complete { > createJobDetails(updatedJobDetailsEntity).map(_.asJson) > createJob(updatedJobEntity).map(_.asJson) > } > } > > Here I am trying to unmarshal two entites in the same POST call which > works when my json Payload id small i.e few bytes then its works fine , as > soon as the payload size increases i.e around 10-20 kb it throws error : > > Substream Source cannot be materialized more than once > > *DISCLAIMER:* This message contains confidential information and is intended only for the individual named. If you are not the named addressee, you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. Email transmission cannot be guaranteed to be secure or error-free, as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender, therefore, does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. If verification is required, please request a hard-copy version. -- >>>>>>>>>> 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.