File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed
core/src/main/scala/pillars
http-client/src/main/scala/pillars/httpclient Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import org.http4s.HttpVersion
14
14
import org .http4s .Response
15
15
import org .http4s .Status
16
16
import org .http4s .circe .CirceEntityCodec .circeEntityEncoder
17
- import org .http4s .netty .server .NettyServerBuilder
17
+ import org .http4s .ember .server .EmberServerBuilder
18
18
import org .http4s .server .Server
19
19
import org .http4s .server .middleware .CORS
20
20
import org .http4s .server .middleware .ErrorHandling
@@ -94,11 +94,12 @@ object HttpServer:
94
94
95
95
val app : HttpApp [IO ] = routes |> logging |> errorHandling |> cors
96
96
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)
99
101
.withHttpApp(app)
100
- .withoutBanner
101
- .resource
102
+ .build
102
103
end build
103
104
104
105
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
22
22
import org .http4s .client .Client
23
23
import org .http4s .client .middleware .FollowRedirect
24
24
import org .http4s .client .middleware .Logger
25
+ import org .http4s .ember .client .EmberClientBuilder
25
26
import org .http4s .headers .`User-Agent`
26
- import org .http4s .netty .client .NettyClientBuilder
27
27
import pillars .Logging
28
28
import pillars .Module
29
29
import pillars .Modules
@@ -102,12 +102,10 @@ object HttpClient extends ModuleSupport:
102
102
conf <- Resource .eval(reader.read[HttpClient .Config ](" http-client" ))
103
103
metrics <- if conf.metrics then ClientMetrics (observability).map(_.middleware).toResource
104
104
else Resource .pure(identity[Client [IO ]])
105
- client <- NettyClientBuilder [IO ]
106
- .withHttp2
107
- .withNioTransport
105
+ client <- EmberClientBuilder .default[IO ]
108
106
.withUserAgent(conf.userAgent)
109
- .withMaxConnectionsPerKey( conf.maxConnections)
110
- .resource
107
+ .withMaxPerKey(_ => conf.maxConnections)
108
+ .build
111
109
.map: client =>
112
110
val logging =
113
111
if conf.logging.enabled then
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ object versions {
13
13
val fs2 = " 3.12.0"
14
14
val fs2Rabbit = " 5.2.0"
15
15
val http4s = " 0.23.30"
16
- val http4sNetty = " 0.5.23"
17
16
val ip4s = " 3.6.0"
18
17
val iron = " 2.6.0"
19
18
val literally = " 1.2.0"
@@ -70,12 +69,12 @@ object Dependencies {
70
69
)
71
70
72
71
val http4sClient : Seq [ModuleID ] = Seq (
73
- " org.http4s" %% " http4s-netty -client" % versions.http4sNetty ,
72
+ " org.http4s" %% " http4s-ember -client" % versions.http4s ,
74
73
" com.softwaremill.sttp.tapir" %% " tapir-http4s-client" % versions.tapir,
75
74
" com.alejandrohdezma" %% " http4s-munit" % versions.munit.http4s % Test
76
75
)
77
76
val http4sServer : Seq [ModuleID ] = Seq (
78
- " org.http4s" %% " http4s-netty -server" % versions.http4sNetty
77
+ " org.http4s" %% " http4s-ember -server" % versions.http4s
79
78
)
80
79
val scodec : Seq [ModuleID ] = Seq (
81
80
" org.scodec" %% " scodec-bits" % versions.scodec.bits,
You can’t perform that action at this time.
0 commit comments