armeria

Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.

APACHE-2.0 License

Stars
4.7K
Committers
243

Bot releases are visible (Hide)

armeria -

Published by minwoox over 5 years ago

New features

  • A user now can see the content of HTTP request/response in logs. #1574
    ServerBuilder sb = new ServerBuilder();
    // Enables previewing the content with the maximum length of 100 for textual contents.
    sb.contentPreview(100);
    
    // A user can use their customized previewer factory.
    sb.contentPreviewerFactory((ctx, headers) -> {
        return ContentPreviewer.ofBinary(100, byteBuf -> {
            byte[] contents = new byte[Math.min(byteBuf.readableBytes(), 100)];
            byteBuf.readBytes(contents);
            return BaseEncoding.base16().encode(contents);
        });
    });
    
  • Added ClientRequestContextBuilder and ServiceRequestContextBuilder. #1548
    • A user can create a mock of RequestContext.
    • A user can emulate an incoming request and feed it into his or her processing pipeline.
    @Test
    public void testService() throws Exception {
        // Given
        HttpRequest req = HttpRequest.of(HttpMethod.POST, "/greet",
                                         MediaType.JSON_UTF_8,
                                         "{ \"name\": \"foo\" }");
        ServiceRequestContext sctx = ServiceRequestContext.of(req);
    
        // When
        HttpResponse res = service.serve(sctx, req);
    
        // Then
        AggregatedHttpMessage aggregatedRes = res.aggregate().get();
        assertEquals(200, aggregatedRes.status().code());
    }
    
  • A user can use @CorsDecorator in annotated services. #1547
    sb.annotatedService("/cors6", new Object() {
    
        @Get("/any/get")
        @CorsDecorator(origins = "*", exposedHeaders = { "expose_header_1", "expose_header_2" },
            allowedRequestHeaders = { "allow_request_1", "allow_request_2" },
            allowedRequestMethods = HttpMethod.GET, maxAge = 3600,
            preflightRequestHeaders = {
                @AdditionalHeader(name = "x-preflight-cors", value = "Hello CORS")
            })
        public HttpResponse anyoneGet() {
            return HttpResponse.of(HttpStatus.OK);
        }
    }
    
  • Added ClientFactoryBuilder.domainNameResolverCustomizer() so that a user can customize the resolver easily. #1553
    ClientFactory f = new ClientFactoryBuilder()
        .domainNameResolverCustomizer(resolverBuilder -> {
            resolverBuilder.maxQueriesPerResolve(10);
            resolverBuilder.traceEnabled(false);
        })
        .build();
    
  • A user can define a custome annotation which attaches other annotations for simplicity. #1560
    // Define a custom annotation:
    @ProducesJson
    @LoggingDecorator
    @interface MyApiSpecification {}
    
    // Apply it to the annotated HTTP service:
    @Get("/api")
    @MyApiSpecification // You can use one annotation which holds other other annotations.
    public Something getSomething() {}
    
  • Added @AdditionalHeader and @AdditionalTrailer to insert headers easily in annotated services. #1555
  • Added a way to add multiple gRPC services with a single method call. #1563
    // Before
    GrpcService s = new GrpcServiceBuilder().addService(a)
                                            .addService(b)
                                            .build();
    // After
    GrpcService s = new GrpcServiceBuilder().addServices(a, b).build();
    
  • Added more shortcut methods for convenience. #1576
    HttpRequest req = ...;
    AggregatedHttpMessage aggregated = ...;
    MediaType contentType;
    String content;
    
    // Before
    contentType = req.headers().contentType();
    contentType = aggregated.headers().contentType();
    content = aggregated.content().toStringUtf8();
    
    // After
    contentType = req.contentType();
    contentType = aggregated.contentType();
    content = aggregated.contentUtf8();
    
  • RequestObject is shown in DocService. #1557
  • Added verboseSocketExceptions flag so that a user can ignore harmless socket-related error message. #1577
  • Added automatic directory listing generation to HttpFileService. #1573
  • Added armeria-spring-boot-actuator dependency. #1578
    • Works without Spring Web or Webflux.
  • Added metrics related to timeouts. #1589
  • Added responseCauseSanitizer to LoggingDecoratorBuilder. #1594
    • A user can sanitize the stack trace of RequestLog.responseCause() or avoid logging the stack trace completely.
    ServerBuilder sb = ...
    final Function<Throwable, Throwable> responseCauseSanitizer = cause -> {
        if (cause instanceOf AnticipatedException) {
            return null; // Do not log when AnticipatedException is raised. 
        }
        return cause;
     };
    
     sb.decorator(new LoggingServiceBuilder().requestLogLevel(LogLevel.INFO)                                                    
                                             .successfulResponseLogLevel(LogLevel.INFO)                                                    
                                             .responseCauseSanitizer(responseCauseSanitizer)
                                             .newDecorator());
    
  • A user can easily send Server-Sent Events. #1551
    public class MyAnnotatedService {
        @Get("/publisher")
        @ProducesEventStream
        public Publisher<ServerSentEvent<?>> publisher() {
            return Flux.just(ServerSentEvent.ofData("foo"),
                             ServerSentEvent.ofData("bar"),
                             ServerSentEvent.ofData("baz"),
                             ServerSentEvent.ofData("qux"));
        }
    }
    

Improvements

  • User-friendly message when 400 Bad Request happens. #1575
  • Enabled DNS query traces by default. #1553
  • Added armeria-retry-count header when RetryingClient is used. #1593

Bug fixes

  • Fixed a bug where httpStatus tag is not set properly. #1559
  • Do not set Content-length header when HTTP trailers exist. #1566
  • Fixed a bug where max request length is not set correctly in GrpcService when the value is 0 or Long.MAX_VALUE. #1549
  • Fixed a but where gRPC JSON marshaller is initialized even when unnecessary. #1558
  • Fixed a bug where gRPC callbacks are not executed in order. #1600

Breaking Change

  • The HttpHeaders in AggregatedHttpMessage is immutable.
    • You should call headers.toMutable() to set or remove a header.

Deprecations

  • RequestContext.isTimedOut() has been deprecated. #1589
    • Use ServiceRequestContext.isTimedOut() instead.

Dependencies

  • Bouncy Castle 1.60 -> 1.61

  • Brave 5.6.0 -> 5.6.1

  • java-jwt 3.5.0 -> 3.7.0

  • Micrometer 1.1.2 -> 1.1.3

  • Netty 4.1.32 -> 4.1.33

  • Project Reactor 3.2.5 -> 3.2.6

  • protobuf-jackson 0.3.0 -> 0.3.1

  • RxJava 2.2.5 -> 2.2.6

  • Thrift 0.11.0 -> 0.12.0

  • Tomcat 9.0.14 -> 9.0.16, 8.5.37 -> 8.5.38

  • spring-boot-starter-actuator has benn removed from the transitive dependencies.

armeria -

Published by minwoox over 5 years ago

New features

  • A user can serve an individual file very easily. #1505
    ServerBuilder sb = new ServerBuilder();
    // Auto-generates ETag, Last-Modified.
    // Handles 'If-None-Match' and 'If-Modified-Since'.
    sb.service("/favicon.ico", HttpFile.of(new File("/var/www/favicon.ico")).asService());
    sb.annotatedService(new Object() {
        @Get("/files/{fileName}")
        public HttpResponse getFile(ServiceRequestContext ctx, HttpRequest req,
                                    @Param String fileName) {
            return HttpFile.of(new File("/var/www/files", fileName)).asService(ctx, req);
        }
    });
    
  • A user can specify different CORS policies for different origins. #1139 #1526
    ServerBuilder sb = new ServerBuilder().service("/message", myService.decorate(
        CorsServiceBuilder.forOrigins("http://example.com")
                          .allowCredentials()
                          .allowNullOrigin() // 'Origin: null' will be accepted.
                          ...
                          .andForOrigins("http://example2.com")
                          ...
                          .and() // Should call to return to CorsServiceBuilder.
                          .newDecorator()));
    
  • A user can have different access logger names for different virtual hosts. #947 #1517
  • Publisher and Stream return type is handled by the default response converters in AnnotatedHttpService. #1530
    public class MyAnnotatedService {
    
        @Get("/stream")
        @ProducesJsonSequences
        public Stream<String> stream() {
            return Stream.of("foo", "bar", "baz", "qux");
        }
    
        @Get("/publisher")
        @ProducesJsonSequences
        public Publisher<String> publisher() {
            return Flux.just("foo", "bar", "baz", "qux");
        }
    }
    
    • Maybe, Single, Completable and Observable are supported once you add armeria-rxjava to the dependencies as well.
      public class MyAnnotatedService {
          @Get("/observable")
          @ProducesJsonSequences
          public Observable<String> observable() {
              return Observable.just("foo", "bar", "baz", "qux");
          }
      }
      
  • A user is able to specify an alternative HTTP status code using @StatusCode. #1509
    public class MyAnnotatedService {
    
        @StatusCode(201)
        @Post("/users/{name}")
        public User createUser(@Param String name) { ... }
    
        // @StatusCode(200) would be applied by default.
        @Get("/users/{name}")
        public User getUser(@Param String name) { ... }
    
        // @StatusCode(204) would be applied by default.
        @Delete("/users/{name}")
        public void deleteUser(@Param String name) { ... }
    }
    
  • Added option to run gRPC callback in a blocking executor. #1525 #1524
    ServerBuilder sb = new ServerBuilder();
    sb.service(new GrpcServiceBuilder().useBlockingTaskExecutor(true)
                                       .addService(...)
                                       .build());
    
  • Marshalled Status.cause between server and client for more structured error handling in gRPC. #1504
  • Added verboseResponses property to ServerBuilder and ServerConfig. #1507 #1508
    ServerBuilder sb = new ServerBuilder();
    sb.verboseExceptions(true);
    
  • The services in DocService UI are now collapsible. #1506

Improvements

  • HttpHeaderNames.of() now accepts CharSequence. #1516
    // Before:
    HttpClientBuilder b = new HttpClientBuilder(...);
    b.addHttpHeader(AsciiString.of("my-header"), value);
    
    // After:
    b.addHttpHeader(HttpHeaderNames.of("my-header"), value);
    // or
    b.addHttpHeader("my-header", value);
    
  • Armeria(Client|Server)Configurator extends org.springframework.core.Ordered. #1535
    • A user can easily define the order of configurators applied.
  • CountingSampler in logging is not syncronized anymore. #1527
  • HttpStatus and HttpStatusException lookup performance is improved. #1545

Bug fixes

  • Fixed a bug where a connection which is scheduled for disconnection is returned to the pool. #1513
  • Fixed a bug where verboseExceptions is not working correctly when Exceptions.isExpected(Throwable) is used. #1529
  • Fixed a bug where initCause and addSuppressed can be called on singleton exceptions. #1545
  • Fixed a bug where exception messages are logged which do not really need to be logged. #1529
  • Fixed a bug where an HTTP/1 response adds redundant content-length: 0
    header for status code 204, 205 and 304. #1505
  • Fixed a bug where redundant injection with the same parameter happens in AnnotatedHttpService. #1538
  • Fixed a bug where a preflight request is not handled when an annotated service method is decorated with CorsService. #1537

Breaking changes

  • Moved fields in CorsConfig and CorsServiceBuilder except for anyOriginSupported and shortCircuit to CorsPolicy and AbstractCorsPolicyBuilder. #1526
  • Replaced the usage of HttpVfs.Entry with HttpFile. #1505
    • HttpVfs.get() returns HttpFile instead HttpVfs.Entry.
  • ResponseConverterFunction.convert() method takes more parameters which are headers and trailingHeaders. #1509
  • The behavior when null object is returned is changed in AnnotatedHttpService. #1509
  • The signature of CircuitBreakerListener is changed. #1509
    • The first parameter of all methods is String circuitBreakerName instead of CircuitBreaker circuitBreaker.
  • Renamed ArmeriaClientConfigurator.customize() to configure(). #1535
  • IllegalStateException is raised instead of ClosedClientFactoryException when a request in progress is cancelled due to the termination of ClientFactory. #1532

Deprecations

  • ClosedClientFactoryException has been deprectated. #1532

Dependencies

  • Curator 4.0.1 -> 4.1.0
  • Dropwizard Metrics 4.0.3 -> 4.0.5
  • gRPC 1.17.1 -> 1.18.0
  • Jackson 2.9.7 -> 2.9.8
  • java-jwt 3.4.1 -> 3.5.0
  • Micrometer 1.1.1 -> 1.1.2
  • Reactor 3.2.3 -> 3.2.5
  • RxJava 2.2.4 -> 2.2.5
  • Spring Boot 2.1.1 -> 2.1.2, 1.5.18 -> 1.5.19
  • Tomcat 8.5.35 -> 8.5.37
armeria -

Published by trustin over 5 years ago

Bug fixes

  • Fixed NPE while attempting to take a connection from the connection pool. #1542
  • Fixed a bug where singleton exceptions such as RequestTimeoutException can have a cause. #1539
armeria -

Published by minwoox almost 6 years ago

Bug fixes

  • Fixed a bug where DocService does not support certain types used in AnnotatedHttpService. #1501
armeria -

Published by trustin almost 6 years ago

New features

  • Preliminary support for annotated services in DocService. #1479
  • Added com.linecorp.armeria.common.util.InetAddressPredicates for easier IP address filtering. #1494 #1498
    Predicate<InetAddress> ipFilter =
            InetAddressPredicates.ofCidr("192.168.0.0/24").or(
                    InetAddressPredicates.ofCidr("10.1.0.0/16"));
    
    See Getting an IP address of a client who initiated a request for more examples.

Bug fixes

  • Fixed a bug where an Armeria client does not send the content-length: 0 header when a user sends a PUT/POST/PATCH request without content. #1476 #1499
  • Fixed a bug where the decorators specified in AnnotatedServiceRegistrationBean are not applied correctly. #1497
armeria -

Published by trustin almost 6 years ago

New features

  • Client-side decoration API has been simplified greatly. #1482 #1484
    ClientBuilder b = new ClientBuilder(...);
    // Before
    b.decorator(HttpRequest.class, HttpResponse.class, httpLevelDecorator);
    b.decorator(RpcRequest.class, RpcResponse.class, rpcLevelDecorator);
    // After
    b.decorator(httpLevelDecorator); // No need to specify req/res types.
    b.rpcDecorator(rpcLevelDecorator); // Added a dedicated method for RPC-level decorators.
    
  • Added ServiceRequestContext.clientAddress() which returns the IP address of the client which initiated the request. #1467
    • This property respects Forwarded, X-Forwarded-For and PROXY protocol headers in the configurable order of preferences.
    • You can also include this property in an access log using the format string %a.
    • See clientAddressSources(), clientAddressTrustedProxyFilter() and clientAddressFilter() in ServerBuilder for more information.
  • Added ServiceRequestContext.additionalResponseTrailers which allows you to set additional HTTP trailers easily. #1488
  • Added ClientFactory.disableShutdownHook(). #1082 #1472

Improvements

  • The exception handler of an annotated service now handles the exceptions raised by the decorators of the annotated service. #1478

Bug fixes

  • Fixed a bug where DocService debug form does not show all example HTTP headers. #1466
  • Fixed a bug where EndpointGroup health check meters sometimes have missing ip tag. #1474
  • Fixed a bug where annotated services do not work when a service object is enhanced by CGLIB. #1473 #1480
    • Related: Spring validation and AOP
  • Fixed a bug where Armeria client does not respect HTTP/2 MAX_CONCURRENT_STREAMS settings. #1206 #1481
  • Fixed a bug where Armeria uses too small inbound traffic water marks for an HTTP/2 connection. #1489
  • Fixed a bug where false positive warnings are logged when scanning an annotated service. #1485 #1486

Deprecations

  • ClientBuilder.decorator(Class, Class, ...) has been deprecated in favor of the new decorator() and rpcDecorator() methods introduced in the 'New features' section above. #1482 #1484

Dependencies

  • Brave 5.5.1 -> 5.6.0
  • gRPC 1.16.1 -> 1.17.1
  • Micrometer 1.1.0 -> 1.1.1
  • Netty 4.1.31 -> 4.1.32
  • Prometheus 0.5.0 -> 0.6.0
  • Retrofit 2.4.0 -> 2.5.0
  • RxJava 2.2.3 -> 2.2.4
  • Spring Boot 2.1.0 -> 2.1.1, 1.5.17 -> 1.5.18
  • Tomcat 9.0.13 -> 9.0.14
armeria -

Published by trustin almost 6 years ago

Bug fixes

  • Fixed a bug where gRPC status messages are not decoded correctly. #1460 #1461
  • Fixed a bug where RequestLog.responseStartTime is not recorded correctly. #1463
armeria -

Published by trustin almost 6 years ago

Improvements

  • Made it possible to use armeria-spring-boot-webflux-starter as a Spring Boot WebServer implementation while using reactor-netty as a standalone library. #1459
armeria -

Published by trustin almost 6 years ago

New features

  • Added a new module armeria-spring-boot-webflux-autoconfigure which allows you to use Armeria as the web server and client implementation of Spring WebFlux. #1326
    • By using Armeria instead of Spring's default implementation, you get:
      • Rich support for Apache Thrift and gRPC, including the fancy web console that enables you to send Thrift and gRPC requests from a web browser
      • Ability to run HTTP REST service and RPC service in the same port
      • Full HTTP/2 support for both server-side and client-side, including h2c (plaintext HTTP/2)
      • PROXY protocol support which provides interoperability with load balancers such as HAProxy and AWS ELB
    • Read the official documentation to learn how to integrate Armeria with Spring Boot and WebFlux.
  • Zipkin spans reported by Armeria now include 'wire send' and 'wire receive' timestamps. #1423
  • Made health check port in HttpHealthCheckedEndpointGroup customizable. #1431
  • Added more utility methods to EventLoopGroups. #1438 #1445
  • Added CircuitBreakerClientBuilder which helps you apply CircuitBreaker pattern: #1418
    final CircuitBreakerStrategy strategy = CircuitBreakerStrategy.onServerErrorStatus();
    final HttpClient client = new HttpClientBuilder(...)
            .decorator(new CircuitBreakerHttpClientBuilder(strategy)
                               .circuitBreakerMapping(CircuitBreakerMapping.ofDefault()
                               .newDecorator())
            .build();
    
    final AggregatedHttpMessage res = client.execute(...).aggregate().join();
    

Improvements

  • HTTP connection pool now reuses the connections slightly more efficiently. #818 #1441
  • Various performance improvements #1436 #1440 #1444
  • Various documentation updates #1442 #1448 #1451 #1453

Bug fixes

  • Removed unnecessary dependencies from armeria-bom.
    • armeria-bom will now define the versions of Armeria artifacts only. For example, previously, armeria-bom defined the versions of Armeria's transitive dependencies such as Guava and Netty, but we do not from this release.
  • Fixed a bug where Thrift one-way call responses are not sent early enough. #1368 #1455
  • Fixed a bug where :authority header is not set properly when RetryingClient is used. #1433
  • Fixed a bug where Armeria attempts to set an empty string to Zipkin's Span.remoteServiceName. #1434
  • Fixed a bug where SAML KeyStoreCredentialResolverBuilder does not raise FileNotFoundException when it failed to find the specified resource. #1439
  • Fixed NullPointerException raised by AbstractStreamMessageDuplicator and its subtypes. #1446 #1449

Breaking changes

  • From this release on, we distribute shaded JARs only. If you were using shaded JARs, you have to remove the -shaded suffix from all Armeria artifact IDs. You should not see any differences besides that because all Armeria artifacts are now distributed as shaded JARs by default. #1435
  • Since we removed unnecessary dependencies from armeria-bom, your build might fail to resolve some of your dependencies if you relied on armeria-bom for the version numbers of non-Armeria dependencies.
  • KeyedChannelPoolHandler and its subtypes have been replaced with ConnectionPoolListener and its respective subtypes. #818 #1441
  • (Retry|CircuitBreaker)Strategy are split into (Retry|CircuitBreaker)Strategy and (Retry|CircuitBreaker)StrategyWithContent. #1418
    • Use (Retry|CircuitBreaker)Stategy unless you need to retry by looking into the response content, because it reduces performance.

Dependencies

  • Brave 5.5.0 -> 5.5.1
  • Jetty 9.4.12 -> 9.4.14
  • Project Reactor 3.2.2 -> 3.2.3
  • netty-tcnative-boringssl-static 2.0.19 -> 2.0.20
  • Tomcat 9.0.12 -> 9.0.13, 8.5.34 -> 8.5.35
armeria -

Published by trustin almost 6 years ago

New features

  • An annotated service now allows specifying multiple RequestConverterFunctions for service method parameters. #1412
    public class MyService {
        @Get("/info")
        public String getInfo(@RequestConverter(FirstConverter.class)
                              @RequestConverter(SecondConverter.class)
                              MyInfoRequest request) { ... }
        // In old Armeria:
        // public String getInfo(@RequestObject(FirstConverter.class) 
        //                       MyInfoRequest request) { ... }
    }
    
  • Added RequestLog.requestStartTimeMicros() and responseStartTimeMicros() which provide timestamps with microsecond precision. This feature is available for Java 9 or above only. #1427
  • You can now inject different script for different requests in DocService. Previously, you were allowed to specify only one script for all requests. #1400

Improvements

  • You do not need to specify @RequestObject annotation for service method parameters anymore. #1412
    @RequestConverter(MyInfoRequestConverter.class)
    public class MyService {
        @Get("/info")
        public String getInfo(MyInfoRequest request) { ... }
        // In old Armeria:
        // public String getInfo(@RequestObject MyInfoRequest request) { ... }
    }
    
  • Improved the overall performance by reducing unnecessary event loop task scheduling. #1424
  • Improved the gRPC performance especially for the services with large payloads by reducing unnecessary memory copies. #1429

Bug fixes

  • Fixed a bug where HttpFileService does not invalidate cache when a file is modified, deleted or created. #1404
  • Fixed a bug where ClosedSessionException is raised when UnprocessedRequestException is expected. #1406
  • Fixed a bug where RequestLog does not reach COMPLETE availability in some cases. #1415
  • HttpClient does not normalize the request path unnecessarily anymore. #1416 #1417

Breaking changes

  • @RequestObject does not have a value anymore. Use @RequestConverter annotation instead. #1412

Dependencies

  • Brave 5.4.3 -> 5.5.0
  • gRPC 1.15.1 -> 1.16.1
  • java-jwt 3.4.0 -> 3.4.1
  • Micrometer 1.0.7 -> 1.1.0
  • Netty 4.1.30 -> 4.1.31
    • netty-tcnative-boringssl-static 2.0.17 -> 2.0.19
  • RxJava2 2.2.2 -> 2.2.3
  • Spring Boot 2.0.6 -> 2.1.0
armeria -

Published by trustin almost 6 years ago

Bug fixes

  • Armeria server fails to validate an annotated service when a request object cannot be converted into a Java bean even if a user registered a proper RequestConverterFunction. #1402
  • Sent a GOAWAY frame message is logged unnecessarily at WARN level when it was not actually sent. #1401 #1403
armeria -

Published by trustin about 6 years ago

New features

  • Added UnprocessedRequestException which is raised by an Armeria HTTP client when a user sent a request with the stream ID higher than the lastStreamId of the GOAWAY frame sent by the server. #1392
    • When your request fails with UnprocessedRequestException, it is safe to retry the request even if the request was not idempotent, as explained in the GOAWAY section of RFC 7540. Consider using RetryingHttpClient with RetryStrategy.onUnprocessed(), which auto-retries the request on an UnprocessedRequestException:
      // HTTP
      final HttpClient client = new HttpClientBuilder("https://example.com")
              .decorator(RetryingHttpClient.newDecorator(RetryStrategy.onUnprocessed()))
              .build();
      // RPC
      final MyGrpcServiceStub client = new ClientBuilder("gproto+https://example.com")
              .decorator(HttpRequest.class, HttpResponse.class,
                         RetryingHttpClient.newDecorator(RetryStrategy.onUnprocessed()))
              .build(MyGrpcServiceStub.class);
      
  • Added HTTP/2 settings to ServerBuilder #1389 #1393
    final Server server = new ServerBuilder()
            .http2InitialConnectionWindowSize(...) // Default: 1 MiB
            .http2InitialStreamWindowSize(...)     // Default: 1 MiB
            .http2MaxFrameSize(...)                // Default: 16384
            .http2MaxStreamsPerConnection(...)     // Default: 2^31-1
            .http2MaxHeaderListSize(...)           // Default: 8192
            ...
    
  • Added http2MaxHeaderListSize property to ClientFactoryBuilder #1393
    final ClientFactory clientFactory = new ClientFactoryBuilder()
            .http2MaxHeaderListSize(...) // Default: 8192
            ...
    
  • Added System property flags that affects the default HTTP/2 settings:
    • com.linecorp.armeria.defaultHttp2InitialConnectionWindowSize
    • com.linecorp.armeria.defaultHttp2InitialStreamWindowSize
    • com.linecorp.armeria.defaultHttp2MaxFrameSize
    • com.linecorp.armeria.defaultHttp2MaxStreamsPerConnection
    • com.linecorp.armeria.defaultHttp2MaxHeaderListSize
  • Added MediaType.WASM_APPLICATION #1394

Improvements

  • Changed the default initial HTTP/2 connection- and stream-level flow-control window size from 65535 to 1048576 for both client and server side. #1389 #1393

Bug fixes

  • HttpRequest.completionFuture() never completes when the request has no content. #1387
  • Armeria closes the connection prematurely on an HTTP/2 GOAWAY frame. #1392
  • Armeria server may close the connection prematurely when a client sends a too large request. #1393

Breaking changes

  • Some properties and flags related with HTTP/1 and HTTP/2 have been renamed for consistency. #1393
    • All protocol-related property names now start with protocol name, e.g.
      • (GOOD) http1MaxInitialLineLength (BAD) maxHttp1InitialLineLength
      • (GOOD) http2InitialConnectionWindowSize (BAD) initialHttp2ConnectionWindowSize
    • Please check your JVM's system properties since they were renamed in the same manner.

Dependencies

  • Brave 5.4.2 -> 5.4.3
  • Guava 26.0 -> 27.0
  • Micrometer 1.0.6 -> 1.0.7
  • Spring Boot 2.0.5 -> 2.0.6, 1.5.16 -> 1.5.17
armeria -

Published by trustin about 6 years ago

New features

  • Added ServerBuilder.startStopExecutor(Executor) so that a user can specify an alternative Executor other than GlobalEventExecutor which is used when Server invokes start/stop tasks. #1379
  • Added an interface AccessLogWriter which replaces the usage of Consumer<RequestLog> #1381
  • Added KafkaAccessLogWriter which produces Kafka records from RequestLogs. #1381
    • Unlike KafkaStructuredLoggingService, it can even produce the records for unmapped (404) or broken requests (400).
  • Added a flag com.linecorp.armeria.annotatedServiceExceptionVerbosity that allows a user adjust the verbosity of the exceptions raised by annotated services. #1382
    • all - logs all exceptions.
    • unhandled - (default) logs the exceptions that are not:
      • IllegalArgumentException
      • HttpStatusException or HttpResponseException
      • handled by any user-specified ExceptionHandlers
    • none - does not log any exceptions.

Improvements

  • The exception messages logged by annotated services now contain the current ServiceRequestContext. #1383

Bug fixes

  • Fixed a bug where HealthCheckedEndpointGroup does not work correctly when there are multiple endpoints with different IP addresses and same authority. #1375
  • Fixed a bug where armeria-saml does not decode some SAML messages correctly. #1377

Deprecations

  • AccessLogWriters has been deprecated. Use the factory methods in AccessLogWriter. #1381
  • StructuredLogJsonKafkaSerialize has been deprecated. Use @daniel-shuy's kafka-jackson-serializer instead. #1381
  • KafkaStructuredLoggingService has been deprecated. Use KafkaAccessLogWriter. #1381

Breaking changes

  • ServerBuilder.accessLogWriter() does not accept Consumer<? super RequestLog> but AccessLogWriter. #1381
  • The factory methods in AccessLogWriters do not return Consumer<RequestLog> but AccessLogWriter. #1381
  • ExceptionHandlerFunction.DEFAULT has been removed because it was not intended for use by a user. #1383

Dependencies

  • Brave 5.3.3 -> 5.4.2
  • gRPC 1.15.0 -> 1.15.1
  • Netty 4.1.29 -> 4.1.30
    • netty-tcnative-boringssl-static 2.0.15 -> 2.0.17
  • protobuf-jackson 0.2.1 -> 0.3.0
armeria -

Published by trustin about 6 years ago

New features

  • A user can customize the client options of the HttpClient used by HttpHealthCheckedEndpointGroup. #1363
    final HttpHealthCheckedEndpointGroup group =
        new HttpHealthCheckedEndpointGroupBuilder(delegateGroup, "/monitor/l7check")
            .withClientOptions(options -> options.setHttpHeader(HttpHeaderNames.USER_AGENT, "my-agent"))
            .build();
    
  • Added a built-in response converter for Reactive Streams Publisher. #1366
  • armeria-rxjava adds a built-in response converter for Observable. #1342 #1366

Bug fixes

  • Fixed NullPointerException in HttpRequestSubscriber.onSubscribe() #1369
  • Fixed ByteBuf leaks in gRPC client and server #1370 #1371

Dependencies

  • Brave 5.2.1 -> 5.3.3
  • fastutil 8.2.1 -> 8.2.2
  • gRPC 1.14.0 -> 1.15.0
  • Jackson 2.9.6 -> 2.9.7
  • Hibernate Validator 6.0.12 -> 6.0.13
  • Spring Boot 2.0.4 -> 2.0.5, 1.5.15 -> 1.5.16
  • Tomcat 9.0.11 -> 9.0.12, 8.5.33 -> 8.5.34
armeria -

Published by trustin about 6 years ago

Bug fixes

  • Fixed a bug where a query string that contains TAB, LF or CR is rejected. #1362
armeria -

Published by trustin about 6 years ago

New features

  • Added RequestContext.decodedPath() and ServiceRequestContext.decodedMappedPath() which decodes the percent-encoded UTF-8 path. #756 #1356
    • RequestContext.path() and ServiceRequestContext.mappedPath() remain unchanged.
      ServiceRequestContext ctx = ...;
      assert ctx.path().equals("/unicode/%F0%9F%91%8D");
      assert ctx.decodedPath().equals("/unicode/👍");
      
  • Added a utility class AsyncMethodCallbacks which bridges the gap between CompletionStage and AsyncMethodCallback. #508 #1357
    // Before:
    public void myThriftServiceMethod(AsyncMethodCallback<String> cb) {
        CompletableFuture<String> f = someAsyncOp();
        f.whenComplete((res, cause) -> {
            if (cause != null) {
                if (cause instanceof Exception) {
                    cb.onError(cause);
                } else {
                    cb.onError(new CompletionException(cause));
                }
            } else {
                cb.onComplete(res);
            }
        });
    }
    
    // After:
    public void myThriftServiceMethod(AsyncMethodCallback<String> cb) {
        AsyncMethodCallbacks.transfer(someAsyncOp(), cb);
    }
    

Bug fixes

  • Fixed a bug where the server-side response stream is not aborted immediately when the corresponding client aborts the stream. #1350
  • Fixed an AssertionError in StartStopSupport. #1351 #1358
  • Fixed a bug where %26, %3B and %3D are not handled correctly in a query string. #1354
  • Fixed a bug where Zipkin context does not work as expected when a new subspan is created in a non-event loop. #1355
  • Fixed a bug where the path parameters are provided in a percent-encoded UTF-8 form, rather than in a decoded form. #1356

Breaking changes

  • Since this release, due to the fix #1356, the path parameters which are:
    • retrieved using ServiceRequestContext.pathParam*() and PathMappingResult.pathParams()
    • injected via @Param annotation
    • .. will be provided in a decoded form. Please remove any decoding code such as URLDecoder.decode() to avoid double decode.

Dependencies

  • Jetty 9.4.11 -> 9.4.12
  • netty-tcnative-boringssl-static 2.0.14 -> 2.0.15
  • RxJava 2.2.1 -> 2.2.2
armeria -

Published by trustin about 6 years ago

Bug fixes

  • Fixed a bug where the CompletableFuture returned by Server.stop() may not complete when startup fails #1349
armeria -

Published by trustin about 6 years ago

New features

  • Added RequestContextCurrentTraceContext.newBuilder() which allows a user to customize the Zipkin context, such as decorating a trace scope #1328

  • Armeria now provides Spring configuration metadata for better IDE integration. #1340

  • Added a new utility class StartStopSupport which simplifies the implementation of asynchronous start-stop style life cycle #1344

    public class MyService implements AutoCloseable {
        private final StartStopSupport<Void, MyServiceListener> startStop = new StartStopSupport<>(ForkJoinPool.commonPool()) {
            @Override
            protected CompletableFuture<Void> doStart() { /* .. Implement startup .. */ }
            @Override
            protected CompletableFuture<Void> doStop() { /* .. Implement shutdown .. */ }
            @Override
            protected void notifyStarting(MyServiceListener listener) {
                listener.myServiceStarted(this);
            }
            ...
        };
    
        public CompletableFuture<Void> start() { return startStop.start(true /* fail if started */); }
        public CompletableFuture<Void> stop() { return startStop.stop(); }
        public void addListener(MyServiceListener listener) { startStop.addListener(listener); }
    
        @Override
        public void close() { startStop.close(); }
    }
    
    MyService myService = new MyService();
    CompletableFuture<Void> startFuture = myService.start();
    CompletableFuture<Void> stopFuture = myService.stop();
    

Bug fixes

  • The level of the log message about missing hostname command should be lowered from WARN to DEBUG, because some distributions do not have hostname command. #1333 #1348
  • RequestContext is not pushed for some gRPC callbacks such as onReady(). #1338

Deprecations

  • RequestContextCurrentTraceContext.INSTANCE has been deprecated in favor of RequestContextCurrentTraceContext.DEFAULT. #1328

Dependencies

  • Brave 5.1.5 -> 5.2.0
  • Hibernate Validator 6.0.11 -> 6.0.12
  • Netty 4.1.28 -> 4.1.29
    • netty-tcnative-boringssl-static 2.0.12 -> 2.0.14
  • RxJava 2.2.0 -> 2.2.1
  • Tomcat 9.0.10 -> 9.0.11, 8.5.32 -> 8.5.33
armeria -

Published by minwoox about 6 years ago

New features

  • Added SAML module so that a user can enable single sign-on on his or her services easily. #1292

  • RequestContextCurrentTraceContext is introduced which stores/loads the trace context into/from a RequestContexts attribute so that a user does not need to use thread local variable. #1322

    Tracing.Builder.currentTraceContext(RequestContextCurrentTraceContext.INSTANCE)
    
  • Added a new flag: com.linecorp.armeria.verboseResponses which is specified when a user wants to send verbose response, which is false by default. #1327

  • Added Copy and Clear buttons to DocService client. #1321

Bug fixes

  • A server does not accept invalid URLs anymore, that contain control characters and double dots which represent relative path. #1323 #1329
  • Set endOfStream for headers based on HTTP/2 frame EOS information. #1325

Breaking Changes

  • A user must use RequestContextCurrentTraceContext when building a Tracing. #1322
  • In the server responses, stack traces are not included anymore by default. If you prefer the previous behavior, specify -Dcom.linecorp.armeria.verboseResponses=true JVM option. #1327

Dependencies

  • Brave 5.1.4 -> 5.1.5
  • gRPC 1.13.2 -> 1.14.0
  • Guava 25.1 -> 26.0
  • Prometheus simpleclient_common 0.4.0 -> 0.5.0
  • RxJava 2.1.17 -> 2.2.0
  • Spring Boot 2.0.3 -> 2.0.4, 1.5.14 -> 1.5.15
armeria -

Published by trustin about 6 years ago

Bug fixes

  • Fixed a bug where TLS mutual authentication stopped to work. #1318
Package Rankings
Top 5.13% on Repo1.maven.org
Related Projects