[akka-user] Akka Http 10.1.0 Released

2018-03-08 Thread 'Johannes Rudolph' via Akka User List
Dear hakkers, we are happy to announce Akka Http 10.1.0, the first release of the 10.1.x series. See the announcement at https://akka.io/blog/news/2018/03/08/akka-http-10.1.0-released. The most important changes are: - The new client pool implementation introduced in 10.0.11 is now

[akka-user] Akka HTTP 10.1.0-R2 Released

2018-02-12 Thread 'Johannes Rudolph' via Akka User List
Dear hakkers, we are happy to announce Akka Http 10.1.0-RC2, the second release candidate for the upcoming Akka HTTP 10.1.0 release. We focused on stabilizing the new client connection pool. Over the last month our test suite caught lots of edge cases that were fixed for this release. Also,

[akka-user] Re: [Akka-Streams] Want to always receive latest element in Sink

2018-01-25 Thread 'Johannes Rudolph' via Akka User List
Hi, in akka-stream, processing is usually run in a fused fashion, i.e. without further configuration one stream will run in a single actor so all operations are run sequentially. In such a synchronous scenario, there's little room for elements to ever get dropped because the actorRef stage

[akka-user] sbt-revolver 0.9.0 released with sbt 1.0.0 support

2017-08-15 Thread 'Johannes Rudolph' via Akka User List
Dear fast application restarters, we just released sbt-revolver 0.9.0 which is the first version of sbt-revolver cross-built for sbt 0.13.x and 1.0.x. Thanks go to Olli Helenius / @liff who contributed the sbt 1.0 compatibility changes (#62). We also merged a long-standing PR that allows to

[akka-user] Re: Akka websocket server-push model (server sends messages to client)

2017-04-24 Thread 'Johannes Rudolph' via Akka User List
Thanks Julian for sharing the example. Indeed, using the BroadcastHub is the recommended way to implement something like this. On Saturday, April 22, 2017 at 1:09:19 AM UTC+2, Julian Howarth wrote: > > I may have misunderstood what you want to achieve, but you don't have to > use actors if

[akka-user] Re: Chunked response with akka-http 10.x

2017-04-20 Thread 'Johannes Rudolph' via Akka User List
Hi Thibault, if you have the body of the response already as a Source, you can create a response with a chunked entity from it like this: HttpResponse.create() .withEntity(HttpEntities.create(contentType, source)) Johannes On Thursday, April 20, 2017 at 9:56:47 AM UTC+2,

[akka-user] Re: Status 500 for Play Assets after upgrading to Akka 2.5.0

2017-04-19 Thread 'Johannes Rudolph' via Akka User List
Hi Gavin, the current version of Play is not compatible with Akka 2.5.0. This has already been fixed for the upcoming Play 2.6 series. I created a ticket to investigate if the compatibility fix should be backported to Play 2.5.x as well:

[akka-user] Re: Analogy between reactive streams and electrical currents

2017-04-18 Thread 'Johannes Rudolph' via Akka User List
I think that's a valid analogy. A while ago we were investigating similar things and also arrived at that analogy. In practice, it turns out that fused streams, i.e. multiple stream components that run in one actor will skew measurements. Not sure how much sense these analogies make when going

Re: [akka-user] Re: Has akka-http has abandoned per request actors in favor an anti-pattern DSL?

2017-04-18 Thread 'Johannes Rudolph' via Akka User List
I think there are a few things that should be treated separately: * How to organize bigger route structures? * How to implement some parts of the route structure as actors? As Roland wrote before, a Route is just an alias for a function `RequestContext => Future[RouteResult]`. This gives you

Re: [akka-user] Re: enable hostname / domain name on Akka Http for SSL

2017-04-18 Thread 'Johannes Rudolph' via Akka User List
Hi, that sounds as if you haven't configured Akka HTTP to open an HTTPS server. It's hard to say though, as you didn't post any code ;) What code did you use to configure Akka HTTP to use HTTPS? Johannes On Tuesday, April 18, 2017 at 2:40:08 PM UTC+2, Abdeali Chandanwala wrote: > > Hi

[akka-user] Re: Akka HTTP path matching fundamentally broken? Surely not?

2017-03-20 Thread 'Johannes Rudolph' via Akka User List
Hi Alan, On Friday, March 17, 2017 at 12:25:09 PM UTC+1, Alan Burlison wrote: > > pathPrefix("root") { >concat( > pathPrefix("service1") { service1.route }, > pathPrefix("service2") { service2.route } >) > } > > That works fine with a path of say "/root/service1", but

[akka-user] Re: AKKA HTTP: Is this a valid use of Route.seal?

2017-03-15 Thread 'Johannes Rudolph' via Akka User List
Hi Alan, yes, that's a valid use case. The route tree is usually traversed completely until a Route matches. But if you know that the search can be cut short, then `seal` is definitely a good solution. Another solution would be to use only `handleRejections` which would have the advantage that

[akka-user] Re: akka-http client future+flatMap or flow+asyncMap?

2017-03-14 Thread 'Johannes Rudolph' via Akka User List
Hi Brice, we previously recommended the stream variant (`Source.single(request).mapAsync(1))`) but it turned out that this is not a good idea as materialization has some cost and the API is more complex than using `Http.singleRequest()` directly. So, using `Http.singleRequest()` is the right

[akka-user] Re: illegal-rawheaders

2017-02-27 Thread 'Johannes Rudolph' via Akka User List
Hi Dimitry, that message is a different one. It means that your code is issuing requests with an explicit header `RawHeader("User-Agent", ...)` somewhere. Johannes On Thursday, February 23, 2017 at 8:10:03 PM UTC+1, dmitriy...@alisagaming.com wrote: > > Hi everyone. > > I've been using akka

[akka-user] Re: Detail: akka.stream.StreamTcpException: Connection failed.

2017-02-27 Thread 'Johannes Rudolph' via Akka User List
Hello, the error is thrown here: https://github.com/akka/akka/blob/master/akka-stream/src/main/scala/akka/stream/impl/io/TcpStages.scala#L303. I agree it's hard to see why that error would happen. One thing that could have happened is that a connection attempt was very slow and so the

[akka-user] Re: XMPP chat server vs Akka TCP

2017-02-23 Thread 'Johannes Rudolph' via Akka User List
Hi, XMPP is an application-level protocol while TCP is a transport-level protocol. In fact, XMPP usually runs *on top of* TCP. So, yes, you can use Akka TCP to implement XMPP. Comparing XMPP to what you probably have right now is that in your current application you used your own custom

[akka-user] Re: Stream file to disk without holding memory

2017-02-08 Thread 'Johannes Rudolph' via Akka User List
Hi David, the 503 is generated by the timeout logic, see the `akka.http.server.request-timeout` setting. See the timeout directives for ways to change it based on the request: http://doc.akka.io/docs/akka-http/10.0.3/scala/http/routing-dsl/directives/timeout-directives/index.html Regarding

Re: [akka-user] java.lang.VerifyError after shading with sbt-assembly

2017-02-08 Thread 'Johannes Rudolph' via Akka User List
Yes, this seems to be a bug in sbt-assembly which gets triggered if you use shading. See https://github.com/sbt/sbt-assembly/issues/205 > > -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html

[akka-user] Re: Memory Leak : akka.actor.RepointableActorRef

2017-02-03 Thread 'Johannes Rudolph' via Akka User List
Hi Eric, we'd like to look into that. It looks as if a streams materializer is holding on to some memory but we need more info to see what it keeps exactly to. Is this a reproducible scenario? Could you share the memory dump (in private) with us? Otherwise, could you send the list of top

Re: [akka-user] How to call a Future-based test from a Route?

2017-01-02 Thread 'Johannes Rudolph' via Akka User List
On Monday, January 2, 2017 at 1:42:27 PM UTC+1, Alan Burlison wrote: > > One question: > > headerValueByName("X-Auth-Key")).flatMap { (user, pass) => > // <- user flatMap for custom directives > > doesn't compile as the resulting value of type Directive[(String, > String)] doesn't have a

Re: [akka-user] How to call a Future-based test from a Route?

2017-01-02 Thread 'Johannes Rudolph' via Akka User List
Hi Alan, here are a few steps to get there: * provide all your different authentication directives as values of type `Directive1[T]` with T being the type of the principal found after successful authentication. * To build those, use either one of the existing authentication directives

[akka-user] Re: Latency in using Akka HTTP Client

2017-01-02 Thread 'Johannes Rudolph' via Akka User List
Hi Gaurav, two small remarks: * Try using `Http().singleRequest` instead of `Souce.single().via(poolClientFlow).run`. Materialization (= `run` / `runWith`) has a certain cost that can be avoided using `Http().singleRequest`. * Using `(1 to 1000).par.foreach` to run the benchmark may lead to

[akka-user] Akka Http 10.0.1 released

2016-12-23 Thread 'Johannes Rudolph' via Akka User List
Dear hakkers, We are proud to announce Akka Http 10.0.1, which is the first maintenance release of the Akka Http 10.0 series, and also our small holiday present to you. Some notable improvements and bug fixes are: Lots of documentation improvements thanks to our awesome contributors. Improved

[akka-user] Re: [akka-http] String cannot be cast to Message

2016-09-22 Thread 'Johannes Rudolph' via Akka User List
Hi Ronny, I agree that error message is little helpful. Maybe you are sending plain Strings to the actor created by Source.actorRef? (Still we might want to improve the error message in that case.) Johannes On Monday, September 19, 2016 at 12:08:52 AM UTC+2, Ronny Bräunlich wrote: > > Hi

[akka-user] Re: Trigger some logic at the moment of TCP connection established

2016-09-20 Thread 'Johannes Rudolph' via Akka User List
Hi Yaroslav, you may want to create a custom GraphStage in that case that waits for the first data to arrive and then prepend the extra-data. Afterwards you can change the state of the GraphStage to forward messages 1-to-1. Johannes On Tuesday, September 20, 2016 at 4:00:23 PM UTC+2, Yaroslav

[akka-user] Re: [Akka-Streams] Creating a custom async filter

2016-09-20 Thread 'Johannes Rudolph' via Akka User List
Hi Simon, you could also try to split up the asynchronous computation and the actual filtering like this: def filterFunc(e: E): Future[Result] xyz.mapAsync(n)(e => filterFunc(e).map(res => e -> res)) .via(statefulFilterGraphStage) And then implement the `statefulFilterGraphStage` with

[akka-user] Re: Trigger some logic at the moment of TCP connection established

2016-09-20 Thread 'Johannes Rudolph' via Akka User List
Hi Yaroslav, no worries, this is a good question. It depends a bit on what kind of logic you want to trigger. If you just want to do something, you can use `mapMaterializedValue` to do something with the `OutgoingConnection` object before materialization is complete. If you want to prepend

[akka-user] Re: [Akka-Streams] Using Framing.delimiter where ByteString stream is part of a Tuple

2016-09-20 Thread 'Johannes Rudolph' via Akka User List
Hi Paul, a combinator to achieve something like this has been proposed several times but I think there hasn't been consensus how to implement it exactly. The latest approach is discussed here: https://github.com/akka/akka-stream-contrib/issues/50 Johannes On Thursday, September 15, 2016 at

[akka-user] Re: Is back pressure triggered upon exceptions

2016-09-20 Thread 'Johannes Rudolph' via Akka User List
Hi Kunai, On Thursday, September 15, 2016 at 7:49:18 AM UTC+2, Kunal Deshpande wrote: > > Few questions on back pressure > 1. While using Flows in akka-streams using .via will a downstream flow > apply back pressure to a flow upstream or is back pressure only signaled to > a Source? >

[akka-user] Re: Debugging marshalling implicits

2016-09-20 Thread 'Johannes Rudolph' via Akka User List
Hi, On Tuesday, September 13, 2016 at 4:26:55 PM UTC+2, rrodseth wrote: > Is this the right way to debug the missing conversion? > val prm = implicitly[Future[PimpedResult[(StatusCode, Result[StatusDTO])]] => ToResponseMarshallable] Try

Re: [akka-user] Re: Memory leak with akka-streams 2.0.1?

2016-01-11 Thread 'Johannes Rudolph' via Akka User List
Hi, after having a quick look into it (the fully working reproducer was a great help btw), it turned out that this is indeed a regression introduced shortly before the release. It is tracked here: https://github.com/akka/akka/issues/19398 Johannes On Fri, Jan 8, 2016 at 7:35 PM, Andrey

Re: [akka-user] [akka-stream-experimental-1.0] How to reuse akka.stream.scaladsl.Tcp connections?

2015-08-26 Thread 'Johannes Rudolph' via Akka User List
On Wed, Aug 26, 2015 at 2:02 AM, Simon Schäfer m...@antoras.de wrote: The only thing I didn't understand was this part: Source.actorRef(1, OverflowStrategy.fail) When I replace the 1 with a 0 (which is allowed according to the documentation) I get this error message: Dropping element

Re: [akka-user] Re: akka streams 1.0 and http routing - in java

2015-08-26 Thread 'Johannes Rudolph' via Akka User List
Hi paweł, yes, that's an unfortunate detail of the Java API. Whatever you put in there as the Object value it will be ignored. So, to convert your flow you should be able to use `.ObjectmapMaterializedValue(m - m)` to convert the type. Johannes On Tue, Aug 25, 2015 at 11:19 PM, paweł kamiński

Re: [akka-user] Re: Specs2RouteTest equivalent for Akka HTTP

2015-08-18 Thread 'Johannes Rudolph' via Akka User List
Thanks Adam. On Tue, Aug 18, 2015 at 4:01 PM, Adam Shannon adam.shan...@banno.com wrote: FYI If you want to add a class to your application here's an example: https://gist.github.com/adamdecaf/f83c7000d1b69bc29c4d On Tue, Aug 18, 2015 at 2:29 AM, Johannes Rudolph

Re: [akka-user] Re: Can't find akka.http.javadsl.testkit.JUnitRouteTest?

2015-08-11 Thread 'Johannes Rudolph' via Akka User List
Hi John, how can we know? You need to share more of your code :) Johannes On Tue, Aug 11, 2015 at 11:01 AM, john.vie...@gmail.com wrote: I am using Akka http Test HttpRequest request = ... TestResponse response = appRoute.run(request); Unfortunatly TestResponse is null. I think its

