[akka-user][deprecated] Re: [akka-user] Re: akka-http web socket issue

2018-08-14 Thread vauldex . eblangga
I will re-open this issue because I am having problems regarding `s2.ripple.com`'s reply. I was able to connect using either `webSocketClientFlow` and `singleWebSocketRequest`. Having code block as my outgoing message: ``` val outgoing: Source[TextMessage.Streamed, NotUsed] =

Re: [akka-user] Re: Akka Http 10.1.0 Released

2018-03-09 Thread Konrad Malawski
Excellent, thanks for reporting back :) -- Konrad Malawski On March 10, 2018 at 15:52:46, Gavin Baumanis (gavinbauma...@gmail.com) wrote: > Congratulations to all! > Thanks very much for your ongoing efforts! > > I have updated our application to the new version and all my tests pass > and the

[akka-user] Re: Akka Http 10.1.0 Released

2018-03-09 Thread Gavin Baumanis
Congratulations to all! Thanks very much for your ongoing efforts! I have updated our application to the new version and all my tests pass and the application is running as expected. Gavin. On Friday, 9 March 2018 06:04:19 UTC+11, Johannes Rudolph wrote: > > Dear hakkers, > > > we are happy

[akka-user] Re: Akka HTTP Websockets Java with Actor

2018-03-04 Thread Brett Tofel
In case anyone is looking for an updated version of this code that will work with more current akka-http and Java: https://gist.github.com/bentito/560eb95c64fa131efb34ad62c7bf60f8 -Brett Tofel On Tuesday, March 8, 2016 at 9:59:26 AM UTC-5, Johan Andrén wrote: > > Here is an adaptation of the

[akka-user] Re: akka http 10.0.11 under OSGi container

2018-03-02 Thread Brian Kent
I brought this up before for 10.0.11, but forgot to open the PR like was suggested! It appears OSGi support was removed in 10.1.0-RC1, though they are actively seeking help.

Re: [akka-user] Re: akka-http is there an example of showing how to integrate with servlet container?

2018-01-02 Thread Konrad “ktoso” Malawski
Matt is correct, Akka HTTP is a complete server implementation, all the way down the sockets, through parsing and rendering headers, lifecycle management etc etc. It does so in a fully streaming manner as well, which is it’s strong point. Embedding Akka HTTP inside a servlet container sells it

[akka-user] Re: akka-http is there an example of showing how to integrate with servlet container?

2018-01-02 Thread Matt Edge
If I am not mistaken Akka HTTP has its own HTTP server layer that it uses (when you do Http().bind(..)). You can find more details in the Core Server API section of the docs. It discusses in some detail what's going on under the hood and how Akka's HTTP layer is, in my view, essentially a

[akka-user] Re: akka-http is there an example of showing how to integrate with servlet container?

2018-01-02 Thread gdalessio
Hi all, Regarding this topic, are there more details about this, or more then just "*completely negates all the benefits that Akka HTTP*" ? thanks! On Tuesday, 14 April 2015 15:49:19 UTC+2, Jas wrote: > > is there an example showing how to integrate servlet container with > akka-http? i'm

[akka-user] Re: akka-http osgi.ee capability expecting exact version=1.8.0_144 ?

2017-12-08 Thread Johan Andrén
Hi Brian, I think this is accidental and I think we had the same accidental issue in Akka that was then fixed a while ago (https://github.com/akka/akka/issues/23795) Please open a ticket in the Akka HTTP issue tracker for this. https://github.com/akka/akka-http/issues (and even better if you

[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] Re: Akka http - dispatch on request content type

2017-10-13 Thread Johan Andrén
The "normal" way would be to have the same logic, but different unmarshalling, and this the unmarshalling infra takes care of, you'd use the entity directive https://doc.akka.io/docs/akka-http/10.0.10/scala/http/routing-dsl/directives/marshalling-directives/entity.html and pass a

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

2017-09-28 Thread Bartosz Jankiewicz
Hi Johannes, Thank you for looking into that. This is really surprising finding. I cannot find anything wrong with my code though in this regards. There is one more materializer beining initialized, but for an endpoint that is rarely used (Swagger docs - I have verified in the logs, that there

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

2017-09-27 Thread Johannes Rudolph
Hi Bartosz, I had a quick look into the dump. It contains >317000 StreamSupervisors, so creating too many materializers is really the issue. Note, that the materializer itself might go out of scope but the engine still stays alive if the materializer has not been shutdown manually. I created

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

2017-09-26 Thread Bartosz Jankiewicz
I have 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.rudo...@lightbend.com> wrote: > On Tue, Sep 26, 2017 at

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

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

2017-09-25 Thread Patrik Nordwall
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 have any creation of stream materializers in your code? /Patrik mån 25 sep. 2017 kl. 21:51

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

2017-09-25 Thread Bartosz Jankiewicz
Hi Johannes, I can share the heap dump. I will try uploading it to Google Drive. I'm still suspecting Akka Http. A few days ago I was forced to migrate to HTTP4S in emergency. After the migration of endpoints (no single other change applied) the heap dump utilisation is stable. Bartosz On

[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 Entity Stream Truncation

2017-09-14 Thread Dusan Stanojevic
Hi, I saw this exception happen in production with Play 2.6.x but could not replicate it. After reading your post I turned throttling on, made a request and killed the tab before it was done sending data and got the exception on localhost. Thank you, Dusan On Monday, July 10, 2017 at 9:08:29

[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: Akka HTTP Client SuperPool Benchmarking

2017-09-05 Thread sam
I seem to be running into the same problem mentioned here. Looks like i may have to abandon Akka-Http-Client. No matter what i change I get the same request volume and CPU load. https://groups.google.com/forum/#!topic/akka-user/_wd1vl0mzfE -- >> Read the docs: http://akka.io/docs/

[akka-user] Re: Akka HTTP Client SuperPool Benchmarking

2017-09-05 Thread sam
I seem to be running into the same problem mentioned here. Looks like i may have to abandon Akka-Http-Client. No matter what i change I get the same request volume and CPU load. https://groups.google.com/forum/#!topic/akka-user/_wd1vl0mzfE On Sunday, September 3, 2017 at 11:25:28 PM UTC-7,

[akka-user] Re: Akka-HTTP creating a directive to create a unique request id?

2017-08-29 Thread Jeremy Townson
Because the uuid does not depend on the request in any way, you can map a directive called 'pass' (pass is a a sort of identity directive that does nothing). e.g. "directive" should "generate a uuid" in { import akka.http.scaladsl.server.Directives.pass val uuid =

[akka-user] Re: Akka HTTP Client Unmarshalling - different success and error responses

2017-08-22 Thread Gary Struthers
> > I use Either but I unmarshal all text to Left and JSON to Right def mapPlain(entity: HttpEntity): Future[Left[String, Nothing]] = { Unmarshal(entity).to[String].map(Left(_)) } def mapChecking(entity: HttpEntity): Future[Right[String, AnyRef]] = {

[akka-user] Re: Akka HTTP Client Unmarshalling - different success and error responses

2017-08-22 Thread Richard Rodseth
Answer appears to be yes. Here's what my for comprehension looks like, and the order of the DTOs in the Either doesn't matter. val responseFuture = for { requestEntity <- Marshal(userAttributes).to val request = HttpRequest(method = HttpMethods.POST, uri = addUserURL, headers =

[akka-user] Re: Akka HTTP Client Unmarshalling - different success and error responses

2017-08-22 Thread Richard Rodseth
Spoke too soon Exception in thread "main" akka.http.scaladsl.unmarshalling.Unmarshaller$EitherUnmarshallingException: Failed to unmarshal Either[AddUserErrorDTO, AddUserResponseDTO] (attempted AddUserResponseDTO first). Right failure: Object is missing required member 'id', Left failure:

[akka-user] Re: Akka HTTP Client Unmarshalling - different success and error responses

2017-08-22 Thread Richard Rodseth
Having some success with Either unmarshaller. I don't think it's documented, but here's a test: https://github.com/akka/akka-http/blob/master/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/UnmarshallingSpec.scala On Tue, Aug 22, 2017 at 11:16 AM, Richard Rodseth

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

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

2017-08-22 Thread Jerry Tworek
Thank you for your response. Indeed, when using http.singleRequest I can combine request and unmarshalling in a single stage and that will solve the problem. Initially, though I've tried to use Http().cachedHostConnectionPool(...), which is why the code looked like above. Do I understand it

[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 usage of HttpEntity.toStrict

2017-08-16 Thread Roland Kuhn
Hi Yannik, if your logging facility were capable of streaming then you could also avoid the double materialization issue using the .alsoTo combinator: you send the bytes to the logger while processing them in your business logic. This is also beneficial if the logger compacts the data,

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

2017-08-16 Thread Yannick Lazzari
Thanks for confirming. It's just that with the way you said it on the ticket, calling the usage of toStrict a "workaround", you made it sound like even if toStrict was in the API, all its uses were kind of wrong and workarounds for a "proper" and "streaming" way to consume the entity body more

[akka-user] Re: [akka-http] Http().superPool() and MergeHub.source backpressure

2017-08-15 Thread Jeff
I'm embarrassed I forgot something so obvious. Much thanks! On Tuesday, August 15, 2017 at 8:50:27 AM UTC-7, johannes...@lightbend.com wrote: > > 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

[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] 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 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] Re: [akka-http] Http().superPool() and MergeHub.source backpressure

2017-08-14 Thread Jeff
Quickly following up on this. My understanding of how MergeHub works leads me to believe that all 100 requests in my example should fire, however only 8 of them do, and only 4 complete. On Wednesday, August 9, 2017 at 4:53:18 PM UTC-7, Jeff wrote: > > I am getting behavior that I do not

[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-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 Entity Stream Truncation

2017-07-10 Thread 'Michael Pisula' via Akka User List
Hi Johannes, perfect, thanks for the insight. I think we can work with that. Cheers, Michael Am Montag, 10. Juli 2017 16:55:55 UTC+2 schrieb johannes...@lightbend.com: > > 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

[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

[akka-user] Re: Akka http -ERROR :Substream Source cannot be materialized more than once If Payload size increased

2017-07-09 Thread vishal . verma
I came across the post that says akka flushes the entity if not declated strict, If thats right can any one help me as to how do i declare my jobDetailsEntity as `strict ` On Sunday, July 9, 2017 at 9:14:14 PM UTC+5:30, vishal...@exadatum.com wrote: > > > > down votefavorite >

[akka-user] Re: Akka http client not responsing

2017-06-20 Thread Daniel Vigovszky
Well in our case we did not add all this in the beginning, than had to find and fix them case by case because of real issues in production :/ 2017. június 20., kedd 9:23:28 UTC+2 időpontban Erwan Loisant a következőt írta: > > Thank you, I'll try that! > > But that's a lot of boilerplate, do

[akka-user] Re: Akka http client not responsing

2017-06-20 Thread Erwan Loisant
Thank you, I'll try that! But that's a lot of boilerplate, do everyone actually do all of that each time they need to Unmarshal a result? On Monday, June 19, 2017 at 8:06:37 PM UTC+2, Daniel Vigovszky wrote: > > Hi, make sure you catch all exceptions, for example if the unmarshaller > dies you

[akka-user] Re: Akka http client not responsing

2017-06-19 Thread Daniel Vigovszky
Hi, make sure you catch all exceptions, for example if the unmarshaller dies you still have to consume the entity. For example by putting a recoverWith case on the unmarshaller's future something like this: Unmarshal(response.entity) .to[T] .recoverWith { case reason: Throwable =>

[akka-user] Re: [akka-http] Tagless Final and ToResponseMarshallable

2017-06-19 Thread Juan José Vázquez Delgado
In order to avoid the mix-in, you should rely on ad-hoc polymorphism, i.e. use implicits to get an evidence of a Marshaller for your type. `Marshaller` is basically a typeclass so stick to that pattern in your solution. El jueves, 15 de junio de 2017, 23:21:17 (UTC+2), Jeff escribió: > > That

[akka-user] Re: akka-http client: cancelling requests

2017-06-16 Thread Daniel Vigovszky
I created an issue about the topic: https://github.com/akka/akka-http/issues/1205 2017. június 9., péntek 9:10:48 UTC+2 időpontban Daniel Vigovszky a következőt írta: > > Hi all, > > Sorry for reposting this but originally I posted it as a reply in a > different thread and I realized that it is

[akka-user] Re: [akka-http] Tagless Final and ToResponseMarshallable

2017-06-15 Thread Jeff
That gave me a lot of inspiration, much thanks. I've adapted that into the following pattern: abstract class RestaurantRoutes[F[_]: Monad](algebra: RestaurantAlgebra[F]) extends MonadToResponseMarshaller[F] { import algebra._ def route: Route = path("api" / "v4.0" / "restaurant" /

[akka-user] Re: [akka-http] Tagless Final and ToResponseMarshallable

2017-06-13 Thread Juan José Vázquez Delgado
I've faced a similar situation recently working on this example . It's not easy but is definitely feasible. The bottom line is: run your own marshaller. El martes, 13 de junio de 2017, 18:44:01 (UTC+2), Jeff escribió: > > I am trying to learn

[akka-user] Re: Akka-Http/WebSocket - Substream Source has not been materialized in 5k millis

2017-06-03 Thread Kalyan Kadiyala
Message volume from upstream i.e., Riemann WebSocket end point is 1million text messages each under few KB in size. On Saturday, June 3, 2017 at 8:59:59 AM UTC-7, Kalyan Kadiyala wrote: > > Lib dependency: "com.typesafe.akka" %% "akka-http" % "10.0.7" > > > Issue Background - I am running a

[akka-user] Re: akka-http client: How to ensure response entity is read

2017-05-29 Thread Daniel Vigovszky
Hi Arno, did you figure out anything about this? vigoo 2017. május 18., csütörtök 7:12:37 UTC+2 időpontban Arno Haase a következőt írta: > > I am aware that response entities must always be consumed with akka-http > client. > > For (very) slow connections I find it difficult to do that

[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: akka http remote file conf's include reference not getting processed

2017-05-19 Thread Brian Smith
Hi I think that's a fairly normal way to use typesafe config - I'm doing similar and it seems to work for me. I'd suggest turning on akka.log-config-on-start in your restapi.conf or also specifying -Dconfig.trace=loads to see what it's doing at startup. Perhaps it has found another

[akka-user] Re: akka http remote file conf's include reference not getting processed

2017-05-19 Thread Andrew Norman
is this not a common environment setup? (aka. an application.conf inside an uber jar containing application configurations and an external smaller conf file that contains a small set of environment-specific overrides) if it isn't I'd be happy to here how others manage application

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

2017-05-19 Thread Andrew Norman
We've both gotten ssl to work in a manual (aka non-sslConfig) way. My question still stands though. Has the sslConfig actually been wired to work with akka-http or is this still something being worked on? If the former is there any example to a config-based ssl integration? And please don't

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

2017-05-17 Thread abdeali
recently I was also working on AKKA Http SSL and I would agree to your comment upto some extent, nevertheless I succeeded implementing SSL using sslContext and not using sslConfig at all I referred to documentation only ... here's a link which may help you ...

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:

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 deal with incorrect http headers

2017-05-13 Thread Florian Rosenberg
I'm seeing a similar problem, but not wit the URI but with the Strict-Transport-Header, it seems to be invalid, changing the conf to ignore it has no effect. I'm using a websocket though. After debugging around for a while, I instrumented some code and see this: Illegal

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

2017-05-06 Thread Thibault Meyer
Hi Greg, how to do this ? I see no arguments in completeOKWithFuture or Jackson.marshaller() to do this. I'm using Java version of akka-http. Thanks Le samedi 6 mai 2017 00:49:14 UTC+2, Greg Methvin a écrit : > > There is no charset parameter defined for application/json. See >

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

2017-05-05 Thread Greg Methvin
There is no charset parameter defined for application/json. See https://www.iana.org/assignments/media-types/application/json The encoding should not be determined by looking at the charset parameter, but rather by looking at the first four octets: https://tools.ietf. org/html/rfc4627#section-3

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

2017-05-05 Thread Alan Burlison
On 05/05/17 18:42, Alex Cozzi wrote: funny, I was looking into this yesterday! I am by no means an expert, but I think that what it is happening is the following: application/json implies UTF-8: if you look at the MediaType class from akka http you se the declaration: I believe you are

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

2017-05-05 Thread Alex Cozzi
funny, I was looking into this yesterday! I am by no means an expert, but I think that what it is happening is the following: application/json implies UTF-8: if you look at the MediaType class from akka http you se the declaration: val `application/json` = awfc("json", HttpCharsets.`UTF-8`,

Re: [akka-user] Re: Akka HTTP - Can't return completeWithFuture

2017-04-30 Thread Thibault Meyer
Thanks for response Le samedi 29 avril 2017 23:32:52 UTC+2, Michal Borowiecki a écrit : > > Hi Thibault, > > Looks like the docs are out of date. > > If you read the compilation error message carefully, you'll notice > Jackson.marshaller is giving you a Marshaller

Re: [akka-user] Re: Akka HTTP - Can't return completeWithFuture

2017-04-29 Thread 'Michal Borowiecki' via Akka User List
Hi Thibault, Looks like the docs are out of date. If you read the compilation error message carefully, you'll notice Jackson.marshaller is giving you a |Marshaller| while completeWithFuture is expecting a

[akka-user] Re: Akka HTTP - Can't return completeWithFuture

2017-04-29 Thread Thibault Meyer
According to http://doc.akka.io/docs/akka-http/10.0.5/java/http/common/json-support.html we have to use akka.http.javadsl.marshallers.jackson.Jackson.marshaller(T.class) But this method does not exists anymore. akka.http.javadsl.marshallers.jackson.Jackson.marshaller()

[akka-user] Re: Akka-Http [Version 10.0.5] OptionalHeaderValueByName & HeaderValueByName does not work for valid Content-Type values

2017-04-04 Thread Wolfgang Friedl
You are right, it is confusing :) After a while I found this in the documenation http://doc.akka.io/docs/akka-http/10.0.4/scala/http/common/http-model.html#http-model, but for me it does not make sense that valid Content-Types are filtered-away and "customized" Content-Types show up. If this

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

2017-03-20 Thread Alan Burlison
On 20 March 2017 at 15:57, 'Johannes Rudolph' via Akka User List wrote: > The only place where it would matter is if you complete a route from a place > where not the whole path is expected to be matched, i.e. there's still > something left in `ctx.unmatchedPath`. Is

[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

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

2017-03-20 Thread Alan Burlison
> I don't think a directive is the right way to do this, it needs to be > added to the existing PathMatcher DSL so it can be used with the path > and pathPrefix directives, and I'm not sure of how to do that. This seems to work: def seg(segment: String) = new PathMatcher[Unit] { def

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

2017-03-20 Thread Alan Burlison
On 18 March 2017 at 01:16, Daniel Stoner wrote: > I guess you have to remember that Akka-HTTP originates from Spray - and so > those choices were likely already made. (I'm sure there is a fully plausible > performance threading reason that is beyond me too hehe). Yes, I

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

2017-03-17 Thread Daniel Stoner
I guess you have to remember that Akka-HTTP originates from Spray - and so those choices were likely already made. (I'm sure there is a fully plausible performance threading reason that is beyond me too hehe). Well I know how i'd do nesting in Java at least if its any help. Implementing a

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

2017-03-17 Thread Alan Burlison
On 17/03/2017 21:25, Daniel Stoner wrote: What I wanted to do - was nest paths inside of each other thinking: path("v1") { path("orders") {whatever} path("customers") {whatever} } Yes, exactly so. In practice it appears that it works more as though each nested path does not operate on the

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

2017-03-17 Thread Alan Burlison
> I actually think it might be a bug - I'm in the middle of trying to figure > out exactly where PathMatcher.scala, line 145: def apply[L: Tuple](prefix: Path, extractions: L): PathMatcher[L] = if (prefix.isEmpty) provide(extractions) else new PathMatcher[L] { def apply(path: Path) =

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

2017-03-17 Thread Alan Burlison
On 17/03/2017 12:12, Akka Team wrote: Did you read the docs about the various path directives and how they differ? http://doc.akka.io/docs/akka-http/10.0.4/scala/http/routing-dsl/directives/path-directives/index.html Yes, over and over, because as I said I was sure I must be missing

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

2017-03-17 Thread Akka Team
Did you read the docs about the various path directives and how they differ? http://doc.akka.io/docs/akka-http/10.0.4/scala/http/routing-dsl/directives/path-directives/index.html -- Johan Akka Team On Fri, Mar 17, 2017 at 12:47 PM, Alan Burlison wrote: >

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

2017-03-17 Thread Alan Burlison
pathPrefix("root") { I can bodge around this with: pathPrefix("^root$".r) but that's unspeakably vile. -- Alan Burlison -- -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives:

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

2017-03-16 Thread Alan Burlison
On 15/03/2017 16:26, 'Johannes Rudolph' via Akka User List wrote: 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. That's exactly the case here -

[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: AKKA HTTP: Is this a valid use of Route.seal?

2017-03-08 Thread Alan Burlison
Anyone have any suggestions? Thanks! On 07/03/17 22:32, Alan Burlison wrote: I have an Akka HTTP route for a REST API that first checks the base path, then checks the user authentication is valid, adds some custom headers and extracts the base URI before processing the sub-routes. However if

Re: [akka-user] Re: Akka-Http 10.0.4 singleRequst ignoring "settings"?

2017-03-01 Thread Konrad Malawski
Sounds like a good improvement, please open a ticket (or submit a PR if you would like to, thanks in advance). -- Konrad `ktoso` Malawski Akka @ Lightbend On 1 March 2017 at 11:03:32, Stephen Couchman (sattailanf...@gmail.com) wrote: Well, I was able to

[akka-user] Re: Akka-Http 10.0.4 singleRequst ignoring "settings"?

2017-03-01 Thread Stephen Couchman
Well, I was able to resolve my problem but only by going to the application.conf file and setting it universally via akka.http.host-connection-pool.client.idle-timeout. I suspect there was another way, but the documentation on the many many variations of idle-timeout make it difficult to

[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: akka-http: randomly a client request does not hit the server side, no error messages

2017-02-20 Thread Elmar Weber
Hello Johannes, thanks, yes we will try that next. I have checked the changelogs and found next to connection pool also two others for SSL and TTL related items that can also be the source. https://github.com/akka/akka/issues/21760 https://github.com/akka/akka/issues/20690 Will update and

[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 web-socket Frame support question...

2017-02-01 Thread Jan Heise
I have to add that I just found support for automatic pong messages in https://github.com/akka/akka-http/blob/master/akka-http-core/src/main/scala/akka/http/impl/engine/ws/FrameHandler.scala Maybe somebody can give me a hint/help me with injecting control frames? -- >> Read the

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

2017-02-01 Thread Jan Heise
Hi, I'd like to add, that I'd also be interested in solving this. I'm currently developing a server-backend that should support ping/pong frames to conform to a specification that specifically references those control frames. I am not controlling the development of the clients so having an

Re: [akka-user] Re: akka-http route question

2016-12-22 Thread Muthu Jayakumar
Thank you Konrad. >f you care about efficiency please use the log.warning("[{}] with [{}]", req.uri, req.method.value) Oh. Nice!. Will start to use this pattern for logging. And this is a good reminder for me to finish up on Scala Days 2016 :). On Thursday, 22 December 2016 02:02:11 UTC-8,

Re: [akka-user] Re: akka-http route question

2016-12-22 Thread Konrad Malawski
Glad you found it. If you care about efficiency please use the log.warning("[{}] with [{}]", req.uri, req.method.value) style of logging, it does not needlessly allocate/build strings if a given log level is disabled. Also mentioned as one of my akka tips in the zen of akka talk:

[akka-user] Re: akka-http route question

2016-12-21 Thread Muthu Jayakumar
For anyone who wants to do something similar here is how i have done with akka-http 10. DebuggingDirectives.logRequestResult(LoggingMagnet(_ => clockHTTPTime(log))) private def clockHTTPTime(log: LoggingAdapter)(req: HttpRequest): (Any) => Unit = { def clockHTTPTimeInternal(log:

[akka-user] Re: Akka http create pathPrefix from a list

2016-12-12 Thread A. Nigredo
There is full code: pathPrefix(assetsUrl) { path(Segments) { folders => pathEndOrSingleSlash(getFromDirectory(assetsPath + "/" + folders.fold("")(_ + "/" + _))) } } ~ pathPrefix("")(getFromFile(frontendConfig.getString("indexPage"))) понедельник, 12 декабря 2016 г., 10:04:25 UTC+2

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

2016-11-10 Thread Julian Michael
Hi Johannes, Actually, I figured it out: embarrassingly, I had forgotten to import my private key into the Java keystore. Once I did that everything worked.. sorry to bother you! If only I had a type system that could have warned me about it ahead of time, ha ha.. Best, Julian On Thursday,

[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: Akka HTTP Source in a Graph

2016-10-27 Thread Rafał Krzewski
Hi Héctor, You should take a look at MergeHub [1]. You could then wrap each incoming message into a Source.single and send it through the hub into the intended consumer. Alternatively you could create a Source.actorPublisher, and pass the ActorRef produced by materialization of your flow to

Re: [akka-user] Re: Akka http vs Spray performance

2016-10-08 Thread Olga Gorun
I added scalatra (scalatra 2.4.1 on embedded jetty) to tests set. Two testing tools from three (ab and weighttp) give me approximately the same results for all three frameworks in ~70MB/s throughput when I test long static result. So it is similar to network bandwidth saturation. On the

Re: [akka-user] Re: Akka http vs Spray performance

2016-10-06 Thread Olga Gorun
For more information, I give here versions I test with. ubuntu 14.04, scala 2.11.8, oracle jdk 1.8 akka-http: 2.4.11 spray: 1.3.1 with akka 2.3.6 On Thursday, October 6, 2016 at 10:26:48 PM UTC+3, Olga Gorun wrote: > > Hi Christian. Thank you for response. I checked that equal Xms/Xmx both >

Re: [akka-user] Re: Akka http vs Spray performance

2016-10-06 Thread Olga Gorun
Hi Christian. Thank you for response. I checked that equal Xms/Xmx both set to more than enough memory (4GB while used heap is not more than 1.5GB during load test with or without explicitly defined memory) don't influence results. I'll try other JVM settings you propose. But generally

  1   2   3   4   >