Finatra v19.7.0 Release Notes

Release Date: 2019-07-18 // almost 5 years ago
  • โž• Added

    โœ… finatra-kafka-streams: Adding test/sample for FinatraDslWindowedAggregations.aggregate. ae433fc

    ๐Ÿ‘ finatra-jackson: Add com.twitter.util.Time deserializer with JsonFormat support. ed3d666

    ๐Ÿ”„ Changed

    โšก๏ธ finatra-kafka: BUILD file update compile and runtime deps. 8241cd7

    ๐Ÿ—„ finatra-httpclient: introduce new HttpClientModuleTrait and deprecate HttpClientModule.
    The HttpClientModule has been modified to extend from HttpClientModuleTrait to allow
    ๐Ÿ—„ for bridging the two implementations. c.t.f.httpclient.RichHttpClient has also been deprecated
    ๐Ÿ”ง as part of this change. The new HttpClientModuleTrait allows for direct configuration of the
    underling c.t.finagle.Http.Client. The new HttpClientModuleTrait does not provide any
    0๏ธโƒฃ default bindings, so it is up to users to supply them - this allows for custom binding
    annotations and binding multiple HttpClients, which was not previously possible with
    HttpClientModule. fe0c94a

    To migrate,

    class MyHttpClientModule extends HttpClientModule {
      override val dest = "flag!mydest"
      override val sslHostname = Some("sslHost")
    }
    

    becomes

    class MyHttpClientModule extends HttpClientModuleTrait {
      override val dest = "flag!mydest"
      override val label = "myhttpclient"
      val sslHostname = "sslHost"
    
      // we only override in this example for TLS configuration with the `sslHostname`
      override def configureClient(
        injector: Injector,
        client: Http.Client
      ): Http.Client = client.withTls(sslHostname)
    
      @Singleton
      @Provides
      final def provideHttpClient(
        injector: Injector,
        statsReceiver: StatsReceiver,
        mapper: FinatraObjectMapper
      ): HttpClient = newHttpClient(injector, statsReceiver, mapper)
    
      // Note that `provideHttpClient` no longer needs an injected `Service[Request, Response]` so
      // the following is only needed if you require a `Service[Request, Response]` elsewhere:
    
      @Singleton
      @Provides
      final def provideHttpService(
        injector: Injector,
        statsReceiver: StatsReceiver
      ): Service[Request, Response] = newService(injector, statsReceiver)
    
    }