Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HealthCheckRoutes Provider, so user can add it to their own server #320

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import pekko.management.scaladsl.{ HealthChecks, ManagementRouteProvider, Manage
import scala.util.{ Failure, Success, Try }

/**
* @since 1.1.0 Users can use [[HealthCheckRoutes]] extension to add the routes to their own server.
pjfanning marked this conversation as resolved.
Show resolved Hide resolved
* INTERNAL API
*
* We could make this public so users can add it to their own server, not sure
* for ManagementRouteProviders
*/
@InternalApi
private[pekko] class HealthCheckRoutes(system: ExtendedActorSystem) extends ManagementRouteProvider {
Expand All @@ -46,6 +49,9 @@ private[pekko] class HealthCheckRoutes(system: ExtendedActorSystem) extends Mana

override def routes(mrps: ManagementRouteProviderSettings): Route = routes()

/**
* @since 1.1.0
*/
def routes(): Route = {
concat(
path(PathMatchers.separateOnSlashes(settings.startupPath)) {
Expand All @@ -68,7 +74,6 @@ private[pekko] class HealthCheckRoutes(system: ExtendedActorSystem) extends Mana

/**
* @since 1.1.0
* Providing an extension, so users can get the routes and add it to their own server
shakeeb-upstart marked this conversation as resolved.
Show resolved Hide resolved
*/
object HealthCheckRoutes extends ExtensionId[HealthCheckRoutes] with ExtensionIdProvider {
override def get(system: ActorSystem): HealthCheckRoutes = super.get(system)
Expand Down
Loading