You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There currently isn't any clean way to access HttpRouter tracked routes.
Context
I am trying to monitor (via our Graphite backend) unrouted requests.
The only way I found was to create a catch-all controller.
Now, I want to use ScalaCheck to check the following invariant: all unrouted routes trigger a counter increment. To that end, I need a programmatic access to the app registered routes (so that mapped routes [except the catch-all one] are not generated).
Expected behavior
I expect some public method exposing a read-only copy of the configured routes, such as:
defregisteredRoutes():Seq[Route]
Actual behavior
Currently, I see only three hacky ways to get that information:
create a utility class to extract those routes from HttpRouter in a package com.twitter.finatra
use reflection
subclass HttpRouter
Steps to reproduce the behavior
N/A
The text was updated successfully, but these errors were encountered:
@fbiville thanks for the issue. This is currently by design. Why? Because the routes are added to the HttpRouter at a specific point in the startup lifecycle of the server and exposing a method or methods to read them opens the potential for that method to used at the wrong point in the lifecycle potentially leading to undesirable issues.
We have kicked around the idea for programmatic access for a bit but have not decided on a way forward yet. Please stay tuned. Thanks.
There currently isn't any clean way to access HttpRouter tracked routes.
Context
I am trying to monitor (via our Graphite backend) unrouted requests.
The only way I found was to create a catch-all controller.
Now, I want to use ScalaCheck to check the following invariant: all unrouted routes trigger a counter increment. To that end, I need a programmatic access to the app registered routes (so that mapped routes [except the catch-all one] are not generated).
Expected behavior
I expect some public method exposing a read-only copy of the configured routes, such as:
Actual behavior
Currently, I see only three hacky ways to get that information:
HttpRouter
in a packagecom.twitter.finatra
HttpRouter
Steps to reproduce the behavior
N/A
The text was updated successfully, but these errors were encountered: