[akka-user] Re: [scala-user] Re: Akka Streams HTTP 1.0-RC1 Announcement

2015-04-27 Thread Johannes Rudolph
Hi Anton, On Sun, Apr 26, 2015 at 9:31 PM, Anton Kulaga antonkul...@gmail.com wrote: What about Websockets, as I understood they are supported in RC-1 but is there anything in documentation that explains how to use them in akka-http? Server-side websocket support is included in RC1 but not yet

[akka-user] Re: [scala-user] Re: Akka Streams HTTP 1.0-RC1 Announcement

2015-04-27 Thread Johannes Rudolph
...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Johannes --- Johannes Rudolph http://virtual-void.net -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional

[akka-user] Re: akka-http-testkit responseAs cannot unmarshal the body

2015-06-12 Thread Johannes Rudolph
On Thursday, June 11, 2015 at 12:04:28 PM UTC+2, yar@gmail.com wrote: So if the response has content type text/plain, why the heck does the testkit try to unmarshal it with an application/json unmarshaller and how to point it in the right direction? Good question. Do you use one of the

Re: [akka-user] Re: Too many scan calls when profiling my akka application

2015-06-12 Thread Johannes Rudolph
On Sunday, June 7, 2015 at 1:42:52 PM UTC+2, Akka Team wrote: The scan method of FJP will very likely be your top method unless you have very favorable load patterns for FJP. I wouldn't worry about it, unless you see a performance problem with your application. 4% is indeed not much for

[akka-user] Re: akka-http-RC3 can't set the content type

2015-06-12 Thread Johannes Rudolph
On Friday, June 12, 2015 at 12:30:16 AM UTC+2, ke...@aptoma.com wrote: I think ContentType is modeled directly on HttpEntity. Try a combination of the mapResponseEntity-directive and the .withContentType-method on HttpEntity. To expand on this: In spray/akka-http some headers are

Re: [akka-user] Re: akka-http 1.0 RC and SSL and Java

2015-08-13 Thread Johannes Rudolph
Hi Rob, here's some recent testing code that creates and uses certificates that are signed by a custom CA. It doesn't require fiddling with Java's `keytool`. The instructions should work similarly for proper certificates in which case you leave out the CA and Create server certificate steps

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

2015-08-18 Thread Johannes Rudolph
Hi, specs2 testing support hasn't been ported from spray yet. The basic issue is that akka modules weren't allowed to depend on Scala dependencies because of bootstrapping issues when releasing a new Scala version that includes Akka. I'm not completely sure if this is still the most recent

Re: [akka-user] Re: akka-http and selenium

2015-08-24 Thread Johannes Rudolph
Hi Rafał, On Monday, August 24, 2015 at 3:49:57 PM UTC+2, Rafał Krzewski wrote: Oh, I see. OneServerPerSuite / OneServerPerTest traits must be really handy. Providing similar helpers for testing akka-http would be hard, because Play is a framework that mandates a well defined entry point

Re: [akka-user] [akka-streams] Http source design question?

2015-08-20 Thread Johannes Rudolph
Hi john, AFAIU your question was not about existing code in akka-http but how to put a queue before a superpool, right? And no, putting a blocking queue inside of an Iterator is not likely the best solution because it will spend one thread permanently that is blocking in `queue.take` almost

[akka-user] Re: [akka-http-experimental-1.0] More Fine granular logging of accepted connections needed

2015-08-22 Thread Johannes Rudolph
Yes, the solution is not to log at DEBUG level. :) Johannes On Saturday, August 22, 2015 at 1:32:36 PM UTC+2, Simon Schäfer wrote: I use akka-http to build a webservice. This works great so far, I just don't like the noise of logging. The webservice not only answers to websockets requests

[akka-user] Re: Can PathMatcher match string as a path parameter?

2015-07-29 Thread Johannes Rudolph
Hi John, yes, this is called PathMachers.segment() (to be consistent with the Scala side). It may make sense to create an alias or have another look at the names in general to see if they can be made more consistent. Johannes On Wednesday, July 29, 2015 at 7:06:16 AM UTC+2, john@gmail.com

[akka-user] Re: How do I create an Unmarshaller / Marshaller in java?

2015-08-05 Thread Johannes Rudolph
Hi John, On Monday, July 27, 2015 at 11:00:57 AM UTC+2, john@gmail.com wrote: or am I supposed to use Marshallers.toEntity() but this seems quite a lot of work Yes, to create custom marshallers you would need to use one of the methods in `Marshallers`, to create custom unmarshallers

[akka-user] Re: Implicit value issue for FromRequestUnmarshaller in akka-http with spray-json

