Questions tagged [spray-routing]

36 questions
1
vote
1 answer

Use a Dispatcher with Spray HttpService

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…
user2827214
  • 1,191
  • 1
  • 13
  • 32
1
vote
0 answers

Content negotiation for spray in error handlers

I am trying to use content negotiation in a spray-based application. The following test describes my expected behaviour. Unfortunately, this is not what I see (Put to github for size): https://gist.github.com/Norwae/49c26613f91c32482bb1 Essentially,…
Norwæ
  • 1,575
  • 8
  • 18
1
vote
1 answer

Spray routing works for single slash but nothing else

So i have asked about this before and have changed a lot of code around. Spray Routing Doesn't match anything Now I am executing my functions that return HTTPresponses insided detach() blocks so that i dont block. These then are completed and…
1
vote
0 answers

Request was not handled with spray-testkit

My service route: get( path("add" / IntNumber / IntNumber)( (a, b) => complete((a + b).toString()) ) ) ~ post( path("add") ( formFields('a.as[Int], 'b.as[Int]) { (a, b) => complete((a + b).toString()) }) ) my spec: import…
python_kaa
  • 1,034
  • 13
  • 27
1
vote
1 answer

How can I safely process routing requests concurrently in spray.routing?

It seems that the example uses of the Spray HTTP server make it painfully easy to make the server process requests sequentially instead of concurrently. This is true because the examples show the routing object implemented as an actor that processes…
user48956
  • 14,850
  • 19
  • 93
  • 154
1
vote
2 answers

Read and understand the spray-routing DSL

I am new to spray. I have work with several strange (for me) programming languages like python, JQuery, etc... With them I could at least understand what some code segment do. Unfortunately with Spray, I can not read and understand even a simple…
0
votes
1 answer

Converting a Spray Deserializer to an Akka-Http Unarshaller

I have the following Deserializer from a Spray project that I'd like to port over to Akka-Http. I'm just starting out with Akka-Http so I'm not to sure how I can port this code: class urlParameterEnumDeserializer[T](enum: AppEnum[T]) extends…
ThaDon
  • 7,826
  • 9
  • 52
  • 84
0
votes
0 answers

akka spray -> akka http migration

this is fragment of my router in spray based service: path(baseUrl / version / "apps" / Segment / "users" / Segment) { (app, user) => respondWithMediaType(MediaTypes.`application/json`) { ctx => createProxy(ctx, management, GetUser(appId =…
HoTicE
  • 573
  • 2
  • 13
0
votes
1 answer

Spray Routing Cache dont cache 404

Hey guys im using the spray routing cache directive with routeCache method to cache my api calls. But the issue is that if you api is returning 500 for some reason then in that case also spray is caching that and keeps returning 500 until the cache…
Sidhant
  • 421
  • 1
  • 6
  • 17
0
votes
1 answer

Cannot understand routing in Akka HTTP

I have the following piece of code in Scala using Akka HTTP with Spray Routing import akka.http.scaladsl.server.Directives._ val geoip = path(RemainingPath) {remaining => val response = . . . complete(response) } But the I get the error…
Eric Kolotyluk
  • 1,958
  • 2
  • 21
  • 30
0
votes
0 answers

Spray.io support Typed Actors and UnTyped Actors?

Recently I came across a question where somebody asked => "Does Spray support Typed Actors or Untyped Actors ? " Can somebody help me in understanding that? Thanks in Advance
0
votes
1 answer

Parallel execution of methods

I have an application that sends multiple request to my spray-can 1.3.1 server. FireBug shows me, that these requests are triggered in parallel. However, on the server these request are handled strictly serially. I think I need to somehow configure…
Klaus Schulz
  • 527
  • 1
  • 5
  • 20
0
votes
0 answers

Not getting the proper base url using requestUri on server machine using spark-submit

My requirement is creating the rest json from the request uri using spray. I am using requestUri directive to get the base URL. When I run it through IDE or through spark-submit locally on my system, I got the proper output. But when I have done…
user1548787
  • 101
  • 1
  • 1
  • 8
0
votes
1 answer

Optimistic locking with hash function

The below code seems to complete without errors however lower down in the stack spray.can.server.HttpServerConnection wants 'If-Match' header to have a specific format. I feel that I'm missing maybe a rejection handler? Or do I have to turn off…
Adam Wayland
  • 354
  • 1
  • 2
  • 9
0
votes
1 answer

How Can I parse a request uri containing specific word

I am trying to handle a request containing word "filter". For the time being, I am using the url as http://localhost:9997/filter=.... and parsing by using pathPrefix(fiter) But url will change and becomes like…
user1548787
  • 101
  • 1
  • 1
  • 8