Latest release

armeria-0.67.2

@minwoox minwoox released this Jul 13, 2018 · 14 commits to master since this release

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-0.67.1

@trustin trustin released this Jun 27, 2018 · 28 commits to master since this release

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-0.67.0

@trustin trustin released this Jun 27, 2018 · 30 commits to master since this release

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-0.66.0

@trustin trustin released this Jun 15, 2018 · 41 commits to master since this release

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-0.65.1

@trustin trustin released this May 31, 2018 · 63 commits to master since this release

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-0.65.0

@trustin trustin released this May 31, 2018 · 67 commits to master since this release

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-0.64.0

@trustin trustin released this May 21, 2018 · 81 commits to master since this release

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-0.63.1

@hyangtack hyangtack released this Apr 25, 2018 · 122 commits to master since this release

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-0.63.0

@trustin trustin released this Apr 25, 2018 · 127 commits to master since this release

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-0.62.0

@trustin trustin released this Apr 6, 2018 · 149 commits to master since this release

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