Re: [akka-user] Re: Akka-http websockets connection fails 95% of the time

2015-07-29 Thread 'Johannes Rudolph' via Akka User List
Hi Luc, in the new dump there are again these two connections: port 59385 - 57649 and port 59386 - 8080 It looks as if you are running some kind of transparent proxy (a desktop firewall sofware?) that redirects all the traffic through a middleman. So, if you look at the connection from 59385

Re: [akka-user] Re: Akka-http websockets connection fails 95% of the time

2015-07-27 Thread 'Johannes Rudolph' via Akka User List
Hi Luc, in that case, can you provide a more information about the kind of system you are running on? And it would be nice if we had a tcpdump/wireshark dump that shows what's going on, so we can see at least at which side things start to go wrong? Johannes On Mon, Jul 27, 2015 at 5:19 PM, Luc

Re: [akka-user] Re: Akka-http websockets connection fails 95% of the time

2015-07-27 Thread 'Johannes Rudolph' via Akka User List
Hi Luc, I can see the log messages you are seeing: [DEBUG] [07/27/2015 12:01:01.059] [api-akka.actor.default-dispatcher-9] [akka://api/user/$a/flow-47-3-publisherSource-prefixAndTail] Cancelling akka.stream.impl.MultiStreamOutputProcessor$SubstreamOutput@eda0238 (after: 5000 ms) but I don't see

Re: [akka-user] Re: Server attacked. What could have been done?

2015-07-20 Thread 'Johannes Rudolph' via Akka User List
On Mon, Jul 20, 2015 at 3:59 PM, Nicolau Werneck nwern...@gmail.com wrote: It is unfortunate that I missed my error logs, but I'm glad you guys are taking a look at this! I confirmed that removing the Host header with curl just gives a 400, so it can't but just this. I was using 1.0-RC4, so

Re: [akka-user] Re: Server attacked. What could have been done?

2015-07-20 Thread 'Johannes Rudolph' via Akka User List
Hi Adam, On Mon, Jul 20, 2015 at 3:25 PM, Adam Shannon adam.shan...@banno.com wrote: All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field. Is from RFC 2616 I can confirm (the gist above) that

Re: [akka-user] Re: Server attacked. What could have been done?

2015-07-20 Thread 'Johannes Rudolph' via Akka User List
? I upgraded from M2 to 1.0 this weekend and I never saw the server dying from these requests. On Mon, Jul 20, 2015 at 9:26 AM, 'Johannes Rudolph' via Akka User List akka-user@googlegroups.com wrote: On Mon, Jul 20, 2015 at 3:59 PM, Nicolau Werneck nwern...@gmail.com wrote

Re: [akka-user] Re: Connecting over Https using Akka-Http client

2015-07-16 Thread 'Johannes Rudolph' via Akka User List
Hi Jeroen, On Thu, Jul 16, 2015 at 4:05 PM, Jeroen Rosenberg jeroen.rosenb...@gmail.com wrote: Anyways, it's working as expected. I do have one small unrelated issue. The stream I am consuming is in Gzip format, so I'm unzipping the ByteStrings as they come in as part of my FlowGraph. However,

Re: [akka-user] Re: Connecting over Https using Akka-Http client

2015-07-16 Thread 'Johannes Rudolph' via Akka User List
Hi Jeroen, On Thu, Jul 16, 2015 at 4:35 PM, Jeroen Rosenberg jeroen.rosenb...@gmail.com wrote: def gunzip(bytes: Array[Byte]) = { val output = new ByteArrayOutputStream() FileUtils.copyAll(new GZIPInputStream(new ByteArrayInputStream(bytes)), output)) output.toString } This creates a

Re: [akka-user] Re: Connecting over Https using Akka-Http client

2015-07-15 Thread 'Johannes Rudolph' via Akka User List
Hi Jeroen, it would be very helpful if you could somehow come up with a reproducer against some publicly accessible endpoint which would show the issue. It seemed to work for all the URLs I tested. Johannes On Wed, Jul 15, 2015 at 6:25 PM, Jeroen Rosenberg jeroen.rosenb...@gmail.com wrote: