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 hidden (Show)

armeria -

Published by trustin about 6 years ago

Bug fixes

  • Fixed a bug where DocService frontend doesn't handle an empty object ({}) correctly. #1314
  • Fixed a bug where HTTPS client does not ensure a certificate's domain name matches. #1315
armeria -

Published by trustin about 6 years ago

New features

  • A user can customize how Armeria handles duplicate path mappings via ServerBuilder.rejectedPathMappingHandler(RejectedPathMappingHandler). #1283 #1298

    ServerBuilder sb = new ServerBuilder();
    sb.rejectedPathMappingHandler((virtualHost, mapping, existingMapping) -> {
        // Do nothing.
    });
    sb.service("/", ...);
    sb.service("/", ...); // Ignored silently.
    
  • A user can now specify alternative responses for authorization success and failure when building an HttpAuthService using HttpAuthServiceBuilder. #506

    HttpAuthService authService = new HttpAuthServiceBuilder()
            .addBasicAuth(...)
            .onSuccess((delegate, ctx, req) -> HttpResponse.of(200))
            .onFailure((delegate, ctx, req, cause) -> HttpResponse.of(401))
            .build();
    
  • A user can now build a composite Authorizer from more than one Authorizers. #1303

    Authorizer<HttpRequest> a = ...;
    Authorizer<HttpRequest> b = ...;
    Authorizer<HttpRequest> c = ...;
    Authorizer<HttpRequest> composite = a.orElse(b).orElse(c);
    
  • Added EventLoopRule and EventLoopGroupRule for easier setup and tear-down of EventLoop and EventLoopGroup in a JUnit test case. #1304

    public class MyTest {
        @ClassRule
        public static final EventLoopRule eventLoop = new EventLoopRule();
        @Test
        public void runTask() {
            eventLoop.get().execute(() -> System.err.println("Hello!"));
        }
    }
    
  • Added RequestContext.executor() and RequestContext.contextAwareExecutor() for potentially easier mocking of RequestContext #1307

  • The frontend-side implementation of DocService has been rewritten with React, TypeScript and Material UI. #654 #1288

  • A user can now inject an arbitrary JavaScript string into DocService pages. It is also possible to inject example HTTP headers of DocService using JavaScript. This can be useful if you need to set the access token retrieved from browser's local storage to the example HTTP headers or to inject some analytics code. #1312

    • For example, a Firebase auth user would just add the following injected script to have debug requests automatically authenticated with a valid access token:

      armeria.registerHeaderProvider(function() {
        return firebase.auth().currentUser.getIdToken()
                       .then(token => { authorization: 'Bearer ' + token });
      });
      
  • Added a new system property com.linecorp.armeria.maxNumConnections so that a user can change the default max number of allowed server-side connections. The default value stays unchanged as Integer.MAX_VALUE. #1309

  • Retrofit client now supports HTTP response streaming, as well as waiting for the complete content. Streaming is disabled by default because there's no way to stream a response in a fully asynchronous manner in Retrofit (i.e. blocking calls will be involved). Use ArmeriaRetrofitBuilder.streaming(boolean) to enable this feature. #1296

Bug fixes

  • HealthCheckedEndpointGroup does not raise an unexpected exception anymore when there are duplicate endpoints to check. #1290
  • Suppressed duplicated log messages related with TLS handshake. #1297
  • Fixed a bug where Endpoint.toString() does not include an IP address. #1299
  • Fixed a bug where gRPC status code is not translated into HTTP status code properly for gRPC-Web. #1252 #1305
  • Fixed a bug where RequestLog does not contain gRPC request parameters and return values. #1308
    • For streaming requests or responses, only the first request or response will be recorded.
  • Fixed various notification issues where RequestLog does not reach COMPLETE availability for some edge cases. #1308

Breaking changes

  • HttpAuthService is now final. Use HttpAuthServiceBuilder for its customization. #1303

Dependencies

  • Brave 5.1.2 -> 5.1.4
  • Dropwizard Metrics 4.0.2 -> 4.0.3
  • gRPC 1.13.1 -> 1.13.2
  • Kafka 1.1.0 -> 1.1.1
  • Micrometer 1.0.5 -> 1.0.6
  • Netty 4.1.27 -> 4.1.28
  • RxJava 2.1.16 -> 2.1.17
  • ZooKeeper 3.4.12 -> 3.4.13
armeria -

Published by minwoox over 6 years ago

Improvements

  • Changed the default behavior to leave a warning log when creating an annotated service with redundant use of Optional and @Default #1284:

    // No need to use Optional because 'value' is always present.
    @Get("/foo/:value")
    public String foo(@Param Optional<String> value) {}
    
    // No need to use @Default because 'value' is always present.
    @Get("/bar/:value")
    public String bar(@Param @Default("defVal") String value) {}
    
    // Optional and @Default were used together. 'value' will always be present.
    @Get("/baz")
    public String baz(@Param @Default("defVal") Optional<String> value) {}
    

