by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 28 22:31

    finaglehelper on develop

    util|scrooge|finagle|twitter-se… (compare)

  • May 28 00:41

    finaglehelper on develop

    finatra: Update testing docs P… (compare)

  • May 28 00:11

    enbnt on gh-pages

    site push by ibennett (compare)

  • May 27 22:22

    finaglehelper on finatra-20.5.0

    (compare)

  • May 27 18:20

    finaglehelper on develop

    finatra: Fix Finatra examples J… (compare)

  • May 27 04:26
    cacoco commented #524
  • May 27 04:01

    cacoco on master

    (compare)

  • May 27 04:00

    cacoco on master

    (compare)

  • May 23 02:24

    finaglehelper on develop

    [inject-server] adding httpPost… (compare)

  • May 21 14:09
    cacoco closed #540
  • May 21 14:09
    cacoco commented #540
  • May 21 08:15
    kimxogus edited #540
  • May 21 08:14
    kimxogus opened #540
  • May 21 04:21

    finaglehelper on develop

    inject-slf4j: Remove Jackson de… (compare)

  • May 19 01:27

    finaglehelper on develop

    Twitter-oss: Prepare OSS librar… Twitter-oss: update OSS librari… (compare)

  • May 18 22:23

    finaglehelper on develop

    inject-mdc: Move MDC integratio… finatra: Fix links to examples … (compare)

  • May 15 00:21

    finaglehelper on develop

    util-security: Move Credentials… finatra-http: Update HttpRespon… (compare)

  • May 14 21:37

    finaglehelper on develop

    inject-core: Make flag methods … (compare)

  • May 14 21:06
    yufangong commented #527
  • May 14 18:14

    cacoco on master

    Revert "Merge commit '8435309bd… (compare)

Hamdi Allam
@hamdiallam
that could work in the best case. however you'd also want some extra code in place for error handling
jdcohen220
@jdcohen220
@cacoco thanks!
Moses Nakamura
@mosesn
hey folks, I’m going to try to kick off the release in the next couple of days
Martinffx
@martinffx
Hi! I've got a question, what does this object look like MyModelObjectMessageBodyReader
Martinffx
@martinffx
I'm having trouble parsing nested requests that have @RouteParam or @QueryParam in them...
case class RequestOne(@RouteParam id: UUID, ...)
case class RequestTwo(@RouteParam id: UUID, ...)
case class SuperRequest(requestOne: RequestOne, requestTwo: RequestTwo)
I get this validation error:
Unable to inject field 'id' with Key[type=scala.Option<java.util.UUID>, annotation=[none]] into class class RequestOne
case class RequestOne(@RouteParam id: Option[UUID] = None, ...)
Christopher Coco
@cacoco
Use of those annotations requires the object mapper to be configured with the MessageInjectableValues as documented. You cannot use them automatically. From your error it looks like your mapper is not configured properly. This is done in the DefaultMesageBodyReader in Finatra/http
you’d need to call injector.instance[DefaultMessageBodyReader].parse[RequestOne](request)
Martinffx
@martinffx
thanks for the reply @cacoco , those annotations work when using the indv. requests i.e. post("/path") { rq: RequestOne => ???? }
but fail with that error when using the SuperRequest i.e. post("/path") { rq: SuperRequest => ???? }
Christopher Coco
@cacoco
Hi all — we’ll be doing our monthly release today. Should be out officially by Monday. Thanks!
Yufan Gong
@yufangong
Hi folks, I’m going to try to kick off the April release in the next two days. Thanks!
jdcohen220
@jdcohen220
Hi, is it possible to return a file attachment in a response using an OutputStream instead of a File object?
Christopher Coco
@cacoco
@jdcohen220 sure, set the correct response type for the content bytes of the response
i believe by we set “application/octet-stream” by default if a returned response has a body by doesn’t specify a content type
jdcohen220
@jdcohen220
@cacoco perfect, thanks so much!
aakashsabharwal
@aakashsabharwal
Hi friends.
Can anyone point me to the recommended way of adding shutdown hooks in finatra?
Christopher Coco
@cacoco
@aakashsabharwal have you taken a look at the documentation? The User Guide (https://twitter.github.io/finatra/user-guide/) goes into great detail about the application lifecycle (https://twitter.github.io/finatra/user-guide/getting-started/lifecycle.html) and how to close/shutdown resources.
Ian Bennett
@enbnt
Hi all, just a heads up that I'm starting the May release process. We're testing out a new release system and may have some bumps along the way.
Martinffx
@martinffx
How do you maintain your CORS headers in an exception mapper response?
.filter(new Cors.HttpFilter(CorsController.policy))
.exceptionMapper[ThrowableExceptionMapper]
the ResponseBuilder in the ExceptionMapper does not have the headers set by the filter higher up the stack?
How would you go about maintaining the headers?
Christopher Coco
@cacoco
@martinffx I’m not sure I understand the question. For exception mapping to work, you need to have the ExceptionMappingFilter installed, https://twitter.github.io/finatra/user-guide/http/exceptions.html#exceptionmappingfilter
But I’m not sure what is meant by maintaining the "CORS headers in an exception mapper response”.
Can you explain?
Martinffx
@martinffx
Hi @cacoco , it seems to be the order of the filters. We have the CORS filter after the CommonFilters when the ExceptionMapper runs the response generated does not run through the CORSFilter, moving the CORSFilter to before the CommonFilters resolves this.
I see the CommonFilters includes the ExceptionMappingFilter which catches the exception, this means that all filters after it are not run after the exception has been thrown and the ExceptionMappingFilter handles the exception.
"CORS headers in an exception mapper response”
sorry that is better explained as the CORSFilter not being applied to responses generated by the exception mapper.
Christopher Coco
@cacoco
Right, the CORSFilter should likely be defined as the top-most filter typically
I have also see it installed with beforeRouting = true (https://twitter.github.io/finatra/user-guide/http/filters.html#global-filters) which necessarily makes it apply on the “outside” of all the other filters.
Christopher Coco
@cacoco
But yes, I think you want the CORSFilter “above” the ExceptionMappingFilter. Also you can always specify the filters in CommonFilters yourself manually, or even create your own “common filters” using the MergeFilter as I think you likely want the CORSFilter in between the HttpRresponseFilter and the ExceptionMappingFilter, technically.
Or maybe in between the AccessLoggingFilter and the HttpResponseFilter, hmm.
Martinffx
@martinffx
Okay, thanks for the help!