[akka-user] Akka Streams: Question about mixing with Java IO streams

2015-09-08 Thread Sarah Gerweck
I'm a bit new to Akka Streams and hoping somebody could take a quick look at what I've done and tell me if there's a better way to do it. I've been working on a project where I have XML documents that I want to reformat as part of a project that uses Akka Streams & Akka HTTP. (These documents

Re: [akka-user] [akka-http] Extends TestServer to do dispatching

2015-09-08 Thread Akka Team
Hi Leon, It is definitely possible to flexibly organize your routing logic. In fact a route is nothing more than this: type Route = RequestContext ⇒ Future[RouteResult] Plus a DSL that gives various tools for composing routes in flexible ways. It does not change the fact though that a route

Re: [akka-user] Akka-http server occasionally pausing

2015-09-08 Thread Akka Team
Hi, >From your stacktrace it seems like you are trying to consume an entity's body (the stream of bytes) twice. > The stack trace does not point to any of my classes/namespace, rather show akka-stream classes.. This does not mean anything, since you might made your error when you wired up your

Re: [akka-user] AtLeastOnceDelivery strange redelivery after restart

2015-09-08 Thread Patrik Nordwall
That is a very good observation. You have found a bug! The scheduled redelivery starts while the recovery is still running, and therefore it starts re-sending messages that are confirmed (later during the recovery. Stupid bug that is easy to fix. I have created issue

Re: [akka-user] [akka-http] Connection stalls from a particular machine

2015-09-08 Thread Akka Team
Hi Nick, On Sat, Aug 29, 2015 at 9:05 PM, Nick Stanchenko wrote: > Hi, > > I am using akka-http 1.0 to serve a simple website. My father (who is in > another country, which complicates debugging this) discovered that when he > accesses a certain page on that site, it

Re: [akka-user] [akka-http] Connection stalls from a particular machine

2015-09-08 Thread Nick Stanchenko
Hi Endre and Victor, Thanks for getting back to me. I did understand that something was not consumed, however I am not quite sure how this could be on my side. I am not parsing/reading/consuming the entity directly. For that page I only used the following directives: getFromResourceDirectory,

Re: [akka-user] [akka-http] Need help overriding Content-Type; getting error "Resource representation is only available with these Content-Types: application/json"

2015-09-08 Thread Akka Team
Hi Matthew, I don't know what is wrong with this code, so you should probably file a bug. I would first recommend though to simplify the reproducer as much as you can (i.e. remove generalization/abstraction). -Endre On Fri, Sep 4, 2015 at 6:43 PM, Matthew Adams wrote:

Re: [akka-user] Creating a reconnecting TCP client

2015-09-08 Thread Akka Team
Hi Adam, This is not a trivial task to be honest, and I cannot really give you a nice way to use it. The difference from Rx Observables is that RS implements explicit backpressure (i.e. instead of blocking it uses explicit asynchronous signals) and therefore makes all processing stage inherently

Re: [akka-user] [akka-http] Connection stalls from a particular machine

2015-09-08 Thread Nick Stanchenko
Sure, I will try to do it this weekend. On Tuesday, September 8, 2015 at 12:38:35 PM UTC+1, Akka Team wrote: > > Hi Nick, > > I think the best would be if you just put together some small code (one > compact scala file if possible) that reproduces the issue. That would make > it easier for us

Re: [akka-user] akka-streams: wrap blocking iterator when creating a Source

2015-09-08 Thread Akka Team
Hi Alexander, On Sat, Sep 5, 2015 at 7:28 PM, Alexander Semenov wrote: > Hello dear community. > > Is it okay to wrap a blocking iterator when creating a Source? I have a > blocking API, which I want to hide behind the Source. Here is an example (I > suspect I might need

Re: [akka-user] [akka-http] Connection stalls from a particular machine

2015-09-08 Thread Akka Team
Hi Nick, I think the best would be if you just put together some small code (one compact scala file if possible) that reproduces the issue. That would make it easier for us to figure out what is wrong. It might be a bug, but I don't know for sure. -Endre On Tue, Sep 8, 2015 at 12:16 PM, Nick

Re: [akka-user] [akka-http] Connection stalls from a particular machine

2015-09-08 Thread Viktor Klang
I suspect this will trip a lot of people up, if anyone has any suggestions on how it could be improved, please speak up :) On Tue, Sep 8, 2015 at 12:02 PM, Akka Team wrote: > Hi Nick, > > > > On Sat, Aug 29, 2015 at 9:05 PM, Nick Stanchenko >

Re: [akka-user] Akka Cluster Autodiscovery

2015-09-08 Thread Akka Team
Hi Geoff, Akka does not have an autodiscovery feature, but you can implement such a service yourself as Akka Clustering allows for programmatic joining, where you can pass an arbitrary list of nodes as argument: "You may also use Cluster(system).joinSeedNodes to join programmatically, which is

Re: [akka-user] akka-streams: wrap blocking iterator when creating a Source

2015-09-08 Thread Viktor Klang
It is also possible to use s.c.blocking {} On Tue, Sep 8, 2015 at 12:52 PM, Akka Team wrote: > Hi Alexander, > > > On Sat, Sep 5, 2015 at 7:28 PM, Alexander Semenov > wrote: > >> Hello dear community. >> >> Is it okay to wrap a blocking iterator

Re: [akka-user] Proxy request

2015-09-08 Thread Akka Team
Hi Evans, > I keep getting "akka.http.scaladsl.model.EntityStreamException: Illegal > chunk termination" and can't think what the issue is. Does anyone have any > ideas please? > What is the full stack trace? Where do you get this exception? On the client side, on server one, or server two? I

Re: [akka-user] Re: system.scheduler.scheduleOnce consumes Heap over time

2015-09-08 Thread Akka Team
Hi Salvatore, So far, there has been no proof of a memory leak in the Akka Scheduler. That code has not been touched since 2013, and is used by many in production since version 2.2.0. While the lack of evidence is not evidence of lack, I would like to see a convincing reproducer and data to

Re: [akka-user] Akka Streams handling tcp request with dynamic response

2015-09-08 Thread Akka Team
Hi Pawel, Instead of Iterable and mapConcat you can use map, and flatten(FlattenStrategy.concat). For example: inputs.map { in => sourceFor(in) }.flatten(FlattenStrategy.concat) I have written some TCP examples for an older ML thread, they might help to give you some inspiration:

Re: [akka-user] Re: Debug message- Cancelling akka.stream.impl.MultiStreamOutputProcessor (after: 5000 ms)

2015-09-08 Thread Akka Team
Hi Richard, Can you please assemble together a simple reproducer (preferably one scala file with no external dependencies except Akka) that we can use to look into your problem, and also file an issue here: https://github.com/akka/akka/issues Thanks, -Endre On Sun, Sep 6, 2015 at 10:38 AM,

Re: [akka-user] Akka Streams handling tcp request with dynamic response

2015-09-08 Thread paweł kamiński
thanks I ll check this out! I ve somehow overlooked it in documentation On Tuesday, 8 September 2015 13:27:11 UTC+2, Akka Team wrote: > > Hi Pawel, > > Instead of Iterable and mapConcat you can use map, and > flatten(FlattenStrategy.concat). > > For example: > > inputs.map { in =>

[akka-user] [akka-http] Where did Spray's anyParams go?

2015-09-08 Thread Matthew Adams
I see formFields & parameters, but nothing that gets them from wherever. Missing by design? -matthew -- >> 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] Creating a reconnecting TCP client

2015-09-08 Thread אדם חונן
I'm OK with lost data - I assume messages can be lost anyway, even without disconnection, so the API I want to provide will not guarantee message delivery and users will be aware of that, and that they are actually sending asynchronous messages. I was also thinking that a possible alternative

[akka-user] [akka-stream][java] How to add type to a List in Flow.of(List.class)?

2015-09-08 Thread Jeroen Kransen
I'm struggling again with the types in Java. I want to group elements in a Flow, and call a processing step like this: final Flow saveOrganisatiesFlow = Flow.of(List.class).mapAsync(4, new Function() { @Override public

[akka-user] Re: [akka-stream][java] How to add type to a List in Flow.of(List.class)?

2015-09-08 Thread Jeroen Kransen
Double casting seems to do the trick: @SuppressWarnings("unchecked") Class cls = (Class) (Object) List.class; Op dinsdag 8 september 2015 16:06:17 UTC+2 schreef Jeroen Kransen: > > I'm struggling again with the types in Java. I want to group elements in a > Flow,

[akka-user] Serialization issues at receptionist in akka cluster

2015-09-08 Thread Vaibhav Raj
Hi, I am building an application which uses akka cluster pub-sub and cluster client. I am initialising receptionist at every node in the cluster. There are some other node which are not part of the cluster which are communicating with cluster nodes through cluster client. I am initialising

[akka-user] Help to understand Cluster Aware Routes

2015-09-08 Thread matheuslima
Hello, I'm developing an Cluster with two node types, dispatchers and workers. I want use worker nodes in a pool configuration but I have some questions. 1 - The dispatcher nodes always need subscribe to Cluster Member Events to detect new worker nodes? Or is there another way to define how

Re: [akka-user] [akka-http] Need help overriding Content-Type; getting error "Resource representation is only available with these Content-Types: application/json"

2015-09-08 Thread Matthew Adams
Ok, so this is interesting. In an effort to reduce the amount of code demonstrating the bug, I ran the following (where I'm passing in a custom header X-REPRO-BUG) and everything worked. I'll show the curl invocation first, then the code will follow. What I don't understand is why the code I

Re: [akka-user] [akka-http] Need help overriding Content-Type; getting error "Resource representation is only available with these Content-Types: application/json"

2015-09-08 Thread Matthew Adams
...and even more interesting results. If I add an Accept header to the reduced code, responses like this take place. $ curl -i -H 'X-REPRO-BUG: xml' -H '*Accept: application/json*' http://localhost:8080/ping HTTP/1.1 406 Not Acceptable Server: akka-http/2.3.12 Date: Tue, 08 Sep 2015 15:03:44

Re: [akka-user] [akka-http] Need help overriding Content-Type; getting error "Resource representation is only available with these Content-Types: application/json"

2015-09-08 Thread Matthew Adams
FYI: https://github.com/akka/akka/issues/18425 On Tuesday, September 8, 2015 at 5:42:56 AM UTC-5, Akka Team wrote: > > Hi Matthew, > > I don't know what is wrong with this code, so you should probably file a > bug. I would first recommend though to simplify the reproducer as much as > you can

Re: [akka-user] Akka Http routes in an actor

2015-09-08 Thread Heiko Seeberger
> On 08 Sep 2015, at 15:46, Richard Rodseth wrote: > > The original inspiration was the Net-a-Porter article and template > https://github.com/NET-A-PORTER/spray-actor-per-request#master > >

Re: [akka-user] Akka-http server occasionally pausing

2015-09-08 Thread IR
Thanks for your response, Endre. It could very well be that I'm incorrectly using the framework. Here's a snippet of my code. The variable 'stream' below is of type Source[ByteString, _] var s3Pool = Http().cachedHostConnectionPool[String](host, port) Source.single(HttpRequest(HttpMethods.PUT,

[akka-user] Unable to compile project using Akka-HTTP client V1.0

2015-09-08 Thread Richard Grossman
Hi I'm confronted to this problem : I'm using this dependencies: akka-http-experimental_2.11 V1.0 latest release My code is pretty simple as exactly like the sample on the documentation class HttpFlow(implicit system: ActorSystem, actorMaterializer: ActorMaterializer) { protected implicit

Re: [akka-user] Akka Http routes in an actor

2015-09-08 Thread Richard Rodseth
The original inspiration was the Net-a-Porter article and template https://github.com/NET-A-PORTER/spray-actor-per-request#master http://techblog.net-a-porter.com/2013/12/ask-tell-and-per-request-actors/ At the time we had a lot of timeout issues. Perhaps these were mostly backpressure-related

[akka-user] Akka: Remoting through load balancers

2015-09-08 Thread Ashesh Ambasta
Hi guys, We're a young startup and we decided to stick with Akka for our production deployments. But we recently ran into a minefield of problems trying to set up our Akka applications on our new Mesosphere cluster

[akka-user] Re: Akka: Remoting through load balancers

2015-09-08 Thread Ashesh Ambasta
How do you configure Akka not to drop messages? On Tuesday, 8 September 2015 19:04:27 UTC+2, Ashesh Ambasta wrote: > > Hi guys, > > We're a young startup and we decided to stick with Akka for our production > deployments. But we recently ran into a minefield of problems >