Bot releases are hidden (Show)
Published by finaglehelper about 4 years ago
Published by finaglehelper about 4 years ago
Published by finaglehelper about 4 years ago
finatra: Update org.scalatest dependency to 3.1.2 and introduce finer-grained dependencies on
org.scalatestplus artifacts. ceccb7c5 fbb7b535
inject-thrift-client: Remove unused ClientId property from
ThriftMethodBuilderClientModule#provideServicePerEndpoint method. 381853f8
inject-server: Improve startup time of EmbeddedTwitterServer by observing lifecycle events to
determine startup, where previously we were doing 1 second polls. The nonInjectableServerStarted
property is removed and isStarted should be referenced regardless of the type of underlying
twitterServer type. The end result should see a faster test execution feedback loop. Our Finatra
test targets range from a roughly 2x to 10x reduction in execution times.
You may experience new test failures in cases where an exception is thrown as part of
c.t.inject.TwitterServer.start() or c.t.server.TwitterServer.main() and the test would have
expected a failure as part of startup. As the error takes place after the startup lifecycle,
you may now need to Await.result the EmbeddedTwitterServer.mainResult() to assert the error.
You may also experience some new non-deterministic behavior when testing against PubSub style
logic. As the server may be started earlier, your tests may be relying on assumptions that
an event would have occurred within the previous 1 second startup poll, which is no longer
guaranteed. You may need to adjust your test logic to account for this behavior.
finatra: Update com.google.inject.guice dependency to 4.2.3 and net.codingwell.scala-guice
to version 4.2.11. The net.codingwell.scala-guice library has switched from Manifests to TypeTags
for transparent binding and injector key creation. The c.t.inject.TwitterModule has moved from its
custom bind DSL to the scalaguice.ScalaModule which brings the TwitterModule inline with both the
TwitterPrivateModule and the bind[T] test DSL to now have the same consistent binding DSL across
all three. Thus, there is no more confusing bindSingleton function in the TwitterModule bind API.
Upgrading scalaguice helps move a necessary dependency of Finatra to a version which is Scala 2.13
compatible moving Finatra closer to Scala 2.13 support. 26c1e810 5faa2e6f
Published by finaglehelper over 4 years ago
Published by finaglehelper over 4 years ago
PHAB_ID=472013
Published by yufangong over 4 years ago
inject-app: Add default type conversions for java.time.LocalTime
, c.t.util.Time
,
java.net.InetSocketAddress
, and c.t.util.StorageUnit
. This allows the injector to convert from
a String representation to the given type. The type conversion for java.net.InetSocketAddress
uses the c.t.app.Flaggable.ofInetSocketAddress
implementation and the type conversion for
c.t.util.Time
uses the c.t.app.Flaggable.ofTime
implementation for consistency with Flag parsing.
Because of the current state of type erasure with c.t.app.Flag
instances, Finatra currently binds
a parsed c.t.app.Flag
value as a String type, relying on registered Guice TypeConverters to convert
from the bound String type to the requested type. These conversions now allow for a c.t.app.Flag
defined over the type to be injected by the type as Guice now has a type conversion from the bound
String type rather than as a String representation which then must be manually converted.
20ac122f
finatra-http: Method in tests to return an absolute path URI with the https scheme and authority
ffed3815
finatra: Java-friendly bindClass
test APIs. The bindClass
API calls from Java can be
now chained with the TestInjector
, EmbeddedApp
, EmbeddedTwitterServer
,
EmbeddedThriftServer
, and EmbeddedHttpServer
. For example, the following is now possible:
EmbeddedHttpServer server = new EmbeddedHttpServer(
new HelloWorldServer(),
Collections.emptyMap(),
Stage.DEVELOPMENT)
.bindClass(Integer.class, Flags.named("magic.number"), 42)
.bindClass(Integer.class, Flags.named("module.magic.number"), 9999);
return server;
inject-app: Introduce consistent c.t.app.Flag
creation methods for Java. Bring HTTP and Thrift
server traits inline with each other to provide consistent Java support. Ensure Java examples in
documentation. c7d8c46c
inject-core: Update the configuration of c.t.app.Flag
instances created within a c.t.inject.TwitterModule
to have failFastUntilParsed
set to 'true' by default. While this is configurable for a given
c.t.inject.TwitterModule
, much like for the application itself, it is STRONGLY recommended that
users adopt this behavior. e74ef0a3
inject-app: Update c.t.inject.app.TestInjector
to always add the InjectorModule
.
6e53e77a
inject-app: Reduce visibility of internal code in c.t.inject.app.internal
. a166dc89
inject-modules: Updated BUILD files for Pants 1:1:1 layout. a4fbbd19
Published by finaglehelper over 4 years ago
inject-app: Add Java-friendly main
to EmbeddedApp
. 4b40075d
finatra-kafka: Expose timeout duration in KafkaProducerConfig dest(). c5340a97
CaseClassDeserializer
to efficiently apply per field and method validations as requestnoValidation
in their server configurations. For more information, please checkoutPublished by finaglehelper over 4 years ago
finatra-kafka-streams: Add method to c.t.f.kafkastreams.test.TopologyTesterTopic
to write
Kafka messages with custom headers to topics. a9fef3dc
finatra-http: Add toBufReader
to get the underlying Reader of Buf from StreamingResponse.
If the consumed Stream primitive is not Buf, the returned reader streams a serialized
JSON array. 876d0ba9
inject-app: Add functions to c.t.inject.app.AbstractApp
to provide better
ergonomics for Java users to call and use basic App
lifecycle callbacks.
f04772df
inject-server: Add functions to c.t.inject.server.AbstractTwitterServer
to provide
better ergonomics for Java users to call and use basic TwitterServer
lifecycle
callbacks. f04772df
inject-slf4j: Add a way to retrieve the currently stored Local Context map backing the
MDC. 12b9410e
finatra-jackson: Added new functionality in the CaseClassDeserializer
to support more
Jackson annotations during deserialization. See documentation for more information.
49014890
finatra: Add NullKafkaProducer for unit tests to avoid network connection failures in the log.
d8d4d5db
finatra-validation|jackson: Remove Jackson dependency from finatra/validation. This
was for ErrorCode
reporting but can be moved to finatra/jackson. f024f929
finatra-kafka-streams: (BREAKING API CHANGE) Update AsyncTransformer to preserve
record context. be5dd08f
finatra-jackson: Better handling of Scala enumeration mapping errors. Currently, if mapping
of a Scala enumeration during deserialization fails a java.util.NoSuchElementException
is
thrown which escapes deserialization error handling. Update to instead handle this failure case
in order to correctly translate into a CaseClassFieldMappingException
which will be wrapped
into a CaseClassMappingException
. 4753c6e8
finatra: Update Google Guice version to 4.2.0 76506c35
finatra: Bumped version of Joda to 2.10.2 and Joda-Convert to 1.5. 9adef421
finatra-jackson|finatra-http-annotations: Move http-releated Jackson "injectablevalues"
annotations from finatra/jackson
to finatra/http-annotations
.
Specifically the follow have changed packages,
c.t.finatra.request.QueryParam
--> c.t.finatra.http.annotations.QueryParam
c.t.finatra.request.RouteParam
--> c.t.finatra.http.annotations.RouteParam
c.t.finatra.request.FormParam
--> c.t.finatra.http.annotations.FormParam
c.t.finatra.request.Header
--> c.t.finatra.http.annotations.Header
c.t.finatra.request.JsonIgnoreBody
--> c.t.finatra.http.annotations.JsonIgnoreBody
Users should update from finatra/jackson/src/main/java
(finatra-jackson_2.12
)
to finatra/http-annotations/src/main/java
(finatra-http-annotations_2.12
).
77469e17
finatra-jackson: Updated Finatra Jackson integration to introduce a new ScalaObjectMapper
and module to simplify configuration and creation of the mapper. See documentation for more
information. 49014890
finatra-jackson: (BREAKING API CHANGE) Moved the java binding annotations, CamelCaseMapper
and
SnakeCaseMapper
from c.t.finatra.annotations
in finatra/jackson
to
c.t.finatra.json.annotations
in finatra/json-annotations
. Moved
c.t.finatra.response.JsonCamelCase
to c.t.finatra.json.annotations.JsonCamelCase
which is also
now deprecated. Users are encouraged to use the standard Jackson annotations or a mapper with
the desired property naming strategy configured.
Many exceptions for case class deserialization were meant to be internal to the framework but are
useful or necessary outside of the internals of JSON deserialization. As such we have cleaned up
and made most JSON deserialization exceptions public. As a result, all the exceptions have been moved
from c.t.finatra.json.internal.caseclass.exceptions
to c.t.finatra.jackson.caseclass.exceptions
.
c.t.finatra.json.internal.caseclass.exceptions.CaseClassValidationException
has been renamed to
c.t.finatra.jackson.caseclass.exceptions.CaseClassFieldMappingException
. JsonInjectException
,
JsonInjectionNotSupportedException
, and RequestFieldInjectionNotSupportedException
have all been
deleted and replaced with c.t.finatra.jackson.caseclass.exceptions.InjectableValuesException
which represents the same error cases.
The FinatraJsonMappingException
has been removed. Users are encouraged to instead use the general
Jackson JsonMappingException
(which the FinatraJsonMappingException
extends).
RepeatedCommaSeparatedQueryParameterException
has been moved tom finatra/http.
49014890
finatra-jackson: Access to parameter names via Java reflection is not supported in Scala 2.11.
Added a work around for the parsing of case class structures to support JSON deserialization in
Scala 2.11 and forward. 59ec2c21
finatra-jackson: Fix for enforcing "fail on unknown properties" during deserialization. Previously,
the CaseClassDeserializer
was optimized to only read the fields in the case class constructor
from the incoming JSON and thus ignored any unknown fields during deserialization. The fix will
now properly fail if the DeserializationFeature
is set or if the JsonProperties
is configured
accordingly. 49014890
Published by finaglehelper over 4 years ago
Published by finaglehelper almost 5 years ago
finatra: Upgrade to jackson 2.9.10 and jackson-databind 2.9.10.1 14fc3714
finatra: Correctly track Ignorable Exceptions in per-method StatsFilter. Responses
marked as Ignorable are tracked in the global requests and exceptions metrics but
were not counted under the per-method metrics. There are now counts of ignored
and total requests as well as ignored requests by Exception for each method. E.g.
per_method_stats/foo/ignored 1
per_method_stats/foo/ignored/java.lang.Exception 1
per_method_stats/foo/requests 1
finatra-http|jackson (BREAKING API CHANGE): Move parsing of message body contents
from finatra/jackson via the FinatraObjectMapper #parseMessageBody, #parseRequestBody,
and #parseResponseBody methods to finatra/http with functionality replicated via an
implicit which enhances a given FinatraObjectMapper. Additionally we have updated
finatra-http the MessageBodyComponent API to use c.t.finagle.http.Message instead
of c.t.finagle.http.Request and c.t.finagle.http.Response. This means that users can use the
MessageBodyComponent API to read the body of Finagle HTTP requests or responses and all HTTP
concerns are co-located in finatra-http instead of being partially implemented in finatra-jackson.
In updating the MessageBodyComponent API we have removed support for polymorphic MessageBodyReader
types, that is we have simplified the MessageBodyReader API to no longer express the #parse
method parameterized to a subtype of the class type. This API allowed parsing a message body
into a subtype solely through the presence of a given type parameter but the resulting API has
proven to be extremely clunky. We feel that the same behavior is achievable in other ways (such
as adapting the type after parsing) and the improvement and simplification of the
MessageBodyReader API to be worth removing the awkward method signature.
Lastly, we have fixed the returned charset encoding on response content-type header to be
applicable only where appropriate instead of always being added when the
http.response.charset.enabled flag is set to true. 4c6283b2
finatra: (BREAKING API CHANGE) move DarkTrafficFilter and related modules
from finatra/thrift to inject/inject-thrift-client. The modules now extend
from c.t.inject.thrift.modules.ThriftClientModuleTrait for more uniform configuration.
The following changes were made:
- c.t.finatra.thrift.filters.DarkTrafficFilter ->
c.t.inject.thrift.filters.DarkTrafficFilter- c.t.finatra.thrift.modules.DarkTrafficFilterModule ->
c.t.inject.thrift.modules.DarkTrafficFilterModule- c.t.finatra.thrift.modules.ReqRepDarkTrafficFilterModule ->
c.t.inject.thrift.modules.ReqRepDarkTrafficFilterModule- c.t.finatra.thrift.modules.JavaDarkTrafficFilterModule ->
c.t.inject.thrift.modules.JavaDarkTrafficFilterModule
finatra: Update Google Guice version to 4.1.0, update ScalaTest to 3.0.8, and ScalaCheck
to 1.14.0. 1bc3e889
finatra-http: Remove deprecated c.t.finatra.http.HttpHeaders. Users should use
com.twitter.finagle.http.Fields instead. e9e5d4e2
finatra-http: Remove deprecated DocRootModule. 6163e7f7
finatra-http: (BREAKING CHANGE) Remove automatic handling of Mustache rendering from
finatra/http and break Mustache support into two separate libraries: finatra/mustache
and finatra/http-mustache.
HTTP services that want the framework to automatically negotiate Mustache template rendering
via the Finatra HTTP MessageBodyComponents framework must now bring this concern into their
HTTP services via the finatra/http-mustache c.t.finatra.http.modules.MustacheModule as the
HTTP framework support for specifying a MustacheModule in the HttpServer has been removed.
I.e., add this module to the server's list of modules.
Additionally, it is also now possible to use Mustache templating completely independent of
Finatra HTTP concerns by consuming and using only the finatra/mustache library which will
render Strings via defined Mustache templates. e6aaa19f
Published by finaglehelper almost 5 years ago
Published by finaglehelper about 5 years ago
Published by finaglehelper about 5 years ago
finatra: Remove commons-lang as a dependency and replace it with alternatives from stdlib when possible. 1c32f9a7
inject-server: Changed c.t.inject.server.InMemoryStatsReceiverUtility to show the expected and
actual values as part of the error message when metric values do not match. cefb1749
finatra-kafka-streams: Improve StaticPartitioning error message ec0f87fd
finatra-http: Support Http 405 response code, improve routing performance for non-constant route 983a2c8f
inject-app: Update c.t.inject.app.App to only recurse through modules once. We currently
call TwitterModule#modules more than once in reading flags and parsing the list of modules
over which to create the injector. When TwitterModule#modules is a function that inlines the
instantiation of new modules we can end up creating multiple instances causing issues with the
list of flags defined in the application. This is especially true in instances of TwitterModule
implemented in Java as there is no way to implement the trait TwitterModule#modules method as a
eagerly evaluated value. We also don't provide an ergonomic method for Java users to define
dependent modules like we do in apps and servers via App#javaModules. Thus we also add a
TwitterModule#javaModules function which expresses a better API for Java users. 8d0a59fa
Published by finaglehelper about 5 years ago
c.t.finatra.http.streaming.StreamingRequest
9687e2d7,c.t.finatra.http.streaming.StreamingResponse
30fcb686.fields
in the MethodValidation
annotation.c.t.finatra.http.response.StreamingResponse
, Usec.t.finatra.http.response.ResponseBuilder.streaming
to construct ac.t.finatra.http.streaming.StreamingResponse
instead. 30fcb686
Published by finaglehelper over 5 years ago
finatra-kafka-streams: Adding test/sample for FinatraDslWindowedAggregations.aggregate
. ae433fc982e7676eacb6cdc18dd53586bb725adf
finatra-jackson: Add com.twitter.util.Time
deserializer with JsonFormat
support. ed3d666a78fc80ab2cbac61bff2f5d4b522ebbd4
finatra-kafka: BUILD file update compile and runtime deps. 8241cd7c959536be953fb2767aa09e4a80ebd1b6
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
default bindings, so it is up to users to supply them - this allows for custom binding
annotations and binding multiple HttpClient
s, which was not previously possible with
HttpClientModule
. fe0c94aaa616c0f1a63516a3278437ac549850c3
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)
}
Published by finaglehelper over 5 years ago
StackClientModuleTrait
to aid in configuring modules for genericc.t.inject.server.InMemoryStatsReceiverUtility
which allows for testingInMemoryStatsReceiver
. Update theInMemoryStatsReceiverUtility
and mark thec.t.finatra.kafka.test.utilsInMemoryStatsUtil
as deprecated. f82afa58
response_size
stat from c.t.finatra.http.filters.StatsFilter
.c.t.finatra.kafka.consumers.FinagleKafkaConsumer
.c.t.finatra.kafka.consumers.FinagleKafkaConsumer.buildClient
andc.t.finatra.kafka.producters.FinagleKafkaProducer.buildClient
. 4f975c34
com.sun.activation
to allow for usingPublished by finaglehelper over 5 years ago
c.t.finatra.http.RouteHint
was missing from the test-jar sources and hasPublished by finaglehelper over 5 years ago
Published by finaglehelper over 5 years ago
inject-server: Add globalFlags argument to EmbeddedTwitterServer, which will
allow for scoping a c.t.a.GlobalFlag property change to the lifecycle of the
underlying TwitterServer, as a c.t.a.GlobalFlag is normally scoped to the JVM/process.
This change is also reflected in EmbeddedHttpServer and EmbeddedThriftServer constructors.
38a3180a
inject-utils: add toOrderedMap implicit conversion for java.util.Map 1686420c
finatra-kafka-streams: Add flag rocksdb.manifest.preallocation.size with default value
4.megabytes to c.t.f.k.c.RocksDbFlags and set value in
c.t.f.k.c.FinatraRocksDBConfig. 0cac9785
finatra-http: Add commaSeparatedList boolean parameter to QueryParams, for
parsing comma-separated query parameters into collection types. 0ae425a2
finatra-kafka: Upgraded kafka libraries from 2.0.0 to 2.2.0.
finatra-thrift: Removed c.t.finatra.thrift.exceptions.FinatraThriftExceptionMapper,
c.t.finatra.thrift.filters.ClientIdAcceptlistFilter,
c.t.finatra.thrift.modules.ClientIdAcceptlistModule,
c.t.finatra.thrift.filters.ClientIdWhitelistFilter,
c.t.finatra.thrift.modules.ClientIdWhitelistModule,
and the finatra/finatra_thrift_exceptions.thrift IDL. caed5ec8
finatra-thrift: Constructing a ThriftRouter now requires serverName. dc357fd8
finatra-examples: Updated StreamingController to use Reader instead of AsyncStream
3d5e3282
finatra-kafka-streams: Implement FinatraKeyValueStore as custom store. cd38ddf6
finatra-thrift: Constructing a ThriftRouter now requires c.t.f.StackTransformer.
a96312d2
Published by finaglehelper over 5 years ago
finatra-kafka: FinagleKafka clients pass correct deadline for close to
underlying Kafka clients. 6e579e60
finatra-kafka-streams: (BREAKING API CHANGE) Create flags for common consumer and producer
configs. KafkaFlagUtils#kafkaDocumentation and getKafkaDefault are no longer public methods.
9ca7eac5
finatra-kafka: Added support to fetch end offset for a given partition. 2053b76a
finatra-http: Added HttpServerTrait
which allows for a simple way to serve a
Finagle Service[Request, Response]
on an external interface without the need to
configure the Finatra HttpRouter
. a4fe06c5
finatra-http: Added support to serve c.t.io.Reader
as a streaming request.
4491e5e5
finatra-kafka-streams: Improve querying of windowed stores. ea65ef40
inject-utils: Mark c.t.inject.utils.StringUtils#snakify,camelify,pascalify
as
deprecated as their implementations have moved to util/util-core c.t.conversions.StringOps
.
Encourage users to switch usages to c.t.conversions.StringOps#toSnakeCase,toCamelCase,toPascalCase
.
85b9361c
finatra-thrift: Changed c.t.finatra.thrift.ThriftServerTrait#service
to #thriftService
to
not collide with the serving of a Finagle service from the HttpServer
when a server extends
both HttpServer
and ThriftServer
. a4fe06c5