2015-07-24 Thread Johannes Rudolph
I agree, this is more confusing than necessary. I created https://github.com/akka/akka/issues/18064 to improve the situation. Johannes On Thursday, July 23, 2015 at 3:27:07 PM UTC+2, Kabir Idris wrote: Hi all, Im facing the same error in akka-http 1.0 On Monday, March 16, 2015 at

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

2015-07-24 Thread Johannes Rudolph
Hi Luc, I'd like to get to the bottom of this problem to make sure we find the problem if there's one in akka-http. Could you provide an executable reproduction? Johannes On Thursday, July 23, 2015 at 3:05:29 PM UTC+2, Luc Klaassen wrote: Hello all, I'm having trouble setting up a basic

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

2015-07-25 Thread Johannes Rudolph
Thanks Luc. I'll have a look next week. On Saturday, July 25, 2015 at 9:42:42 AM UTC+2, Luc Klaassen wrote: I've pushed the repository to github at https://github.com/Luckl/AkkaHttpWebsockets Luc Op vrijdag 24 juli 2015 10:07:53 UTC+2 schreef Johannes Rudolph: Hi Luc, I'd like to get

[akka-user] Re: SslTls example

2015-07-14 Thread Johannes Rudolph
Hi Mathias, there may not be any good examples yet. On the server side you need to supply an `HttpsContext` to the `Http.bind()` method with all the SSL settings. On the client side there are either HTTPS variants like `Http.newHostConnectionPoolTls` or if you use the highest-level API you

[akka-user] Re: akka streams - for comprehension counterpart

2015-07-14 Thread Johannes Rudolph
Hi Leslie, On Tuesday, July 14, 2015 at 1:38:02 PM UTC+2, leslie...@googlemail.com wrote: When programming with functions this kind of issue is solved quite elegantly by using a for comprehension: Not a solution but a comment. In a for comprehension with usual types

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

2015-07-20 Thread Johannes Rudolph
Hi, On Sunday, July 19, 2015 at 10:43:07 PM UTC+2, Adam Shannon wrote: I have some logs of this happening to me as well. I'm running on EC2 in us-east-1. I've got nginx and elb in front of these akka-http instances. Here's a few stack traces from the instances as well as nginx access logs.

[akka-user] Re: [akka-http] Splitting an incoming Source stream to two Sources

