Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Arnout Engelen
    @raboof
    (ah I see you found akka/akka :smile: )
    vito-c
    @vito-c
    hi @raboof yah I'm working on a scala based ensime plugin (mostly for fun) :) I'm looking at that SprayJsonSupport for Message now ... do you have an example of a Marshaller for another internal?
    Arnout Engelen
    @raboof
    @vito-c not really... not sure I understand exactly what you need but something like implicit def sprayJsonToWsMessageMarshaller[T](implicit writer: RootJsonWriter[T], printer: JsonPrinter = CompactPrinter): Marshaller[T, Message] = Marshaller.strict(t => Marshalling.Opaque(() => TextMessage(writer.write(t)))) might work?
    JoeCordingley
    @JoeCordingley
    Hi. The spray testkit doesn't seem to work with contentType. I have an example here: https://github.com/JoeCordingley/spray-marshallersExample where if you hit localhost:8080 with either application/json or application/myJson in the running service it returns the correct contentType but testing the route using spray testkit it always returns application/json
    Konrad `ktoso` Malawski
    @ktoso
    spray is end of life since many years; please move on to akka-http
    Jason Goodwin
    @jasongoodwin

    Hey I know spray is EOL'd but I'm wondering if there would be any concerns w/ setting a request timeout at a per-request level

           httpExtension ! connect
    
           def receive = {
              case akka.io.Tcp.Connected(_, _) =>
                // The client should then respond with Connected.
                // We take the sender of that Connected response (which is an HttpClientConnection)
                val httpClientConnection = sender()
    
                sender() ! SetRequestTimeout(timeout.duration)
                sender() ! request
    
              case res: HttpResponse =>
                // HttpResponse is the expected response from sending the HttpRequest.
                promise.success(res)
                context.stop(self)
    
              // handle errors

    I feel like this may not work

    because the HttpClientConnection may receive another request in between
    Or that will just ignore pooling and always create additional connections?
    I guess my question is really: how do I set a request timeout per request
    That's what I came up with ^
    Jason Goodwin
    @jasongoodwin
    Right I see
    there are host connectors that are created by host, port and config.
    Above is the connection configuration
    Jason Goodwin
    @jasongoodwin
    (And there are two APIs - the host level, and connection level, the latter being lower level.)
    Thomas Vogel
    @thomas-vogel444

    Hi guys! I can't get the JsonFormats for recursive Types section of the README.md compiling. Literally copy pasting

    case class Foo(i: Int, foo: Foo)
    implicit val fooFormat: JsonFormat[Foo] = lazyFormat(jsonFormat(Foo, "i", "foo"))

    leads to

    [error] /Users/thomasvogel/sandbox/scala-sandbox/akka-http-sandbox/src/main/scala/tom/vogel/Example.scala:57:68: forward reference extends over definition of value fooFormat
    [error]     implicit val fooFormat: JsonFormat[Foo] = lazyFormat(jsonFormat(Foo, "i", "foo"))

    Any ideas?

    2 replies
    Andriy Plokhotnyuk
    @plokhotnyuk
    Vitalii Solomko
    @treefolk
    Hi,
    Does spay supports application/problem+json context Type?
    content*
    Vladimir Pavkin
    @vpavkin
    Hi all!
    Anyone here to help publishing spray-json 1.3.6? :)
    spray/spray-json#327
    Zhenhao Li
    @Zhen-hao
    hi, how can I get RootJsonFormat for scala collections, e.g. Vector[(String, Int)]?
    Zhenhao Li
    @Zhen-hao
    my use case is Unmarshal(response).to[Vector[(String, Int)]] in Akka HTTP where response has type HttpResponse
    Petr Osipov
    @pete-proton:matrix.org
    [m]

    hi all

    could someone clarify the future of spray json? spray has been replaced with akka http, but is spray json here to stay?

    Andriy Plokhotnyuk
    @plokhotnyuk
    @pete-proton:matrix.org akka-http has lot of integrations with spray and other JSON parsers for Scala. Please use the following projects for that: 1) akka-http-spray-json; 2) borer; 3) akka-http-json
    Petr Osipov
    @pete-proton:matrix.org
    [m]
    thank you, @plokhotnyuk for the quick response. we are indeed using akka-http-spray-json now. it might be just that it still has spray in the name which brings up the question if this library is going to be supported going forward. do you know what I mean?