[Solved]Scala programm with non-understandable expression

Hi all,

I am working on some project, in which we are using ota-community-edition as base. In their implementation there are a lot place using following expression e.g.

(LogDirectives.logResponseMetrics(“device-registry”) & requestMetrics(metricRegistry) & versionHeaders(version)) {
prometheusMetricsRoutes ~
tracing.traceRequests { implicit serverRequestTracing =>
new DeviceRegistryRoutes(authNamespace, namespaceAuthorizer, messageBus).route
} ~ DbHealthResource(versionMap, healthMetrics = Seq(new BusListenerMetrics(metricRegistry))).route

I find nowhere the meaning of ~ in such expression. And in the file the “prometheusMetricsRoutes” is not defined. I am a newbie of scala, can someone explain me this expression a bit? below is the link to the file

Thanks a lot

It’s from Akka; take a look at the Combinators section: The PathMatcher DSL • Akka HTTP

1 Like