Bug fixes

  • Fixed various build errors on JDK 10. #1277
  • Fixed a bug where a RST frame for a non-existent stream can be sent. #1281
  • Fixed a StackOverflowError when stopping a starting server or starting a stopping server #1286

Breaking change

  • HTTP port is not added by default if TLS was enabled and no port was specified. #1285

Dependencies

  • Netty 4.1.25 -> 4.1.27
  • Bouncy Castle 1.59 -> 1.60
  • Tomcat 8.0.52 -> 8.0.53
armeria -

Published by trustin over 6 years ago

Bug fixes

  • Removed Javassist from armeria-bom so that a user, who runs his or her application on Java 8 and uses Javassist, does not get an exception. #1273

Dependencies

  • Removed Javassist because it is not used by Armeria at all. #1273
armeria -

Published by trustin over 6 years ago

New features

  • Added RequestContext.push() which deprecates RequestContext.push(RequestContext) #1266

    // Before:
    try (SafeCloseable ignored = RequestContext.push(ctx)) { ... }
    // After:
    try (SafeCloseable ignored = ctx.push()) { ... }
    
  • Added RequestContext.pushIfAbsent() which raises an IllegalStateException if the caller attempts to push a new context when there's already another context set #1266

Bug fixes

  • RxJava 2 plugin now properly throws an IllegalStateException when contexts are set incorrectly. #1266

Deprecations

  • RequestContext.push(RequestContext) has been deprecated in favor of RequestContext.push(). #1266

Dependencies

  • gRPC 1.12.0 -> 1.13.1
  • Jackson 2.9.5 -> 2.9.6
  • Micrometer 1.0.4 -> 1.0.5
  • Netty TCNative BorringSSL 2.0.8 -> 2.0.11
  • RxJava 2.1.14 -> 2.1.16
  • Brave 5.0.0 -> 5.1.2
  • Tomcat 9.0.8 -> 9.0.10, 8.5.31 -> 8.5.32
  • Jetty 9.4.10 -> 9.4.11
  • Javassist 3.22.0 -> 3.23.0
  • Spring Boot 2.0.2 -> 2.0.3, 1.5.13 -> 1.5.14
armeria -

Published by trustin over 6 years ago

New features

  • Added MeterIdPrefixFactory.activeRequestsPrefix() which is dedicated to generating MeterIdPrefix for active request counter gauges. #1258 #1260
    • It is useful when you wish to exclude a certain tag, such as httpStatus, which makes sense only for MeterIdPrefixFactory.apply().
    • See our default implementation for an example.

Improvements

  • Some 'strategy' interfaces now return CompletionStage instead of CompletableFuture so that a user does not have to call CompletionStage.toCompletableFuture(). #1237
    • CircuitBreakerStrategy
    • RetryStrategy
    • ThrottlingStrategy
  • LoggingDecorator now logs the request of a failed response for easier diagnosis. #1244
  • Improved the interoperability with some gRPC clients that do not accept application/grpc+proto media type. #1245
  • Improved gRPC performance related with media type handling. #1246
  • Improved the performance of EndpointSelectionStrategy.WEIGHTED_ROUND_ROBIN by reducing the time complexity from O(N * W) to O(log(N)), where N is the number of endpoints and W is the maximum weight. #1248
  • Refactored TomcatService so that managed Tomcat instances and unmanaged instances are handled separately. #1249
  • Improved the URI construction performance of armeria-retrofit2. #1250

Bug fixes

  • When using RetryingClient, the Exception of the last retry attempt was not propagated in a certain case. #1234
  • The HTTP headers returned by RequestLog now contains all the necessary pseudo headers such as :authority and :status so that loggers do not see unexpected nulls that make log processing complicated. #1235
  • RetryingClient did not stop when ClientFactory is closed. #1236
  • RetryingClient did not stop when StreamMessage is aborted. #1242
  • ServerBuilder now rejects duplicate path mappings to prevent a user mistake of binding more than one Service at the same path mapping. #529 #1247
  • HttpClient connected to a wrong host when custom authority is used. #1251
  • Armeria server now sends a 100 Continue response when Expect: 100-continue header exists in a request. #1255
  • The default MeterIdPrefixFunction does not add an httpStatus tag to active request count gauges anymore. #1258 #1260
  • Fixed interoperability issues with TomcatService and Spring Boot #1249

Deprecations

  • RequestLog.host() has been deprecated in favor of RequestLog.authority(). #1235

Breaking changes

  • RetryGiveUpException has been removed. #1234
  • TomcatService.connector() now returns Optional<Connector> instead of Connector. #1249
armeria -

Published by trustin over 6 years ago

New features

  • Added more methods related with accessing the IP address of an Endpoint. #1232

    assert Endpoint.of("example.com").hasIpAddr() == false;
    assert Endpoint.of("example.com").withIpAddr("1.2.3.4").hasIpAddr() == true;
    assert Endpoint.of("1.2.3.4").isIpAddrOnly() == true;
    assert Endpoint.of("::1").ipFamily() == StandardProtocolFamily.INET6;
    

Bug fixes

  • Fixed bugs where an Endpoint with an IP address is not handled correctly. #1230 #1233
    • This can cause HttpHealthCheckedEndpointGroup to send a health check request to a wrong IP address if a host name has multiple IP addresses, especially when used with DnsAddressEndpointGroup.
armeria -

Published by trustin over 6 years ago

New features

  • Added ServerBuilder.channelOption() and childChannelOption() so that a user can specify Netty ChannelOptions. #1009 #1189

    ServerBuilder sb = new ServerBuilder();
    sb.channelOption(ChannelOption.SO_BACKLOG, true);
    sb.channelOption(ChannelOption.SO_REUSEADDR, true);
    sb.childChannelOption(ChannelOption.SO_RCVBUF, 1048576);
    sb.childChannelOption(ChannelOption.SO_SNDBUF, 1048576);
    
  • Added ServiceRequestContext.additionalResponseHeaders() and ClientRequestContext.additionalRequestHeaders() so that a user can specify the additional HTTP headers to send when writing a request or a response. This feature is useful especially for RPC services such as THttpService. #992 #1225

    public class MyThriftServiceImpl implements MyThriftService.AsyncIface {
        @Override
        public void someServiceMethod(MyThriftRequest req,
                                      AsyncMethodCallback<MyThriftResponse> callback) {
            final ServiceRequestContext ctx = RequestContext.current();
            ctx.setAdditionalResponseHeader(HttpHeaderNames.of("my-custom-header"),
                                            "my-custom-value");
            ...
        }
    }
    
  • You can inject multi-value HTTP headers into a List or similar parameter in annotated services. #1025 #1191

    public class MyAnnotatedService {
        @Post("/post")
        public void post(@Header("item-id") List<Integer> itemIds) { ... }
        //               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    }
    
  • You can nest @RequestObject annotation in annotated services. #1175 #1191

    public class MyAnnotatedService {
        @Post("/post")
        public void post(@RequestObject MyBean bean) { ... }
        //               ^^^^^^^^^^^^^^^^^^^^^^^^^^
    }
    
    public class MyBean {
        public MyBean(@Param Integer foo, @Header String bar,
                      @RequestObject MyNestedBean nestedBean) { ... }
        //            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    }
    
    public class MyNestedBean { ... }
    
  • You can inject HTTP cookies into a new dedicated type Cookies in annotated services. #1222

    public class MyAnnotatedService {
        @Post("/post")
        public void post(Cookies cookies) {
            //           ^^^^^^^^^^^^^^^
            for (Cookie c : cookies) {
                System.err.println(c.name() + " = " + c.value());
            }
        }
    }
    
  • Added various default ResponseConverterFunction implementations for convenient JSON, text and binary response generation in annotated services. #1221

    public class MyAnnotatedService {
        @Get("/json")
        @ProducesJson // Shortcut of @Produces("application/json; charset=utf-8")
        public MyBean getJson() {
           /* ... MyBean will be converted into a JSON document by Jackson ... */
        }
    }
    
    • We also added @Produces, @Consumes and their various shortcut annotations such as @ProducesJson and @ConsumesJson for convenient media type negotication, consumption and production. See Media type negotiation for more information.

Improvements

  • We changed the default DistributionStatisticConfig so that Micrometer Timers and DistributionSummarys to have sensible settings. We increased the precision of the percentile values and made the histogram buckets are rotated every minute rather than every 40 seconds. #1226

Bug fixes

  • Fixed a bug where DynamicEndpointGroup and its subtypes notify their listeners even when the Endpoint list did not change. We also now sort the Endpoint list. #1216 #1220
  • Fixed a packaging issue where the armeria-tomcat8.5 JAR did not contain any files. #1218

Deprecations

  • ClientFactoryBuilder.socketOption() has been deprecated in favor of channelOption(), so that its naming is consistent with ServerBuilder.channelOption(). #1228
  • @ProduceType and @ConsumeType have been deprecated in favor of @Produces and @Consumes. #1221

Breaking changes

  • The status tag produced by the function returned by MeterIdPrefixFunction.ofDefault() has been renamed to httpStatus for clarity. #1215 #1219
  • ClientRequestContext.HTTP_HEADERS attribute has been removed. Use ClientRequestContext.additionalRequestHeaders #1225

Dependencies

  • Brave 4.19.2 -> 5.0.0
  • fastutil 8.1.1 -> 8.2.1
  • Guava 25.0 -> 25.1
  • RxJava 2.1.13 -> 2.1.14
armeria -

Published by trustin over 6 years ago

New features

  • An annotated service can now inject multiple HTTP headers into List<String>, Set<String> or Iterable<String>. #1164

    public class MyAnnotatedService {
        // The values of 'x-delete-options` are injected into 'xDeleteOptions'.
        @Delete("/users/:userId")
        public void deleteUser(@Param String userId, @Header List<String> xDeleteOptions) {
            ...
        }
    }
    
  • Added PrometheusRegistries.defaultRegistry #1171 #1181

    // Before
    PrometheusMeterRegistry r = PrometheusRegistries.newRegistry(CollectorRegistry.defaultRegistry);
    // After
    PrometheusMeterRegistry r = PrometheusRegistries.defaultRegistry;
    
  • Made the Timers and DistributionSummarys created by Armeria customizable. #1170 #1176

    MoreMeters.setDistributionStatisticConfig(
            DistributionStatisticConfig.builder()
                                       .percentiles(/* custom percentiles */)
                                       .expiry(/* custom expiry */)
                                       .build());
    
  • MeterIdPrefixFunction.ofDeault() now adds the status tag to meter IDs. #1172

  • Added the setters for ExceptionHandlerFunction, RequestConverterFunction and ResponseConverterFunction to AnnotatedServiceRegistrationBean. #1141 #1173

  • Added more decorator setters to all *ServiceRegistrationBeans. #1080 #1174

  • Added the access log format tokens for logging the properties of RequestLog. #1195

  • You can now customize the timestamp format in access log. #1195

  • You can now customize how CircuitBreakerClient determines whether a request was successful or not. #1192

  • Added a new service type called TransientService, the requests handled by it is not taken into account during graceful shutdown. #1196

  • Added a new unsafe gRPC client option GrpcClientOptions.UNSAFE_WRAP_RESPONSE_BUFFERS. #1204

  • Added a new module armeria-rxjava which provides a plugin for RxJava 2. By enabling this plugin, your RxJava functions will always be invoked with thread-local RequestContext set. #1194

    RequestContextAssembly.enable();
    
  • Added a new module armeria-tomcat8.5 for Tomcat 8.5 users. #1212

  • Added more convenience methods to HttpData. #1188 #1214

    • HttpData.toInputStream()
    • HttpData.toReader()
    • HttpData.toReaderUtf8()
    • HttpData.toReaderAscii()

Improvements

  • Reduced unnecessary CompositeByteBuf allocation in gRPC. #1167
  • CorsService is now compatible with Internet Explorer. #1186

Bug fixes

  • Fixed NullPointerException when an annotated service method returns void. #1165 #1166
  • Fixed NoClassDefFoundError in armeria-spring-boot* when armeria-thrift is not added to the dependencies. #650 #1182
  • The percentile and histogram gauges ('.percentile' and '.histogram'), implicitly exported by Micrometer default settings, have been blacklisted for DropwizardMeterRegistry, because the monitoring systems based on Dropwizard Metrics would prefer using the distribution stats provided by Dropwizard Histogram and Timer. #1190
  • The requests handled by HealthCheckService do not hinder timely graceful shutdown anymore. #1196
  • Fixed HTTP version autodetection issues with some HTTP/1 only servers. #1201 #1210

Deprecations

  • MoreMeters.summaryWithDefaultQuantiles() and timerWithDefaultQuantiles() have been deprecated. Use MoreMeters.newDistributionSummary() and newTimer(). #1176
  • *ServiceRegistrationBean.setDecorator() has been deprecated. Use setDecorators(). #1174

Breaking changes

  • The function returned by MeterIdPrefixFunction.ofDefault() now adds the status tag. Adjust your metric collection and monitoring system accordingly. #1172
  • CircuitBreakerClient is now an abstract class. Use CircuitBreakerHttpClient or CircuitBreakerRpcClient. #1192
  • CircuitBreakerBasedThrottlingStrategy has been removed without an alternative. See #1209 for rationale.

Dependencies

  • Brave 4.19.1 -> 4.19.2
  • gRPC 1.11.0 -> 1.12.0
  • Guava 24.1 -> 25.0
  • Jetty 9.4.9 -> 9.4.10
  • Micrometer 1.0.3 -> 1.0.4
  • Netty 4.1.24 -> 4.1.25
  • Prometheus 0.3.0 -> 0.4.0
  • Spring Boot 2.0.1 -> 2.0.2, 1.5.12 -> 1.5.13
  • Tomcat 9.0.7 -> 9.0.8, 8.5.30 -> 8.5.31, 8.0.51 -> 8.0.52
  • Zipkin 2.7.1 -> 2.8.3
  • ZooKeeper 3.4.11 -> 3.4.12

Known issues

  • We will rename the status tag added by the function returned by MeterIdPreficFunction.ofDefault()to httpStatus in our next release.
armeria -

Published by hyangtack over 6 years ago

Bug fixes

  • RequestLogAvailabilityException may be raised inside an access logger if any attribute of RequestLog is not ready. It causes for a user to have an incorrect access log message. #1159
armeria -

Published by trustin over 6 years ago

New features

  • Added more concise variants of HttpResponse.of() #1142

    // Defaults to HttpStatus.OK and MediaType.PLAIN_TEXT_UTF_8.
    HttpResponse.of("Hello, world!");
    HttpResponse.of("Hello, %s!", name);
    // Defaults to HttpStatus.OK.
    HttpResponse.of(MediaType.PLAIN_TEXT_UTF_8, "Hello, world!");
    HttpResponse.of(MediaType.PLAIN_TEXT_UTF_8, "Hello, %s!", name);
    
  • @Param and @Header annotations can be used without value if an annotated service class was compiled with -parameters option. #570 #1147

    // Before
    public class MyAnnotatedService {
        @Get("/get/:item")
        public String getItem(@Param("item") item) { .. }
        //                    ~~~~~~~~~~~~~~~~~~~ Have to type 'item' twice.
    }
    // After
    public class MyAnnotatedService {
        @Get("/get/:item")
        public String getItem(@Param item) { .. } 
        //                    ~~~~~~~~~~~ No need to type 'item' twice.
    }  
    
  • A user can define his or her own decorator annotation instead of using @Decorator annotations. #1010 #1149

    • Added @LoggingDecorator and @RateLimitingDecorator for a demonstrative purpose.

      public class MyAnnotatedService {
          @Get("/get/:product")
          @LoggingDecorator(successfulResponseLogLevel = LogLevel.INFO, samplingRate = 0.75f)
          @RateLimitingDecorator(1000.0f) // Up to 1000 req/s
          public String getProduct(@Param product) { .. }
      }
      
    • See Decorating an annotated service with a custom decorator annotation for more information.

  • armeria-zookeeper has been revamped to use Curator instead of vanilla ZooKeeper. #882 #1007 #1035 #1044

    • Added ZooKeeperUpdatingListenerBuilder to expose more configuration parameters.
  • Revamped DNS-based service discovery. #1088 #1148

    • Added DnsTextEndpointGroup which retrieves the endpoint list from TXT DNS records.
    • Added DnsAddressEndpointGroupBuilder, DnsServiceEndpointGroupBuilder and DnsTextEndpointGroupBuilder to provide more configuration properties.
    • All DNS-based EndpointGroup implementations now respec the TTL values returned by a DNS server, rather than sending a DNS query per second.
  • HttpAuthService can be configured to use a non-standard header to extract authentication tokens. #1132

    ServerBuilder sb = new ServerBuilder();
    sb.service("/my_service",
               myService.decorate(new HttpAuthServiceBuilder()
                       .addBasicAuth(myAuthrorizer, HttpHeadersNames.of("my-custom-header"))
                       .newDecorator()));
    
    
  • The access log writer implementations provided by AccessLogWriters logs RPC method name as a URI fragment. #1157

  • Added SSLeay PKCS#5 private key format support. #1144

Bug fixes

  • It was impossible to specify a NodeValueCodec when creating a ZooKeeperUpdatingListener. #1035
  • DocService did not detect the GrpcService bound with ServerBuilder.service(ServiceWithPathMappings) correctly. #1136 #1138
  • gRPC client did not handle non-200 response status correctly. #1152

Breaking changes

  • ZooKeeperUpdatingListener and ZooKeeperEndpointGroup have been refactored heavily with some factory methods removed. #1044
  • DnsAddressEndpointGroup and DnsServiceEndpointGroup have been refactored heavily with some factory methods removed. #1148

Dependencies

  • Bouncy Castle 1.59 (new)
  • Brave 4.18.2 -> 4.19.1
  • Curator 4.0.1 (new)
  • Netty 4.1.23 -> 4.1.24
  • protobuf-jackson 0.1.1 -> 0.2.1
  • Spring Boot 1.5.11 -> 1.5.12
  • Tomcat 9.0.6 -> 9.0.7, 8.5.29 -> 8.5.30, 8.0.50 -> 8.0.51
  • Zipkin 2.7.0 -> 2.7.1
armeria -

Published by trustin over 6 years ago

Bug fixes

  • #1125 HttpHeaders.contentType() returns an outdated value.

Breaking changes

  • #1126 armeria-spring-boot-* has been renamed to armeria-spring-boot1-* and armeria-spring-boot2-* has been renamed to armeria-spring-boot-* for artifact naming consistency.
    • If you are using Spring Boot 2, use armeria-spring-boot-*
    • If you are using Spring Boot 1, use armeria-spring-boot1-*

Dependencies

  • Spring Boot 1.5.10 -> 1.5.11, 2.0.0 -> 2.0.1
armeria -

Published by trustin over 6 years ago

Bug fixes

  • #1125 Fix a bug where HttpHeaders.contentType() returns an outdated value
armeria -

Published by trustin over 6 years ago

New features

  • #1118 Http(Request|Response).aggregateWithPooledObjects(), which does the same job with aggregate() except that it uses ByteBufHttpData for aggregation.
    • Note that this feature is for advanced users who want to sqeeze more performance out. You'd better stick to aggregate() in most cases.

Improvements

  • #1114 Reduced memory footprint related with HTTP header conversion

Bug fixes

  • #1119 Improved cleanup of streaming responses
    • A lot of harmless AbortedStreamException and ClosedChannelException will be suppressed so that they do not produce noisy log messages.
  • #1124 Broken Spring Boot 1 integration packaging

Breaking changes

  • #1121 StreamWriter.write() will throw ClosedPublisherException instead of IllegalStateException from this release.
armeria -

Published by trustin over 6 years ago

Bug fixes

  • #1091 Potential buffer leaks due to empty ByteBufHttpData
  • #1092 #1097 Buffer leak in StreamMessageDuplicator.close(), which affects RetryingClient
  • #1121 Throw ClosedPublisherException instead of IllegalStateException when StreamWriter.write() fails
  • #1119 Improve the cleanup of streaming responses
armeria -

Published by trustin over 6 years ago

New features

  • #1049 Spring Boot 2 support

    • Use the artifact armeria-spring-boot2-autoconfigure or armeria-spring-boot2-autoconfigure-shaded.
  • #1066 #1096 Parameter and header injection into bean property and constructor for annotated services. See the official documentation for more information.

    public class FinderService {
        @Get("/find/:id")
        public String find(@RequestObject FindRequest req) { ... }
    }
    
    // Using constructor
    public class FindRequest {
        public FindRequest(@Param("id") String id, @Header("x-type") String type) {
            this.id = id;
            this.type = type;
        }
        ...
    }
    
    // Using fields
    public class FindRequest {
        @Param("id") private String id;
        @Header("x-type") private String type;
    }
    
    // Using setters
    public class FindRequest {
        public void setId(@Param("id") String id) { ... }
        public void setType(@Header("x-type") String type) { ... }
    }
    
    // Using multi-field setters
    public class FindRequest {
        public void setAll(@Param("id") String id, @Header("x-type") String type) { ... }
    }
    
  • #1085 Easier self-signed TLS certificate generation with ServerBuilder.tlsSelfSigned(), which may be very useful for testing

    ServerBuilder sb = new Serverbuilder();
    sb.https(8443);
    sb.tlsSelfSigned();
    
  • #1087 #1089 Endpoint.ipAddr(), which allows specifying an IP address explicitly for an Endpoint. This is a preparatory work for providing better DNS-based service discovery.

  • #1090 MoreNamingConventions.configure(), which configures a Micrometer MeterRegistry to use our better naming convention

  • #1099 #1100 #1101 PROXY protocol support, which is useful when you are behind a load balancer such as HAProxy and AWS ELB

    ServerBuilder sb = new ServerBuilder();
    sb.port(8080, SessionProtoxol.PROXY, SessionProtocol.HTTP);
    
  • #1099 #1100 #1101 Ability to serve HTTP and HTTPS on the same port

    ServerBuilder sb = new ServerBuilder();
    sb.port(8888, SessionProtoxol.HTTP, SessionProtocol.HTTPS);
    // You can even enable PROXY protocol support, too.
    sb.port(9999, SessionProtoxol.PROXY, SessionProtocol.HTTP, SessionProtocol.HTTPS);
    

Bug fixes

  • #1091 Potential buffer leaks due to empty ByteBufHttpData
  • #1092 #1097 Buffer leak in StreamMessageDuplicator.close(), which affects RetryingClient
  • #1111 Rename the gauge armeria.server.numConnections to armeria.server.connections

Breaking changes

  • #1110 From this release, Armeria HTTP client will send HTTP/2 connection preface string PRI * HTTP/2.0 first when the URI scheme is http, in lieu of sending the HTTP/1 upgrade request HEAD / HTTP/1.1.
    • Specify -Dcom.linecorp.armeria.defaultUseHttp2Preface=false JVM option or use ClientFactoryBuilder.useHttp2Preface(false) to go back to the old behavior.

Dependencies

  • Brave 4.17.2 -> 4.18.2
  • gRPC 1.10.0 -> 1.11.0
  • Guava 24.0 -> 24.1
  • Jackson 2.9.4 -> 2.9.5
  • JCTools 2.1.1 -> 2.1.2
  • Jetty 9.4.8 -> 9.4.9
  • Kafka Clients 1.0.1 -> 1.1.0
  • Micrometer 1.0.1 -> 1.0.2
  • Netty TCNative BoringSSL 2.0.7 -> 2.0.8
  • Retrofit 2.3.0 -> 2.4.0
  • Tomcat 8.5.28 -> 9.0.6
  • Zipkin 2.5.1 -> 2.7.0
armeria -

Published by trustin over 6 years ago

New features

  • #1004 ServerListenerBuilder which allows functional composition of Runnables and Consumers for building a ServerListener

    ServerBuilder sb = new ServerBuilder();
    sb.serverListener(new ServerListenerBuilder()
            .addStartingCallback(server -> { ... })
            .addStoppingCallback(server -> { ... })
            .build());
    
  • #1018 Allow session protocol to be specified for HttpHealthCheckedEndpointGroup.

    HttpHealthCheckedEndpointGroup healthCheckedGroup =
            new HttpHealthCheckedEndpointGroupBuilder(delegateGroup, "/internal/l7check")
                    .protocol(SessionProtocol.HTTPS)
                    .retryInterval(Duration.ofSeconds(5))
                    .build();
    
  • #1050 #1051 More concise server port and TLS configuration in ServerBuilder

    ServerBuilder sb = new ServerBuilder();
    // Before
    sb.port(8080, SessionProtocol.HTTP);
    sb.port(8443, SessionProtocol.HTTPS);
    sb.sslContext(SessionProtocol.HTTPS, keyCertChainFile, keyFile);
    // After
    sb.http(8080);
    sb.https(8443);
    sb.tls(keyCertChainFile, keyFile);
    
  • #1056 RetryStrategy.onStatus() now accepts a BiFunction<HttpStatus, Throwable, Backoff> so that a user can handle both response status and exception.

    HttpClient client = new HttpClientBuilder("http://example.com/")
            .decorator(RetryingHttpClient.newDecorator(
                    RetryStrategy.onStatus((status, cause) -> {
                        if (cause != null) {
                            return backoffA;
                        }
                        if (status.codeClass() == HttpStatusClass.SERVER_ERROR) {
                            return backoffB;
                        }
                        return null; // Do not retry.
                    }));
            .build();
    
  • #1058 Add more server-side metrics:

    • armeria.server.numConnections - the number of open connections
    • armeria.server.pendingResponses - the number of pending responses during graceful shutdown

Improvements

  • #1012 Reduced the number of memory copies on the client-side.
  • #1017 Allow overriding :authority header when sending a request.

Bug fixes

  • #995 DocService does not recognize a prefix-mapped THttpService.
  • #996 #998 ThrottlingService does not work with RpcResponse.
  • #1000 1031 MeterIdPrefixFunction.ofDefault() doesn't collect service level metrics for unframed gRPC requests
  • #1008 Lack of armeria essential artifacts in the Maven BOM
  • #1013 #1056 RetryStrategy.on*Status() should allow retry on exceptions rather than just HTTP status.
  • #1014 #1024 #1027 Interoperability issues with Linkerd
  • #1019 Set previously health-checked endpoints that don't exist anymore to 'unhealthy'.
  • #1020 Don't notify the gRPC server listener of client closure if it will be notified of server closure.
  • #1021 #1059 Add missing @Nullable annotations throughout the API
  • #1022 ConcurrentModificationException in DefaultKeyedChannelPool.doClose()
  • #1028 #1030 Close in-progress responses when channel is closed.
  • #1037 #1064 Fix backpressure implementation of outbound gRPC traffic
  • #1047 gRPC stream is not canceled when client cancels.
  • #1062 Make sure gRPC stub handlers always run on an event loop thread.
  • #1065 Propagate the exceptions raised in StreamMessageDuplicator to the subscriber.

Deprecations

  • #1018 The public constructors of HttpHealthCheckedEndpointGroup have been deprecated. Use the of() factory methods or HttpHealthCheckedEndpointGroupBuilder.
  • #1050 #1051 Most ServerBuilder.port() methods have been deprecated. Use Server.http() or https().
  • #1050 #1051 ServerBuilder.sslContext() methods have been deprecated. Use ServerBuilder.tls().

Breaking changes

  • #1006 Removed ZooKeeperEndpointGroup.Mode. Mode.IN_NODE_VALUE was broken by design, which leaves only Mode.IN_CHILD_NODES.
  • #1056 RetryStrategy.onStatus() now accepts BiFunction<HttpStatus, Throwable, Backoff> instead of Function<HttpStatus, Backoff>. See the 'New features' section above for more information.

Dependencies

  • Caffeine 2.6.1 -> 2.6.2
  • gRPC 1.9.0 -> 1.10.0
  • Micrometer 1.0.0-rc.9 -> 1.0.1
  • Netty 4.1.21 -> 4.1.22
  • Prometheus 0.2.0 -> 0.3.0
  • Brave 4.14.3 -> 4.17.2
  • Zipkin 2.4.5 -> 2.5.1
  • Tomcat 8.5.27 -> 8.5.28 and 8.0.49 -> 8.0.50
armeria -

Published by trustin over 6 years ago

Bug fixes

  • #1001 Shaded Armeria JARs contain shaded dependencies
armeria -

Published by trustin over 6 years ago

New feature

  • #993 Allow creating PropertiesEndpointGroup without default port number.
    • You do not need to specify the defaultPort parameter when your endpoints' default ports are 80 or 443.

      final Properties props = new Properties();
      props.setProperty("myHosts.0", "foo.com");
      props.setProperty("myHosts.1", "bar.com");
      final PropertiesEndpointGroup group = PropertiesEndpointGroup.of(props, "myHosts");
      assert group.endpoints().contains(Endpoint.of("foo.com"));
      assert group.endpoints().contains(Endpoint.of("bar.com"));
      

Dependencies

  • Guava 23.6 -> 24.0
  • Netty 4.1.20 -> 4.1.21
  • Thrift 0.10.0 -> 0.11.0
armeria -

Published by trustin over 6 years ago

New features

  • #774 #945 RedirectService which sends a redirect response.

    ServerBuilder sb = new ServerBuilder();
    sb.service("/foo/{bar}", new RedirectService("/{bar}/foo"));
    sb.service("regex:^/old-location/(?<path>.*)$",
               new RedirectService("/new-location/{path}"));
    
  • #852 We now provide Maven BOM (Bill of Materials).

  • #935 #949 Annotated services now support enum parameter types.

    ServerBuilder sb = new ServerBuilder();
    sb.annotatedService(new Object() {
        @Get("/users/by_type/{userType}")
        public AggregatedHttpMessage listUsersByType(@Param("userType") UserType userType) { ... }
    });
    
    public enum UserType {
        ADMIN, MODERATOR, MEMBER
    }
    
  • #943 #979 All packages are now annotated with NonNullByDefault annotation so that Armeria is more friendly to the compilers and IDEs that understand JSR305 annotations, such Kotlin and IntelliJ IDEA.

    • For Kotlin, add -Xjsr305=strict or -Xjsr305=true compiler option, e.g.

      tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
          kotlinOptions {
              freeCompilerArgs = ["-Xjsr305=strict"]
          }
      }
      
  • #954 PropertiesEndpointGroup which loads the endpoint list from a .properties file or a Properties

    Properties props = new Properties();
    props.put("example.hosts.0", "example1.com");
    props.put("example.hosts.1", "example2.com:8080");
    props.put("example.hosts.2", "example3.com:9080");
    EndpointGroup myGroup = PropertiesEndpointGroup.of(props, "example.hosts", 80);
    
  • #965 Add a dangerous option to use ByteBufHttpData for incoming data in gRPC, which yields better throughput when payload is large

  • #967 #981 A Service now has more control over the path cache via Service.shouldCachePath().

    public class MyService implements HttpService {
        @Override
        public boolean shouldCachePath(String path, @Nullable String query, PathMapping pathMapping) {
            // Always cache the path.
            return true;
        }
        ...
    }
    

Improvements

  • #956 UnframedGrpcService implements ServiceWithPathMappings
  • #959 RequestLog prioritizes an RPC response exception over a stream exception.
  • #964 gRPC messages are serialized into ByteBufHttpData instead of DefaultHttpData for fewer memory copies.

Bug fixes

  • #951 Incorrect use of Class.isAssignableFrom() in annotated services
  • #967 #981 The paths for a prefix path mapping should not be cached by default.
  • #968 Zipkin traces are recorded incorrectly when multiples requests interleave.
  • #971 #973 Client disconnection is not notified in a bidirectional async gRPC.
  • #972 #975 ClientFactory.close() does not close all connections.

Dependencies

  • Prometheus and Dropwizard related dependencies are all optional now.
  • Brave 4.13.1 -> 4.14.3
  • Dropwizard Metrics 3.2.5 -> 4.0.2
  • gRPC 1.8.0 -> 1.9.0
  • Guava: 23.5-jre -> 23.6-jre
  • Jackson 2.9.2 -> 2.9.4
  • Jetty: 9.4.7.v20170914 -> 9.4.8.v20171121
  • Micrometer 1.0.0-rc.5 -> 1.0.0-rc.9
  • Netty: 4.1.19.Final -> 4.1.20.Final
  • Prometheus 0.1.0 -> 0.2.0
  • Spring Boot 1.5.9 -> 1.5.10
  • Tomcat 8.5.24 -> 8.5.27 and 8.0.48 -> 8.0.49
  • Zipkin 2.4.2 -> 2.4.5

Known issues

Package Rankings
Top 5.13% on Repo1.maven.org
Related Projects