title: A journey from akka-stream to fs2 - how to define an akka-stream http flow like stage in fs2 using http4s
body: <p>i'm on my journey to deepen my knowledge in fs2, and want to try fs2-kafka for a use case where i would replace akka stream. The idea is simple, read from kafka and post data via http request to a sink, then commit back to kafka  on  success. So far i can't really figure out the http part. In akka stream / akka http you have out of the box a flow for that <a href="https://doc.akka.io/docs/akka-http/current/client-side/host-level.html#using-a-host-connection-pool" rel="nofollow noreferrer">https://doc.akka.io/docs/akka-http/current/client-side/host-level.html#using-a-host-connection-pool</a></p>
  <pre><code>Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]
  </code></pre>
  <p>Which integrate flawlessly with akka stream.</p>
  <p>I was trying to see if i could do something similar with http4s and fs2 .</p>
  <p>Does anyone has any reference, code sample, blog and what not that shows how to do that kind of integration. So far the only thing i could think of was, wrapping the the stream into the use method of the client resource i.e</p>
  <pre><code>BlazeClientBuilder[IO](IORuntime.global.compute).resource.use { ..... run stream here ..... }
  </code></pre>
  <p>Even then i am not sure of the entire thing</p>