spray-dsl

why do I get “The requested resource could not be found.” when accessing simple spray route?

女生的网名这么多〃 提交于 2020-01-03 13:33:44
问题 I tried a simple spray example app and i cannot access the route, I uploaded the example source code which does not work to github: spray-tomcat-example: git clone https://github.com/avidanyum/spray-tomcat-example mvn package cp cp target/spray-tomcat-example-0.1-SNAPSHOT.war ~/tmp/tomcat/apache-tomcat-7.0.61/webapps/spraytomcat.war cd ~/tmp/tomcat/apache-tomcat-7.0.61/bin ./catalina.sh jpda run http://localhost:8080/spraytomcat/ I get "The requested resource could not be found." I defined

Use a Dispatcher with Spray HttpService

纵饮孤独 提交于 2019-12-11 12:32:37
问题 My application has an API using SprayCan. In the application, any blocking code has a separate dispatcher for each specific resource. Is it necessary to protect the API service from being blocked by the application by configuring it with it's own Dispatcher too? Also is it common practice to use a Router for an API service to handle a larger capacity of requests? class MyService extends Actor with HttpService {...} val service = system.actorOf(MyService.props(...).withDispatcher(???)) 回答1: Is

How to structure a RESTful API with Spray.io?

妖精的绣舞 提交于 2019-12-09 15:39:44
问题 When I'm using Spray.io to develop a RESTful API, how should I structure my application? I already saw this answer on how to split a Spray application, but I'm not satisfied with it, since it doesn't seem to use the "one actor per request" approach. Can I forward requests from the root actor to other actors in my application based on paths and, inside these actors, define the related routes? Thanks 回答1: You can certainly forward requests from one actor to another, based on paths or whatever