Questions tagged [spray]

spray is an open-source toolkit for building REST/HTTP-based integration layers on top of Scala and Akka.

spray is an open-source toolkit for building REST/HTTP-based integration layers on top of Scala and Akka. It sports the following main features:

  • Completely asynchronous, non-blocking, actor-based request processing for efficiently handling very high numbers of concurrent connections

  • Powerful, flexible and extensible internal Scala DSL for declaratively defining your web service behavior

  • Immutable model of the HTTP protocol, decoupled from the underlying web server / servlet container

  • Full testability of your REST services, without the need to fire up containers or actors

Documentation for spray is available at the spray website.

The spray user group has active discussions on using this software.

957 questions
63
votes
2 answers

What are the differences between Scala middleware choices?

Note: Unfortunately this question was closed, but I'm trying to maintain it for if someone else comes along with the same question. I've been looking for a good solution to developing a service in Scala that will sit between mobile devices and…
Jack
  • 15,582
  • 17
  • 86
  • 162
43
votes
4 answers

Why is the error Conflicting cross-version suffixes?

I'm getting this error when I try to compile a Scala project in sbt. Modules were resolved with conflicting cross-version suffixes in {file:/home/seven3n/caja/Flujo_de_caja/}flujo_de_caja: [error] com.typesafe.akka:akka-actor _2.11, _2.10 [error]…
Rodrigo Cifuentes Gómez
  • 1,244
  • 2
  • 13
  • 27
39
votes
5 answers

Spray, Akka-http and Play, Which is the best bet for a new HTTP/REST project

I'm going to develop new HTTP/REST services using Scala and Akka Actors. I have experience working with Play, but I don't really need a complete web Framework. From what I read, I think Spray is a suitable choice. My question come from the future…
Fede
  • 701
  • 1
  • 7
  • 16
34
votes
1 answer

How to fix the Dropping Close since the SSL connection is already closing error in spray

I’m making a call to an API, but most of the time I keep getting an error: “Dropping Close since the SSL connection is already closing” and “Premature connection close (the server doesn't appear to support request pipelining).” Like 90% of the time…
mayacr86
  • 949
  • 8
  • 23
25
votes
3 answers

no configuration setting found for key akka

I am using scala, spray and akka for one of my projects. In Intellij, it is working fine. When I build the project and tried to run it in command line, I get the following error. Caused by: com.typesafe.config.ConfigException$Missing: No…
Rahul Dev
  • 327
  • 1
  • 4
  • 11
23
votes
3 answers

How to deploy my spray API into production?

I'm thinking about how should be the process to deploy my already locally tested rest api to the cloud, lets say an infrastructure as a service (not a platform as a service such as Heroku) like amazon. I have my local envorinment set up with sbt up…
juanpavergara
  • 1,441
  • 1
  • 11
  • 21
22
votes
2 answers

Actor-based webservice - How to do it properly?

In the past few months, me and my colleagues have successfully built a server-side system for dispatching push notifications to iPhone devices. Basically, a user registers for these notifications via a RESTful webservice (Spray-Server, recently…
cthulhu
  • 3,075
  • 2
  • 20
  • 31
22
votes
2 answers

Unsupported version error using JTDS with Scala

I'm trying to use the Java JTDS driver to connect to my database in Scala . However, whenever I try to use it I get an error that the version(of java?) is wrong. java.lang.UnsupportedClassVersionError: net/sourceforge/jtds/jdbcx/JtdsDataSource :…
stan
  • 4,752
  • 4
  • 43
  • 68
21
votes
3 answers

Write a simple json REST server using spray in scala

I want to implement a simple json REST server using spray in scala that supports the following routes: GET /foo => return a list of case class objects in json format POST /bar => read a json into a case class object and perform some computation My…
jonderry
  • 21,385
  • 29
  • 93
  • 160
20
votes
7 answers

How can I fix the missing implicit value for parameter ta: TildeArrow in a test spec

I'm working on a simple test spec using spray and I can't get it to compile correctly, don't know if I'm doing anything wrong. My version of scala is 2.9.3 and spray 1.0.1 (Updating either of them is not a suitable option). Here's my test spec's…
marcelaconejo
  • 219
  • 2
  • 6
19
votes
2 answers

how to serialize case classes with traits with jsonspray

I understand that if I have: case class Person(name: String) I can use object PersonJsonImplicits extends DefaultJsonProtocol { implicit val impPerson = jsonFormat1(Person) } and thus serialize it with: import…
Jas
  • 12,534
  • 20
  • 79
  • 134
18
votes
1 answer

What is the best way to perform OAuth2 authentication using akka-http?

Akka HTTP and Spray provide an authenticateOAuth2 directive, but their documentation states that This directive does not implement the complete OAuth2 protocol, but instead enables implementing it, by extracting the needed token from the HTTP…
Dan Li
  • 819
  • 1
  • 6
  • 15
18
votes
3 answers

Can Spray.io routes be split into multiple "Controllers"?

I haven't found a solid example or structure to splitting up Spray.io routes into multiple files. I am finding that the current structure of my routes are going to become very cumbersome, and it would be nice to abstract them into different…
crockpotveggies
  • 11,654
  • 11
  • 65
  • 127
16
votes
2 answers

Query parameters for GET requests using Akka HTTP (formally known as Spray)

One of the features of Akka HTTP (formally known as Spray) is its ability to automagically marshal and unmarshal data back and forth from json into case classes, etc. I've had success at getting this to work well. At the moment, I am trying to make…
Douglas
  • 2,186
  • 2
  • 19
  • 25
16
votes
3 answers

How to get incoming IP address in Spray framework

I am looking at headers that are coming in, but no IP seems to be there: HttpRequest(GET,http://127.0.0.1:8080/track/check,List(Accept-Language: uk-UA, uk, ru, en-US, en, Encoding: gzip, deflate, sdch, User-Agent: Mozilla/5.0 (Windows NT 6.1;…
Alex K
  • 854
  • 9
  • 16
1
2 3
63 64