Thanks for trying the new JavaDSL and reporting the issue Daniel! I sadly have to confirm it's a mistake in the DSL, completeWithFuture should take Marshaller[T, RequestEntity].
I've logged an issue and submitted a PR to fix it right away: https://github.com/akka/akka/issues/20592 We'll ship the fix in the next 2.4 minor release. Are you able to compile scala code in your project? Then providing a workaround would be trivial, it's possible to write a workaround in Java but a bit tricky... -- Konrad `ktoso` Malawski Akka @ Lightbend On 23 May 2016 at 16:23:59, Daniel Stoner (daniel.sto...@ocado.com) wrote: Hi All, Hopefully a quick one asking for some advice/pointers on how to marshal and complete a HTTP route using CompletionStage<SomeBean>. I've taken a look through the latest v2.5.6 documentation inc. The PetClinic example. What I am trying to do is very similar - marshalling a response from a high level server side API - but unlike in PetClinic where it can do: "return complete(StatusCodes.OK, thePet, Jackson.<Pet>marshaller());" Where we have thePet variable of type 'Pet' i have an CompletionStage<Pet> since I have PatternsCS.ask'ed an actor to respond to the request. What confuses me is that the signature for 'complete' directive is: RouteAdapter complete(StatusCode status, T value, Marshaller<T, RequestEntity> marshaller) In other words it is the marshaller purely just for the entity that I return in my response - Great as I can simply use Jackson.marshaller(). But the equivalent method that takes in a CompletionStage is: RouteAdapter completeWithFuture(CompletionStage<T> value, Marshaller<T, HttpResponse> marshaller) In other words my CompletionStage<Pet> must have a marshaller which can convert Pet to the whole HttpResponse - headers, statusCode and entity included - Meaning I now have to write some kind of mixed Marshaller/Business pojo to HttpResponse mapper. PetClinic link: https://github.com/akka/akka/blob/v2.4.6/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/petstore/PetStoreExample.java Thanks hugely! Dan -- Daniel Stoner | Senior Software Engineer UtopiaIT | Ocado Technology daniel.sto...@ocado.com | Ext 7969 | www.ocadotechnology.com Notice: This email is confidential and may contain copyright material of members of the Ocado Group. Opinions and views expressed in this message may not necessarily reflect the opinions and views of the members of the Ocado Group. If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. Fetch and Sizzle are trading names of Speciality Stores Limited, a member of the Ocado Group. References to the “Ocado Group” are to Ocado Group plc (registered in England and Wales with number 7098618) and its subsidiary undertakings (as that expression is defined in the Companies Act 2006) from time to time. The registered office of Ocado Group plc is Titan Court, 3 Bishops Square, Hatfield Business Park, Hatfield, Herts. AL10 9NE. -- >>>>>>>>>> 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.