2015-07-13 Thread Johannes Rudolph
Hi Michael, leaving aside the API for a moment, the question is how the streams should behave. The actual live streams are not immutable but are running things that need to receive data from the original request and send this data out with another request. (I haven't completely understood in

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

2015-07-15 Thread Johannes Rudolph
Hi Jeroen, is this a virtual host you are connecting against? This may hint towards the client not sending the TLS SNI extension correctly which could be a bug in akka-http or due to an old JDK version on your client. Which JDK version do you use?

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

2015-08-25 Thread Johannes Rudolph
Hi Simon, I think there are two conceptual difficulties you need to tackle: The first is the problem which you describe with infinite / finite streams which is actually more one of the traditional (= actor based) push-style asynchronous programming versus the new [*] pull-style of

Re: [akka-user] Marshalling FormData to multi-part mime with one field per part

2015-10-15 Thread Johannes Rudolph
On Wednesday, October 14, 2015 at 7:17:14 PM UTC+2, Eric Swenson wrote: > > AWS/S3 doesn’t want the form data parts, nor the whole HTTP POST to be > chunked. So those entities have to be made “strict”. So I had to make each > MIME part be strict, as well as the final Multipart.FormData

Re: [akka-user] How do I attach multiple subscribers to a stream using fanoutPublisher, actorSubscriber and FlowGraph.partial?

2015-10-06 Thread Johannes Rudolph
ase pardon me if this is obvious > as I'm just learning. > > I'm using Source.single(httpRequest), not fanoutPub. The example you > pointed me to use fanout, which I intend to study but not apply in this > case. > > Regards, > Abhijit > > > On Monday, October 5,

Re: [akka-user] How do I attach multiple subscribers to a stream using fanoutPublisher, actorSubscriber and FlowGraph.partial?

2015-10-06 Thread Johannes Rudolph
Hi Abhijit, from a quick glance to your code it seems that you are broadcasting an HttpResponse and then access its `entity.dataBytes` in several branches. This is not supported. You need to put the broadcast behind the `entity.dataBytes` and not behind the stream of responses. We prepared a

[akka-user] Re: Akka-http 1.0-RC4 on android 5.0.1 : that rocks !

2015-07-10 Thread Johannes Rudolph
Hi Alain, On Friday, July 3, 2015 at 9:05:50 AM UTC+2, alain marcel wrote: Following code is a server realized with akka-http on android that serves files. For this to work, just call new ServerForDownloadFile() in an android AsyncTask. Thanks for sharing! Any reason you are using a

[akka-user] Re: How to download large file with Akka-http V1.0-RC4 ?

2015-07-10 Thread Johannes Rudolph
Hi Alain, On Thursday, July 2, 2015 at 10:39:27 AM UTC+2, alain marcel wrote: If I replace Play server with Akka-http server (see source bellow), then I can download large file (about 650Mb). That's probably because you use chunked transfer encoding in your Akka HTTP server for which the

[akka-user] Re: akka-http respond with result of an actor call (java-api)

2015-07-10 Thread Johannes Rudolph
Hi, in the Java API there are currently two ways to deal with Futures. You can use `RequestContext.completeWith` to transform a `FutureRouteResult` into a `RouteResult`. Or, if you use the reflective `handleWith` directive you can point it to a method that returns a `FutureRouteResult` instead

[akka-user] Re: akka-http-testkit route produces internal service error but live route works (?!?)

2015-07-12 Thread Johannes Rudolph
Hi Austin, On Saturday, July 11, 2015 at 11:22:44 AM UTC+2, Austin Guest wrote: (1) The test for the hello route fails because the actual response is an internal server error. (Despite the fact that this isn't true running the live code!) And I get the following error messages: That's

Re: [akka-user] Akka-http 1.0-RC4 ssl session info/cert info accessible?

2015-08-27 Thread Johannes Rudolph
Hi, this is now tracked as https://github.com/akka/akka/issues/18349. Johannes On Thursday, August 27, 2015 at 4:03:26 PM UTC+2, Mark van Buskirk wrote: Hi Dr. Kuhn, How is this issue progressing, is there a ticket I can watch for updates? It's hard to use ssl without being able to get the

[akka-user] Re: [akka-http] Custom Directives - Scala

2015-08-27 Thread Johannes Rudolph
Hi, use the combinators of the Directive class to make custom directives. E.g. extractClientIp.flatMap { ip = val cond = // something if (cond) pass else reject(...) } or if you want to return a value, i.e. create a Directive1[T], use `provide` instead of `pass`. HTH Johannes On Tuesday,

[akka-user] Re: Akka-Http handle Multipart formData

2015-09-18 Thread Johannes Rudolph
Hi, the approach that Konrad showed will work, however, the problem with the suggested approach is that it will load the complete file into memory which limits the number of concurrent uploading requests severely. Any multipart entity is a natural stream of parts so your original approach is a

Re: [akka-user] Fusing in akka-streams 2.0

2015-12-23 Thread Johannes Rudolph
On Tuesday, December 22, 2015 at 8:37:08 PM UTC+1, Adam Warski wrote: > > Having conflate only makes sense if there's some non-fused component out > there I guess, but you are correct of course that it can be fused with > things before/after it. > I thought a bit about this. Actually, it is

Re: [akka-user] Akka HTTP File Not Found Exception

2016-01-19 Thread Johannes Rudolph
I see several issues here: * Entity stream failures don't go through the routing layer exception handling code. It also wouldn't make any sense because we are already sending out the response here and we cannot change the response at that time any more. We should document that somewhere. *

[akka-user] Re: Dynamically add HTTP Routes

2016-02-01 Thread Johannes Rudolph
Hi Ubaldo, yes, that's certainly possible. A `Route` is just a regular Java object, so you can choose a new `Route` to do the processing for every new request. You just need to make sure that you switch out the Route in a thread-safe way. E.g. val routeHolder = new

[akka-user] Re: Dynamically add HTTP Routes

2016-02-01 Thread Johannes Rudolph
On Monday, February 1, 2016 at 11:28:58 AM UTC+1, Johannes Rudolph wrote: > > Http.bindAndHandle(currentRoute(), ...) > Actually, I just figured that this won't work, because currentRoute() will only be evaluated once. You will need a simple wrapper which is evaluated anew for ever

[akka-user] Re: HTTP header 'UpgradeToWebSocketResponseHeader: ' is not allowed in responses

2016-01-28 Thread Johannes Rudolph
Hi Shayan, this seems to be a bug. I filed it here: https://github.com/akka/akka/issues/19639 The functionality shouldn't have changed, though, so you can safely ignore this output. Johannes On Wednesday, January 27, 2016 at 9:19:46 AM UTC+1, sha...@gearzero.com wrote: > > Team, > > I am

[akka-user] Re: example of stand-alone HTTP server usage

2017-02-21 Thread johannes . rudolph
Hi, these internal tests basically use it: https://github.com/akka/akka-http/blob/master/akka-http-core/src/test/scala/akka/http/impl/engine/server/HttpServerSpec.scala See

[akka-user] Re: Problem detecting Websocket failure

2017-02-21 Thread johannes . rudolph
Hi, you are applying the `alsoTo` clause to the wrong side of the connection. You need to put it on the Sink-side. The way you have written it, the `alsoTo` clause waits for your `Source.actorRef` to close the connection. Try using singleWebSocketRequest(...,

[akka-user] Re: Struggling with custom Akka HTTP directive

2017-02-21 Thread johannes . rudolph
Hi Elliot, the reason is not the type parameter directly, but the `: ClassTag` context bound which introduces an implicit parameter list to your method. So, after unfolding this syntactic sugar your withActor method basically looks like this: def withActor[A <: Actor](message: Any)(implicit

[akka-user] Re: akka-http web-socket Frame support question...

2017-02-21 Thread johannes . rudolph
Hi, injecting frames manually is not supported. Not supported means that we don't offer an API that would allow users to do that. That said, there's an internal API that allows to specify a frame handler directly: * You can case the `UpgradeToWebsocket` header to

[akka-user] Re: Catching "java OOM: GC overhead limit exceeded" error to stop an akka application asap

2017-02-22 Thread johannes . rudolph
This SO questions lists a few alternatives about how to achieve that with a reasonably new JVM: http://stackoverflow.com/questions/12096403/java-shutting-down-on-out-of-memory-error On Wednesday, February 22, 2017 at 11:27:21 AM UTC+1, Hippolyte Léger wrote: > > Hello, > so I have a fairly

[akka-user] Re: The Akka system keeps Disassociating

2017-02-09 Thread johannes . rudolph
Hi Gang, disassociation usually means some kind of connection error. Unfortunately, akka currently doesn't say anything about why a connection was closed. This will be improved in the next version. See https://github.com/akka/akka/pull/22278 Johannes On Wednesday, February 8, 2017 at

[akka-user] Re: akka-http: randomly a client request does not hit the server side, no error messages

2017-02-15 Thread johannes . rudolph
Hi Elmar, could you first update to the latest version of akka-http, 10.0.3? We fixed a few issues with the connection pool since akka 2.4.7. Johannes On Wednesday, February 15, 2017 at 5:12:18 PM UTC+1, Elmar Weber wrote: > > Hello, > > we are observing an issue with akka-http client side

[akka-user] Re: [akka-http] Configuring HTTPS with a trusted certificate chain

2016-11-10 Thread johannes . rudolph
Hi Julian, can you post more information about your code and what happens exactly when you run it? What kind of key material do you have and how do you load it? Are you using akka-http on the client side or on the server side? Johannes On Thursday, November 10, 2016 at 9:50:08 AM UTC+1,

[akka-user] Re: ('=') sign still not allowed in query string even with Uri.ParsingMode.Relaxed? (akka/akka#18479)

2016-10-17 Thread johannes . rudolph
Great, thanks Richard for tackling this and André for the explanations! On Saturday, October 15, 2016 at 10:05:59 PM UTC+2, Richard Imaoka wrote: > > Sorry I had read the full discussion but I think I didn't correctly > understand what is allowed in Akka, and what is RFC 3986 compliant. > Now

Re: [akka-user] How to handle web socket message to upload base64 encoded string of 10mb file

2016-10-17 Thread johannes . rudolph
Thanks Rafał for these explanations. Just a small correction: On Tuesday, October 11, 2016 at 3:58:09 PM UTC+2, Rafał Krzewski wrote: > > An alternative solution would be looking up websocket buffering settings > and jacking it up enough to receive all messages as Strict :) > Unfortunately, no,

[akka-user] Re: [akka-stream] Detect failure in MergeHub

2016-10-18 Thread johannes . rudolph
Hi Victor, good point. I think the Scaladoc is wrong there. Could you raise an issue at akka/akka? Johannes On Tuesday, October 18, 2016 at 2:28:14 PM UTC+2, Victor wrote: > > Hi, > > It's written in the ScalaDoc of the *MergeHub.source* method that: > > If one of the inputs fails the Sink,

[akka-user] Re: Fetching remote file via akka-http singleRequest results in extremely high allocation rate

2016-10-19 Thread johannes . rudolph
Using mapConcat instead may even be faster ;) On Wednesday, October 19, 2016 at 5:05:22 PM UTC+2, vladysla...@rtsmunity.com wrote: > > Okay, so the issue was really in Framing performance. Changing Framing > stage for > > flatMapConcat(chunk -> Source.from(Arrays.asList(chunk.split("\n". >

[akka-user] Re: Fetching remote file via akka-http singleRequest results in extremely high allocation rate

2016-10-19 Thread johannes . rudolph
Hi Vladyslav, this sounds like a worst-case scenario for the Framing stages: 45M lines and each line 2-3 characters long will put a lot of pressure on the streams infrastructure and the framing stage. It might still make sense to benchmark and optimize the Framing stage. One optimization could

[akka-user] Re: [akka-http] adding cookie attributes

2017-08-15 Thread johannes . rudolph
Hi Christophe, yes, that's correct. There seems to be no way to model custom cookie attributes right now. Using RawHeader is the right workaround for now. I filed https://github.com/akka/akka-http/issues/1354 to discuss improvements. Johannes On Monday, August 14, 2017 at 10:31:11 AM UTC+2,

[akka-user] Re: Akka HTTP usage of HttpEntity.toStrict

2017-08-15 Thread johannes . rudolph
Hi Yannick, if you want to log the complete request contents, then there is no other way than to collect anything into memory (actually, that's a consequence of logging, not of the API). In that case, you can use toStrict method or the toStrictEntity directive at the root of your routing tree

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

2017-08-15 Thread johannes . rudolph
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-http] Http().superPool() and MergeHub.source backpressure

2017-08-15 Thread johannes . rudolph
Hi Jeff, if you don't read the response bodies of all the responses, your pipeline will stall because the super pool connection are still waiting for your code to actually read the responses. In your example, try to add `x.discardEntityBytes` (or actually read the entity) inside of the

[akka-user] Re: Akka Cluster Pub/Sub performance for chat-room like applications

2017-07-13 Thread johannes . rudolph
On Thursday, July 13, 2017 at 1:08:19 PM UTC+2, Alexander Lukyanchikov wrote: > > *The only question, is it capable to manage tens of millions of topics? > Would it perform better then our current solution?* > No, most likely it currently won't scale up to 1 million active topics. In Akka's

Re: [akka-user] Re: Akka Cluster Pub/Sub performance for chat-room like applications

2017-07-13 Thread johannes . rudolph
On Thursday, July 13, 2017 at 2:56:52 PM UTC+2, Justin du coeur wrote: > > (I should note: I don't use Akka Pub/Sub myself, but I'm wondering whether > Cluster Sharding actually fits your use case well. Depending on the > details, it might.) > Yep, I guess that's true. With cluster sharding

[akka-user] Re: [akka-streams] Generic streams and abstract types

2017-07-12 Thread johannes . rudolph
Hi Jeff, your API seems quite complex. I don't know the purpose of it so I cannot suggest anything but I'd try to simplify. :) That said, your problem seems to be that you cannot write a concrete type that would express the dependency between the two components of the tuple `(RequestBuilder,

[akka-user] Re: akka-http - Setting TLS Server Name Indicator (SNI) explicitly for Client-Side HTTPS

2017-07-13 Thread johannes . rudolph
Hi Shayan, this seems like an uncommon usage for an HTTP client. Basically you want to connect to a server that presents a certificate for the wrong host name. This is unsupported out of the box because it would be an unsafe thing to do in general. The way you tried it does not work because

[akka-user] Re: Akka-Http Livelock with 100% CPU consumption when creating connection to non-existing host

2017-07-13 Thread johannes . rudolph
Hi Vanger, thanks for the report. Have you changed the value of akka.http.host-connection-pool.min-connections (https://github.com/akka/akka-http/blob/master/akka-http-core/src/main/resources/reference.conf#L233)? That would explain the behavior where the pool tries to keep connections alive

[akka-user] Re: Akka http client dispatcher

2017-07-13 Thread johannes . rudolph
Hi Diego, it seems it is an oversight that the dispatcher for at least the actor parts of the pool infrastructure cannot be configured anywhere. I created a ticket to track adding this feature: https://github.com/akka/akka-http/issues/1278 Thanks, Johannes On Thursday, June 22, 2017 at

[akka-user] Re: [akka-streams] Generic streams and abstract types

2017-07-13 Thread johannes . rudolph
On Wednesday, July 12, 2017 at 9:08:52 PM UTC+2, Jeff wrote: > > As for the issue of complexity, it's actually not as complex as it sounds. > I'm using Http().superPool() to make api requests and I wanted to avoid > having to create a separate stream for every single iteration of api > request

[akka-user] Re: Akka-Http Entity Stream Truncation

2017-07-10 Thread johannes . rudolph
Hi Michael, On Monday, July 10, 2017 at 9:01:00 AM UTC+2, Michael Pisula wrote: > > As far as I saw from the source code, it could point to a problem with > header parsing, but I am not exactly sure what could cause the problem. > The place in the code is actually misleading, as it the error is

Re: [akka-user] Re: Akka-http: how to deal with incorrect http headers

2017-05-15 Thread johannes . rudolph
Hi Florian, can you clarify what needs improvement? Is that about client or server side? Johannes On Saturday, May 13, 2017 at 10:47:52 AM UTC+2, Florian Rosenberg wrote: > > I'm seeing a similar problem, but not wit the URI but with the > Strict-Transport-Header, it seems to be invalid,

Re: [akka-user] Re: Akka Http how to add charset utf-8 to the content-type header

2017-05-15 Thread johannes . rudolph
Hi Thibault, you are right, there's currently no built-in way to do this. To achieve it, you could e.g. copy the Jackson marshaller from the sources to use a custom media type. See here:

[akka-user] Re: has anyone attempted a multi-source authentication?

2017-05-22 Thread johannes . rudolph
Hi Andrew, here's a general idea at how it could work: If you model each authentication method as a `Directive1[Session]` that returns the session (or user, principal, etc.) for that authentication method and all of the directive return the a value of the same type or a type with a common

[akka-user] Re: How to map unstructured Json to a case class in Akka-Http

2017-05-22 Thread johannes . rudolph
Hi, try this case class structure instead: case class Customer(name: String,jsonData: JsValue) Johannes On Saturday, May 13, 2017 at 10:47:52 AM UTC+2, vishal...@exadatum.com wrote: > > > I am trying to create the REST service using akka Http and slick . I am > trying to persist the Raw

[akka-user] Re: akka-http ssl setup documentation / examples isn't very clear. Is config-based

2017-05-22 Thread johannes . rudolph
Hi Andrew, your observation is correct. Server side TLS configuration is only possible through code right now. We have tickets to track improving documentation and maybe adding the configuration based approach https://github.com/akka/akka-http/issues/55

Re: [akka-user] Re: ActorSystem Uncaught fatal error shutting down ActorSystem !

2017-06-07 Thread Johannes Rudolph
The rest of the stack here will tell you where the problem comes from: On Wed, Jun 7, 2017 at 10:40 AM, wrote: > * situation 1 : ( has tell me the stack, and tell me *Shutdown finished * > )* > INFO | jvm 1| 2017/04/07 15:49:52 | java.lang.NoClassDefFoundError: >

Re: [akka-user] Re: ActorSystem Uncaught fatal error shutting down ActorSystem !

2017-06-07 Thread Johannes Rudolph
*situation 1 * . > but *situation 2,3,4 *, din't tell me the reason ( the stack ), id dont > hnow how solve this problem. > > 在 2017年6月7日星期三 UTC+8下午5:00:07,Johannes Rudolph写道: >> >> >> The rest of the stack here will tell you where the problem comes from: >> >> On

[akka-user] Re: ActorSystem Uncaught fatal error shutting down ActorSystem !

2017-06-06 Thread johannes . rudolph
Hi, in cases of fatal errors, the error and stack trace is logged to stderr (not using the logging framework). Note that in some cases, the logging itself may fail (that's why the error is fatal: after it happens, the state of the JVM might be corrupted and operations like logging may fail for

Re: [akka-user] How to avoid saturation in Akka HTTP (latency spikes)?

2017-05-04 Thread johannes . rudolph
Hi Manuel, how did you determine that the problem is related to Akka? What did the profiling say and where's the bottleneck now? Answering your questions: On Friday, April 28, 2017 at 12:10:50 AM UTC+2, Manuel wrote: I guess that non-blocking code using Futures and work stealing by the >

[akka-user] Re: HTTP - ask actor does not stop when client closes connection

2017-05-04 Thread johannes . rudolph
Hi Richard, the behavior you describe is as expected. The ask ActorRef has no relation to the connection and so watching it doesn't have the desired effect. The routing DSL doesn't even know about the concept of connections. It only handles single requests and doesn't get notified in any way

[akka-user] Re: ActorSystem Uncaught fatal error shutting down ActorSystem !

2017-06-06 Thread johannes . rudolph
Hi, my colleague Arnout just found out that the error will only be logged to stderr if you enable the `akka.jvm-exit-on-fatal-error` setting. Can you try enabling this setting and then run again? I also filed an issue to improve the logging of fatal errors:

[akka-user] Re: Akka cluster http management

2017-06-06 Thread johannes . rudolph
Hi, the hostname setting is a bit misnamed. It defines the interface the server binds to. So, you can put "0.0.0.0" in there to make sure the management interface is bound on all interfaces (but make sure not to expose it publicly) or put some other interface address in there. I filed

[akka-user] Re: GraphStageActor and ActorGraphInterpreter

2017-10-04 Thread johannes . rudolph
Cool, thanks for sharing, nice stuff :) We know, btw., that some pieces of the architecture are not completely optimal but are consequences of the history of the projects. E.g. it could make sense to write a streams-only implementation of the TCP layer instead of putting it on top of the actor

[akka-user] Re: Akka Http: What does the source returned by http://doc.akka.io/japi/akka/2.4.5/akka/http/scaladsl/model/HttpEntity.html#getDataBytes-- materialize to?

2017-09-11 Thread johannes . rudolph
Hi Bwmat, On Saturday, September 9, 2017 at 2:32:13 AM UTC+2, Bwmat wrote: > > The type is just Object, and it's not documented in the linked javadoc. > It is undefined. It needs to have this type so that users can pass in sources with any materialized value. The Akka Http implementation will

[akka-user] Re: Akka Http Performance with high-latency route.

2017-09-11 Thread johannes . rudolph
Hi Dominic, it depends on what you mean with "high-latency" API. If you mean that some external service is called which takes a long while, then you need to ensure that executing this external call does not block the thread and the thread can be used for other tasks while waiting for the

[akka-user] Re: Cluster: Loosing messages when rebalancing

2017-09-25 Thread johannes . rudolph
Hi Eduardo, cluster sharding has at-most-once delivery (as most of Akka) so losing some messages is to be expected. Persistent actor can opt-in to at-least-once delivery (see http://doc.akka.io/docs/akka/current/scala/persistence.html#at-least-once-delivery), for other actors, you need to

[akka-user] Re: Materialize future after content negotiation

2017-09-26 Thread johannes . rudolph
Oops, one should read the whole question before answering... Just saw that you already tried that. Unfortunately, it seems that this is indeed a shortcoming of the current model. I guess with a bit of fiddling you could try making all of those marshallers marshal to `Future[HttpResponse]`

[akka-user] Re: Materialize future after content negotiation

2017-09-26 Thread johannes . rudolph
Hi Mantis, you are right, `Marshaller.withFixedContentType` is a bit restricted in that regard. Fortunately, it is only a shortcut for simpler cases and the full asynchronous functionality is available for marshallers. Try something like Marshaller[Iterator[Data], HttpResponse] { implicit ec

[akka-user] Re: GraphStageActor and ActorGraphInterpreter

2017-09-28 Thread johannes . rudolph
Correct, it will limit parallelism. I usually see the streams infrastructure more as a control channel that makes sure that data flows correctly. These kind of control things shouldn't require much overall CPU share so it should not matter so much. If you want to do CPU-intensive work you need

Re: [akka-user] Tunning default dispatcher seems to have no effect

2017-09-28 Thread johannes . rudolph
Hi Kilic, Try looking at stack traces during the busy periods (e.g. use `jstack` on the command line to gather some), that should give you a clue what's going on. In the picture you sent in your first email there were actually only 8 regular pool threads. Are there times where more is going

[akka-user] Re: GraphStageActor and ActorGraphInterpreter

2017-09-28 Thread johannes . rudolph
Hi Unmesh, On Wednesday, September 27, 2017 at 3:01:24 PM UTC+2, Unmesh Joshi wrote: > > I was trying to go through the code to understand how GraphStages receive > actor messages. I see that GraphStageActor is a actor not created like > normal actors. I looks like all the messages to

Re: [akka-user] Ask a lot of Actors inside an Iteration in an Akka-Scheduler and wait for reply of everyone results in a stop of actor-system and webserver

2017-09-28 Thread johannes . rudolph
Hi Simon, as Johan said, you shouldn't use `get` to wait for the result of future. This just synchronously blocks the thread from doing any other useful work. Instead, you can asynchronously handle the result of the future once it is available. Because it is so common, we have a pattern for

Re: [akka-user] Re: Akka Http memory leak suspect

2017-09-26 Thread Johannes Rudolph
On Tue, Sep 26, 2017 at 7:18 AM, Patrik Nordwall wrote: > If the names are StreamSupervisor- I think it can be that a new > Materializer is created for each request. I don’t know if that is done by > your application or by Akka Http. Does that ring any bells? Do you

[akka-user] Re: Akka Http memory leak suspect

2017-09-25 Thread johannes . rudolph
Hi Bartosz, I can look into the heap dump. You can send it to me privately. If that's not possible could you post an histogram? It would be great if that could be filtered once for subclasses of `Actor` (which will probably be dominated by `ActorGraphInterpreter`) and once filtered by

[akka-user] Re: Akka Http & Streams interaction, http requests getting blocked, program is stuck

2017-08-22 Thread johannes . rudolph
Hi Jerry, your explanation is spot-on. You need to be make sure that the entities of all responses are consumed. In your case, that may not happen because of a race-condition: `take(2)` will cancel the stream and responses might get discarded between the first and the second

Re: [akka-user] Re: Akka Http & Streams interaction, http requests getting blocked, program is stuck

2017-08-22 Thread Johannes Rudolph
Hi Jerry, On Tue, Aug 22, 2017 at 12:20 PM, Jerry Tworek wrote: > Do I understand it correctly, that in this case cachedHostConnectionPool > is basically unusable? I assume it will always be executed in a separate > stage from the next stage, that actually consumes the

Re: [akka-user] Re: Akka Http memory leak suspect

2017-09-27 Thread Johannes Rudolph
ave verified that but there are 2 places where declare the > materializers. Both are declared as vals. I will verify the number of > materializer instances on my heap-dump to confirm. > > On Tue, 26 Sep 2017 at 13:24 Johannes Rudolph <johannes.rudolph@lightbend. > com> wrote: > >&g

Re: [akka-user] Spray->Akka-Http Migration - seeing high 99th percentile latencies post-migration

2017-11-16 Thread johannes . rudolph
Hi Gary, did you find out what's going on by now? If I understand correctly, you get latency spikes as soon as you use the `entity[as[String]]` directive? Could you narrow down if there's anything special to those requests? I guess you monitor your GC times? Johannes On Wednesday, November

Re: [akka-user] Spray->Akka-Http Migration - seeing high 99th percentile latencies post-migration

2017-11-16 Thread johannes . rudolph
I wonder if you could start a timer when you enter the trace block and then e.g. after 200ms trigger one or multiple stack dumps (using JMX or just by printing out the result of `Thread.getAllStackTraces`). It's not super likely that something will turn up but it seems like a simple enough

Re: [akka-user] Performance of Akka-Http 2.5.4

2017-11-13 Thread johannes . rudolph
I missed this post before. I'd like to add another point. Akka Http hasn't been performance tested on a 40 core machine. The high idle CPU percecntage means that either Akka / Akka Http is not configured correctly for this amount of cores or that there are actual contention issues at these

Re: [akka-user] Streaming proxy/tunel on top of akka-http

2017-11-13 Thread johannes . rudolph
I tried your code and it doesn't OOM for me. Have you tried it outside of a test suite? It might be that the test infrastructure is collecting all the data when you use something as `reponse.entity`. If that doesn't help, try capturing a heap dump on OOM and see where the memory is spent.

[akka-user] Re: Akka-HTTP compilation error using custom requireParam() directive

2017-11-13 Thread johannes . rudolph
Hi Evgeny, you discovered one of the reasons for the magnet pattern. If you use `requireParam("param".as[Int]) { abc => ... }` then the `{ abc => }` block is mistaken as the implicit argument of `requireParam`. So, either you are ok with that and require users to use extra parentheses

[akka-user] Akka Http 10.1.0-RC1 Released

2017-12-22 Thread johannes . rudolph
its added removed 4448414860 Arnout Engelen 321196 613 Johannes Rudolph 22 7202789 Josep Prat 3 122 349 Jonas Fonseca 2 28 17 Pavel Boldyrev 1 6 4 Johan Andrén 1 128 4 Martynas Mickevičius 1 111 1 Ivan

Re: [akka-user][deprecated] Re: [akka-user] Spray->Akka-Http Migration - seeing high 99th percentile latencies post-migration

2018-10-09 Thread Johannes Rudolph
That the entity directive is part of the picture could be a hint that indeed streaming requests might be the cause of this. In spray, there was no request streaming enabled by default and the engine just collected the complete stream into a buffer and dispatched it to the app only after everything

[akka-user][deprecated] Re: Akka SSLSession leak when running Akka with native TLS

2018-11-22 Thread johannes . rudolph
Hi Sean, thanks for the comprehensive report. What do you mean with a native vs non-native TLS server? Is the example app for the "native TLS" server? Johannes On Wednesday, November 21, 2018 at 6:26:09 PM UTC+1, Sean Gibbons wrote: > > Hi all, > > I have been working with a native TLS Akka

Re: [akka-user][deprecated] Re: Akka SSLSession leak when running Akka with native TLS

2018-11-22 Thread Johannes Rudolph
I see. Thanks. With the provided code I couldn't reproduce the issue at least in the quick tests I did. Could you run jmap -histo:live on the command line when some memory has accrued and send the output here (or in private)? Johannes On Thu, Nov 22, 2018 at 1:16 PM Sean Gibbons wrote: >

[akka-user][deprecated] Re: Aggregating millions of records using Akka-Streams

2019-08-08 Thread Johannes Rudolph
Reposted here: https://discuss.lightbend.com/t/aggregating-a-million-records-using-akka-streams/4781 On Thursday, August 8, 2019 at 11:02:13 AM UTC+2, Aditya pavan Kumar wrote: > > I am running a simulation which generates a million records every second. > I’m writing them to Kafka and reading

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 johannes.rudo

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

2015-07-29 Thread 'Johannes Rudolph' via Akka User List
08:16:09 UTC+2 schreef Johannes Rudolph: Hi Luc, On Mon, Jul 27, 2015 at 8:23 PM, Luc Klaassen luc.kl...@gmail.com wrote: If you check the git repository, i made some dumps with rawcap (to be able to capture localhost tcp). Thanks. I wonder if you are running servers on different ports

  1   2   >