File tree Expand file tree Collapse file tree
core/src/main/scala/pillars
http-client/src/main/scala/pillars/httpclient Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import org.http4s.HttpVersion
1414import org .http4s .Response
1515import org .http4s .Status
1616import org .http4s .circe .CirceEntityCodec .circeEntityEncoder
17- import org .http4s .netty .server .NettyServerBuilder
17+ import org .http4s .ember .server .EmberServerBuilder
1818import org .http4s .server .Server
1919import org .http4s .server .middleware .CORS
2020import org .http4s .server .middleware .ErrorHandling
@@ -94,11 +94,12 @@ object HttpServer:
9494
9595 val app : HttpApp [IO ] = routes |> logging |> errorHandling |> cors
9696
97- NettyServerBuilder [IO ].withoutSsl.withNioTransport
98- .bindHttp(config.port.value, config.host.toString)
97+ EmberServerBuilder
98+ .default[IO ]
99+ .withHost(config.host)
100+ .withPort(config.port)
99101 .withHttpApp(app)
100- .withoutBanner
101- .resource
102+ .build
102103 end build
103104
104105 private def exceptionHandler (tracer : Tracer [IO ]): ExceptionHandler [IO ] =
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ import org.http4s.Uri
2222import org .http4s .client .Client
2323import org .http4s .client .middleware .FollowRedirect
2424import org .http4s .client .middleware .Logger
25+ import org .http4s .ember .client .EmberClientBuilder
2526import org .http4s .headers .`User-Agent`
26- import org .http4s .netty .client .NettyClientBuilder
2727import pillars .Logging
2828import pillars .Module
2929import pillars .Modules
@@ -102,12 +102,10 @@ object HttpClient extends ModuleSupport:
102102 conf <- Resource .eval(reader.read[HttpClient .Config ](" http-client" ))
103103 metrics <- if conf.metrics then ClientMetrics (observability).map(_.middleware).toResource
104104 else Resource .pure(identity[Client [IO ]])
105- client <- NettyClientBuilder [IO ]
106- .withHttp2
107- .withNioTransport
105+ client <- EmberClientBuilder .default[IO ]
108106 .withUserAgent(conf.userAgent)
109- .withMaxConnectionsPerKey( conf.maxConnections)
110- .resource
107+ .withMaxPerKey(_ => conf.maxConnections)
108+ .build
111109 .map: client =>
112110 val logging =
113111 if conf.logging.enabled then
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ object versions {
1313 val fs2 = " 3.12.0"
1414 val fs2Rabbit = " 5.2.0"
1515 val http4s = " 0.23.30"
16- val http4sNetty = " 0.5.23"
1716 val ip4s = " 3.6.0"
1817 val iron = " 2.6.0"
1918 val literally = " 1.2.0"
@@ -70,12 +69,12 @@ object Dependencies {
7069 )
7170
7271 val http4sClient : Seq [ModuleID ] = Seq (
73- " org.http4s" %% " http4s-netty -client" % versions.http4sNetty ,
72+ " org.http4s" %% " http4s-ember -client" % versions.http4s ,
7473 " com.softwaremill.sttp.tapir" %% " tapir-http4s-client" % versions.tapir,
7574 " com.alejandrohdezma" %% " http4s-munit" % versions.munit.http4s % Test
7675 )
7776 val http4sServer : Seq [ModuleID ] = Seq (
78- " org.http4s" %% " http4s-netty -server" % versions.http4sNetty
77+ " org.http4s" %% " http4s-ember -server" % versions.http4s
7978 )
8079 val scodec : Seq [ModuleID ] = Seq (
8180 " org.scodec" %% " scodec-bits" % versions.scodec.bits,
You can’t perform that action at this time.
0 commit comments