com.sbuslab.http.directives.SbusDirectives.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of akka-http-tools Show documentation
Show all versions of akka-http-tools Show documentation
Tools for akka-http (marshaling, error handling, websockets, sbus support)
package com.sbuslab.http.directives
import akka.http.scaladsl.server.{Directive1, Directives}
import com.sbuslab.http.Headers
import com.sbuslab.sbus.Context
trait SbusDirectives extends Directives {
def sbusContext: Directive1[Context] = {
optionalHeaderValueByName(Headers.CorrelationId).flatMap {
case Some(corrId) ⇒ provide(Context.withCorrelationId(corrId))
case _ ⇒ provide(Context.empty)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy