3

I am trying to have an Akka stream where some of the stages are http calls. Since the http calls can (and will) fail at times, I would prefer to put relevant data to a separate queue (might even be external to my application), pull them after some time and consume them back in the stream.

I am using spray client for the http calls. But I am open to other clients (including the newer akka-http).

What is the cleanest way to achieve this? I can't do synchronous retries since that will block the stage. Currently I am putting the failed http requests to a raabitmq, adding a RMQ consumer source and a merge node before every http stage. This serves my purpose, but makes the stream code ugly and unmanageable. Even a simple linear topology becomes a complex graph with this approach.

I am using Akka stream (over a plain akka solution) primarily for easy composition and back pressure.

What alternatives do I have in this case (in and outside akka-stream). I would like to stick to an Akka solution for other design constraints.

anindyaju99
  • 465
  • 1
  • 5
  • 16
  • I found this http://stackoverflow.com/questions/35868862/akka-stream-map-with-retry but this is as complicated as what I am doing right now. https://groups.google.com/forum/#!msg/akka-user/TgjIhJBDs8U/zt_XTbvpIQ4J this is also on this topic, but not sure what the solution is. – anindyaju99 Jun 30 '16 at 17:52

0 Answers0