Closed jlawrienyt closed 5 years ago
@jlawrienyt it is not necessarily true that the HttpWarmup
implies this (being able to call user-defined admin routes) should work because it has logic for sending requests to admin server, right? Since there are non-user defined admin routes (from the TwitterServer HTTP Admin interface) that you may be trying to hit.
In any case, yes, it is not as simple as moving the addition of routes from the postWarmup
phase as it is done there for a reason but we can look to see what we can do to address this.
@jlawrienyt this has been addressed in 0cd3ed691d4d86b5500dfddb858e0f25f9dc5058. Please take a look and hopefully it makes sense now.
You should be able to route to your user-defined admin endpoints with the HttpWarmup
utility by simply doing warmup.send(request, admin = true)()
. Note that trying to hit any thing not defined on the HttpRouter
explicitly does not work as the HttpWarmup
only routes to endpoints defined on a configured HttpRouter
and does not expose any way to route to the TwitterServer HTTP Admin interface during warmup. That will take exposing the TwitterServer AdminHttpServer HttpMuxer
which there is not appetite for at the moment.
Thanks!
Great, thanks @cacoco!
finatra-http: User defined admin routes not available during server warmup
Expected behavior
When performing warmup action on an http server, I should be able to exercise user-defined admin routes. In particular, the
HttpWarmup
class implies this should work since it has logic for sending requests to the admin server when admin routes are detected, or by setting theforceRouteToAdminHttpMuxers
parameter to true on thesend
method.Actual behavior
Any requests to user-defined admin routes during warmup result in 404 Not Found responses. This appears to be because user-defined admin routes aren't added until the
postWarmup
phase. It seems straightforward enough to move that call into thepostInjectorStartup
but perhaps there are other ramifications for that?Steps to reproduce the behavior
See the attached sample project. Run either
sbt run
orsbt testOnly example.NoAdminWarmupServerFailingFeatureTest
to see it fail.no-admin-warmup.zip