我正在创建 lagom 简单应用程序,使用休息客户端邮递员定义一个休息端点和命中终点。但作为回应,我得到了,未找到操作错误。我将 Akka 与 lagom 集成,以下是我的代码:
服务:
trait TwitterSchedulerService extends Service {
def doWork: ServiceCall[NotUsed, Done]
override def descriptor: Descriptor = {
import Service._
named("scheduler").withCalls(
call(doWork)
)
}
}
服务实现:
class TwitterSchedulerServiceImpl(system: ActorSystem) extends TwitterSchedulerService {
override def doWork = ServiceCall { _ =>
Future {
println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ")
Done
}
}
}
装载机配置:
class TwitterLoader extends LagomApplicationLoader {
override def load(context: LagomApplicationContext): LagomApplication =
new TwitterApplication(context) {
override def serviceLocator = NoServiceLocator
}
}
object TwitterSerializerRegistry extends JsonSerializerRegistry {
override val serializers = Vector(
JsonSerializer[String]
)
}
abstract class TwitterApplication(context: LagomApplicationContext) extends LagomApplication(context)
with CassandraPersistenceComponents with AhcWSComponents {
override lazy val lagomServer = LagomServer.forServices(
bindService[TwitterSchedulerService].to(wire[TwitterSchedulerServiceImpl])
)
override lazy val jsonSerializerRegistry = TwitterSerializerRegistry
}
我正在关注 lagom 文档http://www.lagomframework.com/documentation/1.3.x/scala/Akka.html。我想知道,为什么会出现这个错误,事件所有的休息点都定义了???