Skip to main content

spring_boot_starter_feign 0.2.0 copy "spring_boot_starter_feign: ^0.2.0" to clipboard
spring_boot_starter_feign: ^0.2.0 copied to clipboard

Feign clients for spring_boot_dart: annotate an interface with @FeignClient and @GetMapping, inject it as a bean; JSON via ObjectMapper, interceptors, retries, fallbacks.

0.2.0 #

  • the auto-configured httpTransport backs off for an HttpTransport registered by an @Imported BeanRegistrar / ImportBeanDefinitionRegistrar of the application (two transports failed the start); its condition is decided when the auto-configuration is read, like Boot's OnBeanCondition
  • dismiss404, follow-redirects, event-stream.reconnect and spring.cloud.openfeign.client.decode-slash take true / false in any case (and on / off, yes / no, 1 / 0); anything else fails naming the key (yes was off for dismiss404, nope was on for the others).
  • Form bodies: with consumes: application/x-www-form-urlencoded (or that Content-Type header) a Map or object body is sent as name=value&... like Spring Cloud OpenFeign's SpringFormEncoder (it was sent as JSON).
  • Future<ResponseEntity<void>> ignores the body (a non-JSON body failed the call).
  • Future<HttpResponse> returns the raw response for any status, without error decoding, like Feign's Response.
  • A request-interceptors bean that is also a RequestInterceptor bean of the context runs once.
  • @FeignClient(configuration: [...]): the Retryer, ErrorDecoder and RequestInterceptor beans of the listed @Configuration() classes apply to that client only (and never reach the other clients); properties retryer, error-decoder and request-interceptors of spring.cloud.openfeign.client.config.<name> (bean or class names) win over them.
  • Breaking: default-request-headers is a Map<String, List<String>> and both default-request-headers and default-query-parameters are bound through the Binder: X: a,b and YAML lists (X[0], X[1]) give several values (lists were sent as a header X.0).
  • Breaking: DefaultRetryer waits 150 ms, 225 ms, ... (period × 1.5^attempt) like Feign's Retryer.Default (it started at 100 ms).
  • Breaking: BasicAuthRequestInterceptor encodes ISO-8859-1 like Feign (encoding: utf8 for other characters).
  • A client url without a scheme gets http://; @FeignClient(url: '') (or a placeholder resolving to empty) falls back to the url property.
  • A query written in a mapping path (@GetMapping('/items?type=a%20b&flag')) is sent as written; the call's parameters are appended.
  • Breaking: FeignClientFactory looks up the interceptors, error decoder and retryer per client; its interceptors / errorDecoder / retryer arguments are optional overrides.

0.1.7 #

  • @GetMapping() without a path calls the url and path of the client itself.
  • required and defaultValue of @RequestParam / @RequestHeader and required of @PathVariable: defaultValue is sent for a null argument; a required null fails the call with an ArgumentError naming the parameter before anything is sent; a null that is not required leaves a query parameter or header out (a path variable becomes an empty string).
  • spring.cloud.openfeign.client.config.* keys with relaxed names, like Spring Cloud OpenFeign's binding: readTimeout, loggerLevel, defaultRequestHeaders.X-Shop, read_timeout, environment variables
  • Breaking: Map parameters of @RequestParam / @RequestHeader give one query parameter / header per entry (they were sent as JSON); an object as the value of a path variable, query parameter, header or cookie (a class written as a JSON object) stops the application at startup, or fails the call with an EncodeException when only the value tells.
  • Breaking: mapping headers use Spring's 'Name=value' (as Spring Cloud OpenFeign reads them; server conditions like '!Name' are ignored); 'Name: value' stops the application with the reason.
  • Breaking: read-timeout is the longest wait for data (for the response, then between two chunks of the body), not a limit for the whole call; default read-timeout 60 s and connect-timeout 10 s, like Feign's Request.Options() (0 for none).
  • Breaking: RequestTemplate.header adds a value like Feign's (it replaced); new removeHeader. Interceptors run for every attempt of a call on a new template (a refreshed token reaches the retry); default-request-headers (and the default Accept) are applied after the interceptors, for names they did not set.
  • Breaking: dismiss404 keeps throwing for void methods, like Feign.
  • Breaking: the <--- ERROR and ---> RETRYING log lines are written only above logger-level: none.
  • @FeignClient(contextId:, qualifiers:, primary:, dismiss404:) like Spring Cloud OpenFeign (primary and qualifiers need the matching generator).
  • default-query-parameters.<name>, follow-redirects, spring.cloud.openfeign.client.decode-slash (default true: a / in a path variable stays a /).
  • @CookieValue parameters (one Cookie header).
  • DefaultErrorDecoder reads Retry-After as an HTTP date too.
  • README: more "Differences from Spring Cloud OpenFeign" (default Accept, spaces as +, masked Authorization, logger names).

0.1.6 #

  • update road map
  • ci: release with a button on main, skip new packages when publishing; shorter pubspec descriptions

0.1.5 #

  • Initial version: @FeignClient interfaces with request mapping annotations, JSON through ObjectMapper, interceptors, error decoding, retries, fallbacks, spring.cloud.openfeign.client.config.* properties.
  • Server-sent events: methods returning EventStream<T> (or Stream<T>) read text/event-stream responses, decode each event's data, reconnect with Last-Event-ID (event-stream.* properties; not in Spring Cloud OpenFeign).
0
likes
0
points
608
downloads

Publisher

verified publisherfarum-azula.org

Weekly Downloads

Feign clients for spring_boot_dart: annotate an interface with @FeignClient and @GetMapping, inject it as a bean; JSON via ObjectMapper, interceptors, retries, fallbacks.

Repository (GitHub)
View/report issues

Topics

#http #rest #spring

License

unknown (license)

Dependencies

spring_boot_dart, spring_web_dart

More

Packages that depend on spring_boot_starter_feign