EntityStreamingSupport for two content types

39 views
Skip to first unread message

James Matlik

unread,
Nov 26, 2016, 4:14:56 PM11/26/16
to akka...@googlegroups.com

I am trying to create an Akka-HTTP streaming service that supports both JSON and protobuf.

I am able to support both formats without streaming using Marshaller.oneOf(...) composition. However, I cannot seem to find something similar for EntityStreamingSupport.

Would anyone have pointers on how best to handle this?

Thank you,
James

James Matlik

unread,
Nov 29, 2016, 6:43:49 AM11/29/16
to akka...@googlegroups.com

Would any one have suggestions on how to support content negotiation with a steaming Akka-HTTP response? I know i can create content type specific URIs, but that doesn't lend itself to a well designed API.

I've still not been able to find how EntityStreamingSupport can support content negotiation.  Am I missing something obvious?

Much thanks,
James

Martynas Mickevičius

unread,
Dec 2, 2016, 8:27:02 AM12/2/16
to akka...@googlegroups.com
James, have you seen this ticket: https://github.com/akka/akka-http/issues/424

There is an example there, which might help you.

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

James Matlik

unread,
Dec 2, 2016, 9:17:26 AM12/2/16
to akka...@googlegroups.com
Martynas,

Thank you for the pointer. There is a lot of good example code to digest there, if not just for understanding how people think in the context of marshallers. I was about to resort to creating my own entity to ByteString flows, but hopefully i can figure out a reasonable solution based on this.

- James
Reply all
Reply to author
Forward
0 new messages