Skip to content

Commit c007854

Browse files
authored
update akka version (#137)
1 parent ea054f9 commit c007854

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171

7272
<properties>
7373
<!--Dependency versions-->
74-
<akka.version>2.5.13</akka.version>
75-
<akka.http.version>10.1.3</akka.http.version>
74+
<akka.version>2.5.16</akka.version>
75+
<akka.http.version>10.1.5</akka.http.version>
7676
<apache.httpclient.version>4.5.5</apache.httpclient.version>
7777
<apache.httpcore.version>4.4.9</apache.httpcore.version>
7878
<arpnetworking.commons.version>1.16.1</arpnetworking.commons.version>

src/main/java/com/arpnetworking/http/Routes.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import akka.http.javadsl.model.ws.Message;
3333
import akka.japi.JavaPartialFunction;
3434
import akka.japi.function.Function;
35-
import akka.japi.pf.PFBuilder;
3635
import akka.pattern.PatternsCS;
3736
import akka.stream.OverflowStrategy;
3837
import akka.stream.javadsl.Flow;
@@ -105,10 +104,10 @@ public Routes(
105104
public Flow<HttpRequest, HttpResponse, NotUsed> flow() {
106105
return Flow.<HttpRequest>create()
107106
.mapAsync(1, this)
108-
.recover(
109-
new PFBuilder<Throwable, HttpResponse>()
110-
.match(Exception.class, e -> HttpResponse.create().withStatus(StatusCodes.INTERNAL_SERVER_ERROR))
111-
.build());
107+
.recoverWithRetries(
108+
0,
109+
Exception.class,
110+
() -> Source.single(HttpResponse.create().withStatus(StatusCodes.INTERNAL_SERVER_ERROR)));
112111
}
113112

114113
@Override

0 commit comments

Comments
 (0)