Re: [akka-user] How-to restart a RunnableGraph on failure?

2016-03-21 Thread john . vieten
Hi Endre,
forgive my wording. I meant calling shutdown() on the materializer of the 
current exception-throwing stream  and then start this  stream with a new 
materializer

Am Montag, 21. März 2016 16:51:01 UTC+1 schrieb Akka Team:
>
>
>
> On Mon, Mar 21, 2016 at 4:45 PM, > wrote:
>
>> Hi Endre, 
>> I think  I do have a valid use case. I have a stream which occasionally 
>> fails seriously (maybe 2 times a year) . 
>> Since it has a zip stage I have the option to either handle the Exception 
>> and keep the Zip stage balanced or
>> just let the exception propagate to the default decider and just restart 
>> the stream. 
>>
>
> But there is no such thing as "restart the stream". The current built-in 
> "supervision" only restarts a single stream processing stage but not the 
> whole graph. There is currently no way to restart a whole graph and it is 
> not a trivial problem to tackle in general.
>
> -Endre
>  
>
>> The  work of the stream is "transactional" so I have no problems with the 
>> current broken state caused by the exception.
>>
>> For me restart simplifies my code so I think It is ok?!
>>
>> Am Montag, 21. März 2016 10:35:58 UTC+1 schrieb Akka Team:
>>>
>>> Hi John,
>>>
>>> I am not sure what you hope to achieve there and if that even possible. 
>>> Restarting a graph is more similar to restarting a group of actors not to a 
>>> single actor and it is not that easy to do given the backpressure state 
>>> between the restarted stages must be preserved. Also, while one stage 
>>> fails, other parts of the graph might not and still run concurrently, etc. 
>>>
>>> -Endre
>>>
>>> On Fri, Mar 18, 2016 at 1:34 PM,  wrote:
>>>
 This would be the solution I would use:

 http://pastebin.com/pJVnHqcH

 I am a little unsure about mat.stop() and the Supervision.stop().

 Should the code work? I want to restart on every Exception thrown from 
 any Flow,Source,Sink of the Runnable graph 

 Am Freitag, 18. März 2016 11:28:23 UTC+1 schrieb drewhk:
>
> Hi,
>
> There is no such thing at the moment.
>
> The onComplete on the sink does not guarantee that the whole stream 
> has actually stopped, it only guarantees that the Sink itself was stopped 
> (which may or may not imply completion of the whole stream; think of 
> graphs).
>
> -Endre
>
> On Fri, Mar 18, 2016 at 11:25 AM,  wrote:
>
>> Hi,
>> If a graph throws an Exception in any flow  I want  to restart the 
>> graph.
>>
>> Actually I would love to have something like Akka Actors  
>> OneForOneStrategy(10, Duration.create("1 minute"))
>>
>> I couldn't find the right hints in the docs. What I am trying right 
>> now is this pseudo code:
>>
>> Function decider = exc -> 
>> Supervision.stop();
>> Sink sink = ;
>>
>> RunnableGraph> runnableGraph = takeGraph.toMat(sink, 
>> Keep.right());
>>
>> ActorMaterializer mat = 
>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>>  system);
>>
>> runnableGraph.run(mat).onComplete(new OnComplete() {
>>public void onComplete(Throwable failure, Integer value) {
>>   ActorMaterializer mat2 = 
>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>>  system);
>>   runnableGraph.run(mat2);
>>}
>> }, system.dispatcher());
>>
>> Obviously the above code would only restart once...
>> Anyway is this the right direction?
>> Is there an idiomatic way to setup restart of an Runablegraph when a 
>> Exception happens
>>
>> Write now I am thinking of creating a Supervision Actor and use it to 
>> init and restart the Runablegraph
>>
>> Many Greetings
>> John
>>
>>
>>
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: 
>> https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to akka-user+...@googlegroups.com.
>> To post to this group, send email to akka...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> -- 
 >> Read the docs: http://akka.io/docs/
 >> Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
 >> Search the archives: 
 https://groups.google.com/group/akka-user
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Akka User List" group.
 To unsubscribe f

Re: [akka-user] How-to restart a RunnableGraph on failure?

2016-03-21 Thread john . vieten
Hi Endre, 
I think  I do have a valid use case. I have a stream which occasionally 
fails seriously (maybe 2 times a year) . 
Since it has a zip stage I have the option to either handle the Exception 
and keep the Zip stage balanced or
just let the exception propagate to the default decider and just restart 
the stream. 
The  work of the stream is "transactional" so I have no problems with the 
current broken state caused by the exception.

For me restart simplifies my code so I think It is ok?!

Am Montag, 21. März 2016 10:35:58 UTC+1 schrieb Akka Team:
>
> Hi John,
>
> I am not sure what you hope to achieve there and if that even possible. 
> Restarting a graph is more similar to restarting a group of actors not to a 
> single actor and it is not that easy to do given the backpressure state 
> between the restarted stages must be preserved. Also, while one stage 
> fails, other parts of the graph might not and still run concurrently, etc. 
>
> -Endre
>
> On Fri, Mar 18, 2016 at 1:34 PM, > wrote:
>
>> This would be the solution I would use:
>>
>> http://pastebin.com/pJVnHqcH
>>
>> I am a little unsure about mat.stop() and the Supervision.stop().
>>
>> Should the code work? I want to restart on every Exception thrown from 
>> any Flow,Source,Sink of the Runnable graph 
>>
>> Am Freitag, 18. März 2016 11:28:23 UTC+1 schrieb drewhk:
>>>
>>> Hi,
>>>
>>> There is no such thing at the moment.
>>>
>>> The onComplete on the sink does not guarantee that the whole stream has 
>>> actually stopped, it only guarantees that the Sink itself was stopped 
>>> (which may or may not imply completion of the whole stream; think of 
>>> graphs).
>>>
>>> -Endre
>>>
>>> On Fri, Mar 18, 2016 at 11:25 AM,  wrote:
>>>
 Hi,
 If a graph throws an Exception in any flow  I want  to restart the 
 graph.

 Actually I would love to have something like Akka Actors  
 OneForOneStrategy(10, Duration.create("1 minute"))

 I couldn't find the right hints in the docs. What I am trying right now 
 is this pseudo code:

 Function decider = exc -> 
 Supervision.stop();
 Sink sink = ;

 RunnableGraph> runnableGraph = takeGraph.toMat(sink, 
 Keep.right());

 ActorMaterializer mat = 
 ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
  system);

 runnableGraph.run(mat).onComplete(new OnComplete() {
public void onComplete(Throwable failure, Integer value) {
   ActorMaterializer mat2 = 
 ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
  system);
   runnableGraph.run(mat2);
}
 }, system.dispatcher());

 Obviously the above code would only restart once...
 Anyway is this the right direction?
 Is there an idiomatic way to setup restart of an Runablegraph when a 
 Exception happens

 Write now I am thinking of creating a Supervision Actor and use it to init 
 and restart the Runablegraph

 Many Greetings
 John



 -- 
 >> Read the docs: http://akka.io/docs/
 >> Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
 >> Search the archives: 
 https://groups.google.com/group/akka-user
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Akka User List" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to akka-user+...@googlegroups.com.
 To post to this group, send email to akka...@googlegroups.com.
 Visit this group at https://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Akka Team
> Typesafe - Reactive apps on the JVM
> Blog: letitcrash.com
> Twitter: @akkateam
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email

[akka-user] Re: Can this be done with the build in stages?

2016-03-20 Thread john . vieten
I came up with this code:

http://pastebin.com/LNTCvebe

But beware  until now I have only be using akka with java. It is my first 
try on using scala!

As a side note : I could not figure out how to match an non-empty list in 
receive?

Many Greetings
John
 


Am Sonntag, 20. März 2016 14:31:51 UTC+1 schrieb john@gmail.com:
>
> val input  = Source(List(List(1, 2, 3), List(1, 2, 3), List(), 
> List(),List(),List(),List(1, 2, 3))
>
>
> 1) Process input. for example input.via(throttleFlow).mapConcat(t => t)
>
> where throttleFlow show do the *following:*
>
>
> 2) If element of source has size > 0 pass it immediately  downstream.
>
> 3) Or if element of source has size == 0 wait 10 secs
>
>
> Can this be done with the build in stages?
>
>
>  

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Can this be done with the build in stages?

2016-03-20 Thread john . vieten
Something very simple which come to my mind is  to mapAsync to the ask 
pattern and then do a "schedule of 10 secs" if the element is an empty list.



Am Sonntag, 20. März 2016 14:31:51 UTC+1 schrieb john@gmail.com:
>
> val input  = Source(List(List(1, 2, 3), List(1, 2, 3), List(), 
> List(),List(),List(),List(1, 2, 3))
>
>
> 1) Process input. for example input.via(throttleFlow).mapConcat(t => t)
>
> where throttleFlow show do the *following:*
>
>
> 2) If element of source has size > 0 pass it immediately  downstream.
>
> 3) Or if element of source has size == 0 wait 10 secs
>
>
> Can this be done with the build in stages?
>
>
>  

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Can this be done with the build in stages?

2016-03-20 Thread john . vieten


val input  = Source(List(List(1, 2, 3), List(1, 2, 3), List(), 
List(),List(),List(),List(1, 2, 3))


1) Process input. for example input.via(throttleFlow).mapConcat(t => t)

where throttleFlow show do the *following:*


2) If element of source has size > 0 pass it immediately  downstream.

3) Or if element of source has size == 0 wait 10 secs


Can this be done with the build in stages?


  

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Restart does not work with my zipper? What am I doing wrong?

2016-03-20 Thread john . vieten
I guess that I am suffering from deadlock? this post semms to apply to my 
problem 
http://blog.lancearlaus.com/akka/streams/scala/2015/05/27/Akka-Streams-Balancing-Buffer/

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How-to restart a RunnableGraph on failure?

2016-03-20 Thread john . vieten
This would be the solution I would use:

http://pastebin.com/pJVnHqcH

I am a little unsure about mat.stop() and the Supervision.stop().

Should the code work? I want to restart on every Exception thrown from any 
Flow,Source,Sink of the Runnable graph 

Am Freitag, 18. März 2016 11:28:23 UTC+1 schrieb drewhk:
>
> Hi,
>
> There is no such thing at the moment.
>
> The onComplete on the sink does not guarantee that the whole stream has 
> actually stopped, it only guarantees that the Sink itself was stopped 
> (which may or may not imply completion of the whole stream; think of 
> graphs).
>
> -Endre
>
> On Fri, Mar 18, 2016 at 11:25 AM, > 
> wrote:
>
>> Hi,
>> If a graph throws an Exception in any flow  I want  to restart the graph.
>>
>> Actually I would love to have something like Akka Actors  
>> OneForOneStrategy(10, Duration.create("1 minute"))
>>
>> I couldn't find the right hints in the docs. What I am trying right now 
>> is this pseudo code:
>>
>> Function decider = exc -> 
>> Supervision.stop();
>> Sink sink = ;
>>
>> RunnableGraph> runnableGraph = takeGraph.toMat(sink, 
>> Keep.right());
>>
>> ActorMaterializer mat = 
>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>>  system);
>>
>> runnableGraph.run(mat).onComplete(new OnComplete() {
>>public void onComplete(Throwable failure, Integer value) {
>>   ActorMaterializer mat2 = 
>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>>  system);
>>   runnableGraph.run(mat2);
>>}
>> }, system.dispatcher());
>>
>> Obviously the above code would only restart once...
>> Anyway is this the right direction?
>> Is there an idiomatic way to setup restart of an Runablegraph when a 
>> Exception happens
>>
>> Write now I am thinking of creating a Supervision Actor and use it to init 
>> and restart the Runablegraph
>>
>> Many Greetings
>> John
>>
>>
>>
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Restart does not work with my zipper? What am I doing wrong?

2016-03-19 Thread john . vieten
hi roland, thanx that helps alot! And great that you still follow the list. 
Mang Greetings John

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Restart does not work with my zipper? What am I doing wrong?

2016-03-19 Thread john . vieten
I tried inserting a buffer but ist still doesn't work. Any other ideas? 

Am Donnerstag, 17. März 2016 18:58:33 UTC+1 schrieb john@gmail.com:
>
> I guess that I am suffering from deadlock? this post semms to apply to my 
> problem 
> http://blog.lancearlaus.com/akka/streams/scala/2015/05/27/Akka-Streams-Balancing-Buffer/

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Restart does not work with my zipper? What am I doing wrong?

2016-03-19 Thread john . vieten
Hi,
I am using SupervisionStrategy restart. If I add a Zipper to the graph 
"restart" doesn't work.

What am I doing wrong?
The code is here: http://pastebin.com/8L6LBZ5R

I am just throwing a Exception on the count of 2. I would expect that 
"continue doing work" gets printed to system.out 4 times.

Many Greetings
John

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] akka.stream.scaladsl.One2OneBidiFlow$OutputTruncationException$: null exception

2016-03-19 Thread john . vieten
I am getting occasional the above exception. Unfortunately without a 
stackstrace.
It is also difficult for me to reproduce the problem so I am just fishing 
for ideas or hints?

The error happens when processing a stream with a Flow using  Http.get(
actorSystem).superPool(materializer);
I am using akka-stream-experimental_2.11 Version 2.0.2


Many Greetings
John

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How-to restart a RunnableGraph on failure?

2016-03-18 Thread john . vieten
Hi,
If a graph throws an Exception in any flow  I want  to restart the graph.

Actually I would love to have something like Akka Actors  OneForOneStrategy(
10, Duration.create("1 minute"))

I couldn't find the right hints in the docs. What I am trying right now is 
this pseudo code:

Function decider = exc -> Supervision.stop();
Sink sink = ;

RunnableGraph> runnableGraph = takeGraph.toMat(sink, 
Keep.right());

ActorMaterializer mat = 
ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
 system);

runnableGraph.run(mat).onComplete(new OnComplete() {
   public void onComplete(Throwable failure, Integer value) {
  ActorMaterializer mat2 = 
ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
 system);
  runnableGraph.run(mat2);
   }
}, system.dispatcher());

Obviously the above code would only restart once...
Anyway is this the right direction?
Is there an idiomatic way to setup restart of an Runablegraph when a Exception 
happens

Write now I am thinking of creating a Supervision Actor and use it to init and 
restart the Runablegraph

Many Greetings
John



-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Restart does not work with my zipper? What am I doing wrong?

2016-03-18 Thread john . vieten
Thinking about it maybe this is the expected behaviour and I need to work 
with recover?

Am Donnerstag, 17. März 2016 15:12:10 UTC+1 schrieb john@gmail.com:
>
> Hi,
> I am using SupervisionStrategy restart. If I add a Zipper to the graph 
> "restart" doesn't work.
>
> What am I doing wrong?
> The code is here: http://pastebin.com/8L6LBZ5R
>
> I am just throwing a Exception on the count of 2. I would expect that 
> "continue doing work" gets printed to system.out 4 times.
>
> Many Greetings
> John
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] akka.stream.scaladsl.One2OneBidiFlow$OutputTruncationException$: null exception

2016-03-18 Thread john . vieten
i'll try to upgrade. but it is alot of work. i need to replace lots of futures

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Am I misunderstanding throttle?

2016-03-03 Thread john . vieten
Could this be a aka-streams bug? Should I open a git bug? 
In-between I am using my own  inferior throttle so I have a workaround


final static class Tick {}
public static  Flow createFlow(final long throttleSecs) {
Flow sourceflow =  Flow.create();
   
Flow, BoxedUnit> flow = Flow.fromGraph(
 GraphDSL.create(builder -> {
final FlowShape source = builder.add(sourceflow);
Source tickSource = 
Source.tick(FiniteDuration.apply(0, "millis"), 
FiniteDuration.apply(throttleSecs, "millis"), new Tick());
final FanInShape2> zipper = 
builder.add(Zip.create());
SourceShape tickSourceShape = builder.add(tickSource);

builder.from(source).toInlet(zipper.in0());
builder.from(tickSourceShape).toInlet(zipper.in1());
return FlowShape.of(source.in(), zipper.out());
 }));
   return flow.map(Pair::first);


Am Mittwoch, 2. März 2016 15:12:00 UTC+1 schrieb john@gmail.com:
>
>
> Hi Endre,
> many thanks for wanting to help me!!
>
> If you run the code you will see that only "success : Pipeline 2"  gets 
> outputted to System.out.
>
> If I remove the Throttle everything works as expected.
>
> //Source pipeline = source.via(throttle).mapConcat(t -> 
> t); 
> Source pipeline = source.mapConcat(t -> t);
>
>
> Am I doing anything wrong or stupid?
>
> here is the code again:
>
> package  test
>
>
>
> import akka.actor.ActorSystem;
> import akka.dispatch.Futures;
> import akka.japi.function.Function;
> import akka.stream.ActorMaterializer;
> import akka.stream.ActorMaterializerSettings;
> import akka.stream.Materializer;
> import akka.stream.Supervision;
> import akka.stream.javadsl.Flow;
> import akka.stream.javadsl.Sink;
> import akka.stream.javadsl.Source;
> import scala.Option;
> import scala.Tuple2;
> import scala.concurrent.Promise;
> import scala.concurrent.duration.FiniteDuration;
> import scala.runtime.BoxedUnit;
>
> import java.util.ArrayList;
> import java.util.Collection;
>
>
> public class MailThrottleTest {
>static ActorSystem system = ActorSystem.create("TestThrotteling");
>
>public static void main(String[] args) throws Exception{
>   MailThrottleTest mailThrottleTest = new MailThrottleTest();
>   Source  pipe1= 
> mailThrottleTest.createPipeLine("Pipeline 1");
>   Source  pipe2= 
> mailThrottleTest.createPipeLine("Pipeline 2");
>
>
>   final Function decider = exc -> {
>  return Supervision.restart();
>   };
>   final Materializer mat1 = 
> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>  system);
>   final Materializer mat2 = 
> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>  system);
>   pipe1.to(Sink.foreach(object -> {
>  System.out.println("Got Object pipe 1 : "+object);
>   })).run(mat1);
>
>   pipe2.to(Sink.foreach(object -> {
>  System.out.println("Got Object pipe 2 : "+object);
>   })).run(mat2);
>   system.awaitTermination();
>}
>
>public  Source  createPipeLine(final String name) 
> throws Exception{
>
>
>   final Promise>>> promise = 
> Futures.promise();
>   Source, BoxedUnit> source = Source.unfoldAsync(null, 
> p -> {
>  System.out.println("success : "+name);
>  return promise.future();
>   });
>
>   Flow,Collection,BoxedUnit> throttle =
> Flow.>create().throttle(1, 
> FiniteDuration.apply(2000, "millis"),1,
>   new akka.stream.ThrottleMode.Shaping$());
>
>   Source pipeline = source.via(throttle).mapConcat(t 
> -> t);
>
>   promise.success(Option.apply(new Tuple2(null, new ArrayList(;
>   return pipeline;
>
>}
>
>
> }
>
>
>
>
>
>
>
>
>
> Am Mittwoch, 2. März 2016 13:43:21 UTC+1 schrieb drewhk:
>>
>> Hi John,
>>
>> Can you prepare a small reproducer? It might be a bug, but we can only be 
>> sure if we see some code that exhibits the behavior.
>>
>> -Endre
>>
>> On Wed, Mar 2, 2016 at 1:40 PM,  wrote:
>>
>>> I am running up several instances of the an akka streams pipeline.
>>>
>>> In the pipeline there is a throttle stage (Flow.create.throttle(..))
>>> Now what is happing is that only the first pipeline works. The other 
>>> pipelines all stall.
>>> Any Ideas?
>>> Many Greetings
>>> John
>>>
>>> -- 
>>> >> Read the docs: http://akka.io/docs/
>>> >> Check the FAQ: 
>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>> >> Search the archives: 
>>> https://groups.google.com/group/akka-user
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Akka User List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to akka-user+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/akka-user.
>>> For more options, visit https://grou

Re: [akka-user] Am I misunderstanding throttle?

2016-03-02 Thread john . vieten

Hi Endre,
many thanks for wanting to help me!!

If you run the code you will see that only "success : Pipeline 2"  gets 
outputted to System.out.

If I remove the Throttle everything works as expected.

//Source pipeline = source.via(throttle).mapConcat(t -> t); 
Source pipeline = source.mapConcat(t -> t);


Am I doing anything wrong or stupid?

here is the code again:

package  test



import akka.actor.ActorSystem;
import akka.dispatch.Futures;
import akka.japi.function.Function;
import akka.stream.ActorMaterializer;
import akka.stream.ActorMaterializerSettings;
import akka.stream.Materializer;
import akka.stream.Supervision;
import akka.stream.javadsl.Flow;
import akka.stream.javadsl.Sink;
import akka.stream.javadsl.Source;
import scala.Option;
import scala.Tuple2;
import scala.concurrent.Promise;
import scala.concurrent.duration.FiniteDuration;
import scala.runtime.BoxedUnit;

import java.util.ArrayList;
import java.util.Collection;


public class MailThrottleTest {
   static ActorSystem system = ActorSystem.create("TestThrotteling");

   public static void main(String[] args) throws Exception{
  MailThrottleTest mailThrottleTest = new MailThrottleTest();
  Source  pipe1= 
mailThrottleTest.createPipeLine("Pipeline 1");
  Source  pipe2= 
mailThrottleTest.createPipeLine("Pipeline 2");


  final Function decider = exc -> {
 return Supervision.restart();
  };
  final Materializer mat1 = 
ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
 system);
  final Materializer mat2 = 
ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
 system);
  pipe1.to(Sink.foreach(object -> {
 System.out.println("Got Object pipe 1 : "+object);
  })).run(mat1);

  pipe2.to(Sink.foreach(object -> {
 System.out.println("Got Object pipe 2 : "+object);
  })).run(mat2);
  system.awaitTermination();
   }

   public  Source  createPipeLine(final String name) throws 
Exception{


  final Promise>>> promise = 
Futures.promise();
  Source, BoxedUnit> source = Source.unfoldAsync(null, p 
-> {
 System.out.println("success : "+name);
 return promise.future();
  });

  Flow,Collection,BoxedUnit> throttle =
Flow.>create().throttle(1, 
FiniteDuration.apply(2000, "millis"),1,
  new akka.stream.ThrottleMode.Shaping$());

  Source pipeline = source.via(throttle).mapConcat(t -> 
t);

  promise.success(Option.apply(new Tuple2(null, new ArrayList(;
  return pipeline;

   }


}









Am Mittwoch, 2. März 2016 13:43:21 UTC+1 schrieb drewhk:
>
> Hi John,
>
> Can you prepare a small reproducer? It might be a bug, but we can only be 
> sure if we see some code that exhibits the behavior.
>
> -Endre
>
> On Wed, Mar 2, 2016 at 1:40 PM, > wrote:
>
>> I am running up several instances of the an akka streams pipeline.
>>
>> In the pipeline there is a throttle stage (Flow.create.throttle(..))
>> Now what is happing is that only the first pipeline works. The other 
>> pipelines all stall.
>> Any Ideas?
>> Many Greetings
>> John
>>
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
package test.throttle;

import akka.actor.ActorSystem;
import akka.dispatch.Futures;
import akka.japi.function.Function;
import akka.stream.ActorMaterializer;
import akka.stream.ActorMaterializerSettings;
import akka.stream.Materializer;
import akka.stream.Supervision;
import akka.stream.javadsl.Flow;
import akka.stream.javadsl.Sink;
import akka.stream.javadsl.Source;
import scala.Option;
import scala.Tuple2;
import scala.concurrent.Promise;
import scala.concurrent.duration.FiniteDuration;
import 

[akka-user] Am I misunderstanding throttle?

2016-03-02 Thread john . vieten


I am running up several instances of the an akka streams pipeline.

In the pipeline there is a throttle stage (Flow.create.throttle(..))
Now what is happing is that only the first pipeline works. The other pipelines 
all stall.
Any Ideas?
Many Greetings
John

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: Does each ActorMaterializer need its own ActorSystem?

2016-03-02 Thread john . vieten
sorry I hitted the send button too early. its just meant as pesudo code.
I was wondering if each 

 ActorMaterializer needs its own ActorSystem ? Or can one ActorSystem be used 
for many  Materializers?


Am Mittwoch, 2. März 2016 10:17:32 UTC+1 schrieb √:
>
> I don't understand the question. And looking at the code I don't think it 
> would compile.
>
> On Wed, Mar 2, 2016 at 10:15 AM, > wrote:
>
>> system = ActorSystem.create();
>>
>> new Array[]{"a","b"}.stream()
>>   .forEach {
>> final Materializer m = 
>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>>  system);
>> pipeLine.to(Sink.foreach(..).run(m);
>> }
>> }
>>
>>
>> Now only the last pipeline in the loop works?
>> So I am concluding that each 
>>
>> Materializer needs its own actorSystem
>>
>>
>>
>> Am Mittwoch, 2. März 2016 10:12:23 UTC+1 schrieb john@gmail.com:
>>>
>>> I have the following code
>>>
>>>  
>>
>>> new Array[]{"a","b"}.stream()
>>>   .forEach {
>>> }
>>> }
>>>
>>>
>>>
>>>
>>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Cheers,
> √
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Does each ActorMaterializer need its own ActorSystem?

2016-03-02 Thread john . vieten


system = ActorSystem.create();

new Array[]{"a","b"}.stream()
  .forEach {
final Materializer m = 
ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
 system);
pipeLine.to(Sink.foreach(..).run(m);
}
}


Now only the last pipeline in the loop works?
So I am concluding that each 

Materializer needs its own actorSystem



Am Mittwoch, 2. März 2016 10:12:23 UTC+1 schrieb john@gmail.com:
>
> I have the following code
>
>  

> new Array[]{"a","b"}.stream()
>   .forEach {
> }
> }
>
>
>
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Does each ActorMaterializer need its own ActorSystem?

2016-03-02 Thread john . vieten
I have the following code

new Array[]{"a","b"}.stream()
  .forEach {
}
}




-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: How to keep a Source alive

2016-02-10 Thread john . vieten
thanks Endre and Victor.
my code is much much cleaner now  actually just 8 java lines and a 
Throttler:
I was just wondering: I had to code my own throttler or is there any in 
core?

final static class Tick {}
public static  Flow createFlow(final long throttleSecs) {
Flow sourceflow =  Flow.create();
   
Flow, BoxedUnit> flow = Flow.fromGraph(
 GraphDSL.create(builder -> {
final FlowShape source = builder.add(sourceflow);
Source tickSource = 
Source.tick(FiniteDuration.apply(0, "millis"), 
FiniteDuration.apply(throttleSecs, "millis"), new Tick());
final FanInShape2> zipper = 
builder.add(Zip.create());
SourceShape tickSourceShape = builder.add(tickSource);

builder.from(source).toInlet(zipper.in0());
builder.from(tickSourceShape).toInlet(zipper.in1());
return FlowShape.of(source.in(), zipper.out());
 }));
   return flow.map(Pair::first);
}




Am Montag, 8. Februar 2016 12:35:35 UTC+1 schrieb drewhk:
>
> It might or might not be a problem. I am just pointing out the effects of 
> buffer. There are at lest three different approaches possible here:
>
>  - no buffers at all, keep the pipeline fused: polling only happens on 
> need, and always returns fresh data:
>
> poller.throttle.mapConcat(identity)
>
>  - want prefetch for better throughput, paying the price of potentially 
> stale data:
>
> poller.throttle.mapConcat.buffer // can use .viaAsync to make consumer 
> stages concurrent
>
>  - want to poll independently of downstream demand, but not too often
>
> poller.throttle.conflate().mapConcat(identity)
>
> Any of these work, with different opertional semantics.
>
> -Endre
>
> On Mon, Feb 8, 2016 at 12:29 PM, Viktor Klang  > wrote:
>
>> How is that a problem? OP only wanted to make sure that the external 
>> system wasn't polled too often.
>>
>> On Mon, Feb 8, 2016 at 12:20 PM, Endre Varga > > wrote:
>>
>>> Ah, you meant Backpressure. But then what I originally said is true. 
>>> Just think about it:
>>>
>>>  - buffer requests
>>>  - buffer is enough to contain the next batch emitted by mapConcat
>>>  - buffer hence stores some result
>>>  - downstream now asks for next batch, but 3 hours later
>>>  - emitted result is now 3 hours old
>>>
>>> -Endre
>>>
>>> On Mon, Feb 8, 2016 at 12:05 PM, Viktor Klang >> > wrote:
>>>
 What? How would anything be dropped if buffer has Backpressure as 
 OverflowStrategy?

 On Mon, Feb 8, 2016 at 11:56 AM, Endre Varga >>> > wrote:

>
>
> On Mon, Feb 8, 2016 at 11:53 AM, Viktor Klang  > wrote:
>
>> If the Buffer has Backpressure as overflow strategy I don't see how 
>> it decouples upstream from downstream.
>>
>
> That is a dangerous move though, since you put the buffer *after* the 
> mapConcat, so this means that dropping will be independent of the batch 
> boundaries. I.e. the buffer might hold 1 full batch and the half, dopping 
> the other half. I think in this case it is better to use a more flexible 
> tool there and "batcher" seems to be the right one (it is a conflate-like 
> op with capacity, so can implement "smart" buffers). Or, mapConcat should 
> not be used here. I guess it depends on the use case.
>
> -Endre
>  
>
>>
>> On Mon, Feb 8, 2016 at 11:52 AM, Endre Varga > > wrote:
>>
>>>
>>>
>>> On Sun, Feb 7, 2016 at 9:49 PM, Viktor Klang >> > wrote:
>>>


 On Sun, Feb 7, 2016 at 2:17 PM, > 
 wrote:

> Hi Victor,
> thank you for your reply and here are my remarks :
>
> Point 1. You have a source of "events" and the only way you know 
> if there are any events, is if you ask for events
>
> exactly
>
> Point 2.You want to consume events from this source
>
> Yes
>
>  Point 3) You only need to consume events from the source if there 
> is demand from "downstream"
>
> It is the other way round. The source logically pushes the events 
> downstream.
> Ideally  as soon as theses Events arrive I would like them to be 
> pushed downstream. So its more a push scenario. 
> The source pushes as many Events as the downstream processes can 
> handle. 
> (But I have to limit myself for polling the database at a rate of 
> 2-5 seconds because of hardware reasons)
>

 You only want to send data if the downstream can handle it, and the 
 source knows that by keeping track of downstream demand.
  

>
>  Point 4) Does the source of events ever end, and how do you know?
>
> No the source never ends. External Systems always insert new Event 
> records into the database
>
>   Point 5. can you ask for a specified number of events or d

Re: [akka-user] Re: How to keep a Source alive

2016-02-07 Thread john . vieten
Hi Victor,
thank you for your reply and here are my remarks :

Point 1. You have a source of "events" and the only way you know if there 
are any events, is if you ask for events

exactly

Point 2.You want to consume events from this source

Yes

 Point 3) You only need to consume events from the source if there is 
demand from "downstream"

It is the other way round. The source logically pushes the events 
downstream.
Ideally  as soon as theses Events arrive I would like them to be pushed 
downstream. So its more a push scenario. 
The source pushes as many Events as the downstream processes can handle. 
(But I have to limit myself for polling the database at a rate of 2-5 
seconds because of hardware reasons)

 Point 4) Does the source of events ever end, and how do you know?

No the source never ends. External Systems always insert new Event records 
into the database

  Point 5. can you ask for a specified number of events or does polling 
imply reading all available events?

No I can ask for a specified number of events.

Here is a concrete business case:
1) External systems want Email Messages to be emailed to Users.
2) They insert Email Events (Records with email-address, content, 
user_id,etc) into a Email Table (log-table)
3)  Email-Send-Service sends these  Emails over the wire
4)  Acknowledge-Service logs the Email-Send Event and cleans up the Email 
Table (log-table).

So I can set up a Stream: Email-Source -> Email-Send-Service - 
Acknowledge-Service .

I am now considering two ways of doing it and are hoping for your advice (-:
1) create the following
Email-Source  (select * from Email limit 1000)  -> Email-Send-Service  
-> Acknowledge-Service  
and materialize this stream every two seconds

2) Set up a custom source which polls forever 
Polling-Neverending-Email-Source  (select * from Email limit 1000 every 
two seconds inside the Actor) -> Email-Send-Service  -> 
Acknowledge-Service  


Background: I am building up with Akka Streams a inhouse toolkit which 
deals with many ESB typical processes. 
The above usecase profits not so much from throughput (actually the users 
could live with some delay) but more from
reusing stream components and having a nice clear Flow DSL. 

Many Greetings
John 
















Am Sonntag, 7. Februar 2016 13:05:59 UTC+1 schrieb √:
>
> Hi John!
>
> I think I can help you, but I have some follow-on questions :)
>
> On Sun, Feb 7, 2016 at 12:52 PM, > wrote:
>
>> Hi Victor,
>> I know you  love simple elegant code but
>> I looked at unfoldAsync  and I don't see that it solves the usecase I 
>> have in mind. 
>>
>> I'll try to explain why because I am not sure if I am overlooking 
>> something obvious?
>>
>> An external system writes events into a log table. Since this is a 
>> non-reactive-sql-database the consumer needs to poll the log table (for 
>> example every 2 seconds) for new events.
>>
>
> (Why) does it need to poll the log table if there is no demand for events?
>  
>
>>
>>  To convert this scenario into a streaming source using unfoldAsync 
>>  I need to implement a polling loop inside the future so that  
>> Future.success gets  only called when new events are inserted in the log 
>> table.
>>
>
> This seems much like a technical aspect rather than a requirement.
>  
>
>>
>> If I don't use polling the future would send 0 Events upstream and the 
>> stream would come to an end?
>>
>
> Events go downstream, or did I misunderstand something?
>  
>
>>
>> That's why I like using instead of  unfoldAsync an Actor like JobManager 
>> .
>>  
>> as an Source. Within the Actor I can be more fine grained and  use the 
>> scheduler to implement the polling logic.
>>
>
> Let's take a step back, what are the actual requirements?
>
> 1. You have a source of "events" and the only way you know if there are 
> any events, is if you ask for events
> 2. You want to consume events from this source
> 3. You only need to consume events from the source if there is demand from 
> "downstream"
> 4. Does the source of events ever end, and how do you know?
> 5. can you ask for a specified number of events or does polling imply 
> reading all available events?
>  
>
>>
>> Many Greetings
>> John
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Am Mittwoch, 3. Februar 2016 23:10:15 UTC+1 schrieb √:
>>>
>>>
>>> http://doc.akka.io/api/akka-stream-and-http-experimental/2.0.3/?_ga=1.45749860.1579561034.1353497989#akka.stream.scaladsl.Source$
>>>
>>> On Wed, Feb 3, 2016 at 11:06 PM,  wrote:
>>>
 where do I find unfold/unfoldAsync ? I looked at 
 http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0.3/stages-overview.html
 ?
 Many Greetings
 John


 Am Mittwoch, 3. Februar 2016 20:51:17 UTC+1 schrieb √:
>
> I don't see why you'd need to write a custom GraphStage for this.
>
> unfold/unfoldAsync paired with a buffer with an appropriate dropping 
>>

Re: [akka-user] Re: How to keep a Source alive

2016-02-07 Thread john . vieten
Hi Victor,
I know you  love simple elegant code but
I looked at unfoldAsync  and I don't see that it solves the usecase I have 
in mind. 

I'll try to explain why because I am not sure if I am overlooking something 
obvious?

An external system writes events into a log table. Since this is a 
non-reactive-sql-database the consumer needs to poll the log table (for 
example every 2 seconds) for new events.

 To convert this scenario into a streaming source using unfoldAsync 
 I need to implement a polling loop inside the future so that  
Future.success gets  only called when new events are inserted in the log 
table.

If I don't use polling the future would send 0 Events upstream and the 
stream would come to an end?

That's why I like using instead of  unfoldAsync an Actor like JobManager 
.
 
as an Source. Within the Actor I can be more fine grained and  use the 
scheduler to implement the polling logic.

Many Greetings
John











Am Mittwoch, 3. Februar 2016 23:10:15 UTC+1 schrieb √:
>
>
> http://doc.akka.io/api/akka-stream-and-http-experimental/2.0.3/?_ga=1.45749860.1579561034.1353497989#akka.stream.scaladsl.Source$
>
> On Wed, Feb 3, 2016 at 11:06 PM, > wrote:
>
>> where do I find unfold/unfoldAsync ? I looked at 
>> http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0.3/stages-overview.html
>> ?
>> Many Greetings
>> John
>>
>>
>> Am Mittwoch, 3. Februar 2016 20:51:17 UTC+1 schrieb √:
>>>
>>> I don't see why you'd need to write a custom GraphStage for this.
>>>
>>> unfold/unfoldAsync paired with a buffer with an appropriate dropping 
>>> policy should work, no?
>>>
>>> On Wed, Feb 3, 2016 at 8:47 PM, clca  wrote:
>>>
 Yes this is close to what I need to do.
 The code in the onPull method is something like

 val m = ReadFromService(...)
 if(m != null)
push(out, m)

 in a traditional app reading would be done in a loop

 while(true) {
   val m = ReadFromService(...)
 //do something with the new message
 }

 So I'll add a mechanism  in the Source to keep polling the external 
 service.

 Thanks!


 On Wednesday, February 3, 2016 at 12:55:16 AM UTC-8, john@gmail.com 
 wrote:
>
> I've done something similar.
> I adapted this JobManager 
> .
>  
> When no data is available( for example when it recieves a Request(16) 
> Messag) it starts a" polling Actor" which polls an external Database for 
> more data.
> Does this help?
>
> Am Mittwoch, 3. Februar 2016 08:33:16 UTC+1 schrieb clca:
>>
>> I searched through the topics but I could not find any example on how 
>> to pull from a Source in the case where data is coming in bursts. I 
>> built a 
>> customized Source that read from an external source. Data is coming in 
>> bursts, the flow can stop for a while so I need to keep pulling the 
>> Source 
>> in such a way I can keep reading data (the actual read process is done 
>> in 
>> the old poll fashion). I guess I need something like a KeepAlive type of 
>> mechanism for the data stream.
>>
>> BTW: Fantastic job with Akka, Akka Stream & Akka HTTP!
>>
>> Thanks
>> Claudio
>>  
>>
> -- 
 >> Read the docs: http://akka.io/docs/
 >> Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
 >> Search the archives: 
 https://groups.google.com/group/akka-user
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Akka User List" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to akka-user+...@googlegroups.com.
 To post to this group, send email to akka...@googlegroups.com.
 Visit this group at https://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>> Cheers,
>>> √
>>>
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Cheers,
> √
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/c

Re: [akka-user] Re: How to keep a Source alive

2016-02-03 Thread john . vieten
where do I find unfold/unfoldAsync ? I looked 
at 
http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0.3/stages-overview.html?
Many Greetings
John


Am Mittwoch, 3. Februar 2016 20:51:17 UTC+1 schrieb √:
>
> I don't see why you'd need to write a custom GraphStage for this.
>
> unfold/unfoldAsync paired with a buffer with an appropriate dropping 
> policy should work, no?
>
> On Wed, Feb 3, 2016 at 8:47 PM, clca > 
> wrote:
>
>> Yes this is close to what I need to do.
>> The code in the onPull method is something like
>>
>> val m = ReadFromService(...)
>> if(m != null)
>>push(out, m)
>>
>> in a traditional app reading would be done in a loop
>>
>> while(true) {
>>   val m = ReadFromService(...)
>> //do something with the new message
>> }
>>
>> So I'll add a mechanism  in the Source to keep polling the external 
>> service.
>>
>> Thanks!
>>
>>
>> On Wednesday, February 3, 2016 at 12:55:16 AM UTC-8, john@gmail.com 
>> wrote:
>>>
>>> I've done something similar.
>>> I adapted this JobManager 
>>> .
>>>  
>>> When no data is available( for example when it recieves a Request(16) 
>>> Messag) it starts a" polling Actor" which polls an external Database for 
>>> more data.
>>> Does this help?
>>>
>>> Am Mittwoch, 3. Februar 2016 08:33:16 UTC+1 schrieb clca:

 I searched through the topics but I could not find any example on how 
 to pull from a Source in the case where data is coming in bursts. I built 
 a 
 customized Source that read from an external source. Data is coming in 
 bursts, the flow can stop for a while so I need to keep pulling the Source 
 in such a way I can keep reading data (the actual read process is done in 
 the old poll fashion). I guess I need something like a KeepAlive type of 
 mechanism for the data stream.

 BTW: Fantastic job with Akka, Akka Stream & Akka HTTP!

 Thanks
 Claudio
  

>>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Cheers,
> √
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: How to keep a Source alive

2016-02-03 Thread john . vieten
I've done something similar.
I adapted this JobManager 
.
 
When no data is available( for example when it recieves a Request(16) 
Messag) it starts a" polling Actor" which polls an external Database for 
more data.
Does this help?

Am Mittwoch, 3. Februar 2016 08:33:16 UTC+1 schrieb clca:
>
> I searched through the topics but I could not find any example on how to 
> pull from a Source in the case where data is coming in bursts. I built a 
> customized Source that read from an external source. Data is coming in 
> bursts, the flow can stop for a while so I need to keep pulling the Source 
> in such a way I can keep reading data (the actual read process is done in 
> the old poll fashion). I guess I need something like a KeepAlive type of 
> mechanism for the data stream.
>
> BTW: Fantastic job with Akka, Akka Stream & Akka HTTP!
>
> Thanks
> Claudio
>  
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Is this the correct flow to retrieve bytes from an HttpResponse?

2016-02-02 Thread john . vieten
Hi Richard,
The key is flatmapConat 

The akka team coded this build-in stage so that it flattens the nested 
ByteBuffer without consuming unnecessary memory

Am Dienstag, 2. Februar 2016 17:34:12 UTC+1 schrieb Richard Grossman:
>
> Indeed it can be a problem 
> I can't see why your code make something different not an expert of the 
> akka-stream 
> why adding a flow like make something different that map in scala
>
> On Tuesday, February 2, 2016 at 2:19:27 PM UTC+2, john@gmail.com 
> wrote:
>>
>> Hi Richard, unfortunately my scala is very bad. (Actually I  learning 
>> scala by looking at the akka source and this list)
>> But If I am right, the line
>> .map(r => (r._1.get.entity.dataBytes.runWith(Sink.head), r._2)
>> uses an implicit materializer. So your are aggregating the whole 
>> ByteBuffer in memory.
>>
>> Hacker  √ complained about this in the 4'th Mail in this thread.
>>
>> Pleas forgive if I am wrong!
>> Many Greetings John
>>
>>
>> Am Dienstag, 2. Februar 2016 10:41:07 UTC+1 schrieb Richard Grossman:
>>>
>>> Hi
>>>
>>> If it can help someone in scala you can do this like this
>>>
>>> val future : Future[NetworkResponse] =
>>>  Source.single(req)
>>>  .log("Start Http")
>>>  .map(req => (HttpRequest(HttpMethods.GET, Uri(req.url)), req))
>>>  .log("Map to httpRequest")
>>>  .map(httpReq => httpReq._1 -> (httpReq._2.id, httpReq._2.start))
>>>  .log("Map to request")
>>>  .via(connectionPool)
>>>  .log("after connection pool")
>>>  .map(r => (r._1.get.entity.dataBytes.runWith(Sink.head), r._2))
>>>  .log("after reading response")
>>>  .mapAsync(10)(r => r._1.map(bytes => NetworkResponse(r._2._1, r._2._2, 
>>> bytes.decodeString("UTF-8"
>>>  .log("after map async")
>>>  .runWith(Sink.head)
>>> future pipeTo sender
>>>
>>> It start the flow for each source as single 
>>> run the flow via the connectionPool
>>> Then map to response that read the data from the http connection
>>> Finally mapAsync send back a future on any structure that you want with 
>>> the data inside
>>>
>>>
>>> On Saturday, January 30, 2016 at 6:15:36 PM UTC+2, john@gmail.com 
>>> wrote:

 I ended up creating a flow with flatMapConcat:
 With this flow the bytes of the response get accumulated to a single 
 ByteString  
 for example:

 final Flow bytestringFlow = 
 Flow.of(Pair.class).flatMapConcat((Pair pair) -> {
Try responseTry = (Try) pair.first();
Source dataBytes = 
 responseTry.get().entity().getDataBytes();
return dataBytes;
 });


 Am Mittwoch, 27. Januar 2016 15:13:32 UTC+1 schrieb Richard Grossman:
>
> Hi
>
> I need to exactly the same I must get the response on http call into 
> my flow.
> I see that you think this tickets can solve your problem is it true ?
>
> Thanks
>
> On Tuesday, August 4, 2015 at 6:45:07 PM UTC+3, john@gmail.com 
> wrote:
>>
>> i think I need to wait for https://github.com/akka/akka/issues/15089
>>
>> Am Donnerstag, 30. Juli 2015 08:18:18 UTC+2 schrieb 
>> john@gmail.com:
>>>
>>> // this is part of a BidiFlow
>>>
>>> FlowShape, RequestResult>,
>>>   Tuple2>
>>>   bottom =
>>>   b.graph(Flow., Object>>empty().
>>> mapAsync(4, pair ->
>>> getEntityBytes(pair._1().get(), pair._2(), 
>>> materializer)
>>> ).map((pair) -> new Tuple2<>(pair._1(), pair._2(;
>>>
>>>
>>>
>>> static Future>
>>>getEntityBytes( final HttpResponse response,
>>>final Object requestResult,
>>>final ActorMaterializer materializer) {
>>>
>>>return response.entity().getDataBytes().runFold(
>>>  new Tuple2(ByteString.empty(),requestResult),
>>>  (aggr, next) -> new Tuple2(aggr._1().concat(next),aggr._2()), 
>>> materializer);
>>> }
>>>
>>>
>>>
>>>
>>>
>>> What looks a little funny to me is that I need to pass a materializer 
>>> to the inner flow?
>>>
>>> I am a little unsure because the docs Modularity, Composition and 
>>> Hierarchy state:
>>> "It is rarely useful to embed a closed graph shape in a larger graph"
>>>
>>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, 

[akka-user] Re: Is this the correct flow to retrieve bytes from an HttpResponse?

2016-02-02 Thread john . vieten
Hi Richard, unfortunately my scala is very bad. (Actually I  learning scala 
by looking at the akka source and this list)
But If I am right, the line
.map(r => (r._1.get.entity.dataBytes.runWith(Sink.head), r._2)
uses an implicit materializer. So your are aggregating the whole ByteBuffer 
in memory.

Hacker  √ complained about this in the 4'th Mail in this thread.

Pleas forgive if I am wrong!
Many Greetings John


Am Dienstag, 2. Februar 2016 10:41:07 UTC+1 schrieb Richard Grossman:
>
> Hi
>
> If it can help someone in scala you can do this like this
>
> val future : Future[NetworkResponse] =
>  Source.single(req)
>  .log("Start Http")
>  .map(req => (HttpRequest(HttpMethods.GET, Uri(req.url)), req))
>  .log("Map to httpRequest")
>  .map(httpReq => httpReq._1 -> (httpReq._2.id, httpReq._2.start))
>  .log("Map to request")
>  .via(connectionPool)
>  .log("after connection pool")
>  .map(r => (r._1.get.entity.dataBytes.runWith(Sink.head), r._2))
>  .log("after reading response")
>  .mapAsync(10)(r => r._1.map(bytes => NetworkResponse(r._2._1, r._2._2, 
> bytes.decodeString("UTF-8"
>  .log("after map async")
>  .runWith(Sink.head)
> future pipeTo sender
>
> It start the flow for each source as single 
> run the flow via the connectionPool
> Then map to response that read the data from the http connection
> Finally mapAsync send back a future on any structure that you want with 
> the data inside
>
>
> On Saturday, January 30, 2016 at 6:15:36 PM UTC+2, john@gmail.com 
> wrote:
>>
>> I ended up creating a flow with flatMapConcat:
>> With this flow the bytes of the response get accumulated to a single 
>> ByteString  
>> for example:
>>
>> final Flow bytestringFlow = 
>> Flow.of(Pair.class).flatMapConcat((Pair pair) -> {
>>Try responseTry = (Try) pair.first();
>>Source dataBytes = 
>> responseTry.get().entity().getDataBytes();
>>return dataBytes;
>> });
>>
>>
>> Am Mittwoch, 27. Januar 2016 15:13:32 UTC+1 schrieb Richard Grossman:
>>>
>>> Hi
>>>
>>> I need to exactly the same I must get the response on http call into my 
>>> flow.
>>> I see that you think this tickets can solve your problem is it true ?
>>>
>>> Thanks
>>>
>>> On Tuesday, August 4, 2015 at 6:45:07 PM UTC+3, john@gmail.com 
>>> wrote:

 i think I need to wait for https://github.com/akka/akka/issues/15089

 Am Donnerstag, 30. Juli 2015 08:18:18 UTC+2 schrieb john@gmail.com:
>
> // this is part of a BidiFlow
>
> FlowShape, RequestResult>,
>   Tuple2>
>   bottom =
>   b.graph(Flow., Object>>empty().
> mapAsync(4, pair ->
> getEntityBytes(pair._1().get(), pair._2(), 
> materializer)
> ).map((pair) -> new Tuple2<>(pair._1(), pair._2(;
>
>
>
> static Future>
>getEntityBytes( final HttpResponse response,
>final Object requestResult,
>final ActorMaterializer materializer) {
>
>return response.entity().getDataBytes().runFold(
>  new Tuple2(ByteString.empty(),requestResult),
>  (aggr, next) -> new Tuple2(aggr._1().concat(next),aggr._2()), 
> materializer);
> }
>
>
>
>
>
> What looks a little funny to me is that I need to pass a materializer 
> to the inner flow?
>
> I am a little unsure because the docs Modularity, Composition and 
> Hierarchy state:
> "It is rarely useful to embed a closed graph shape in a larger graph"
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: I seems to me that AbstractActorPublisher only supports polling from upstream flows?

2016-01-31 Thread john . vieten
yes that makes a lot of sense!

 It means that an AbstractActorPublisher Implementation always
needs to be lazy or buffer the data it wants to send. 

>From looking at for example : Source.from(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 
8, 9, 10));
I got the impression that the Source sends upon "materialization" 
immediately its data. But I now understand that
its always a "polling" scenario . The stream first issues a Request and 
then the source sends its data.

Am Sonntag, 31. Januar 2016 14:16:41 UTC+1 schrieb Tal Pressman:
>
> From what I know, RS specify that a producer can only push data when there 
> is demand for it downstream, in order to avoid flooding the downstream.
> Think about a case where the producer produces a huge amount of messages 
> before the downstream even time to react and ask it to throttle itself - 
> that could easily cause the downstream to crash.
> This way, the if the downstream is able to handle, say, 1000 messages it 
> requests 1000 messages and the publisher can send 1000 messages as they 
> become ready. But in order to send the 1001st message, it would have to 
> wait for further requests from the downstream.
>
> Hope this makes sense,
> Tal
>
>
> On Sunday, January 31, 2016 at 2:56:40 PM UTC+2, john@gmail.com wrote:
>>
>> By looking at the API of akka.stream.actor.AbstractActorPublisher I 
>> conclude that it only reacts to ActorPublisherMessage.Request messages.
>>
>> It always has to first receive a ActorPublisherMessage.Request before it 
>> can send data by onNext().
>>
>> Please forgive if I am wrong but I thought that "Reactive Streams 
>> specification" also allows a Publisher to actively push data downstream.
>> (of course if it pushes too fast it will receive a throttling message) 
>>
>> This seems to not be possible with the current  
>> akka.stream.actor.AbstractActorPublisher 
>> API? 
>>
>>
>>
>>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] I seems to me that AbstractActorPublisher only supports polling from upstream flows?

2016-01-31 Thread john . vieten
By looking at the API of akka.stream.actor.AbstractActorPublisher I 
conclude that it only reacts to ActorPublisherMessage.Request messages.

It always has to first receive a ActorPublisherMessage.Request before it 
can send data by onNext().

Please forgive if I am wrong but I thought that "Reactive Streams 
specification" also allows a Publisher to actively push data downstream.
(of course if it pushes too fast it will receive a throttling message) 

This seems to not be possible with the current  
akka.stream.actor.AbstractActorPublisher 
API? 




-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [Akka Streams] How to test my selfmade ActorPublisher?

2016-01-31 Thread john . vieten
I've extended (java) "aka.stream.actor.AbstractActorPublisher" .
Can I use the Streams TCK Tests to verify that it works correctly?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Is this the correct flow to retrieve bytes from an HttpResponse?

2016-01-30 Thread john . vieten
I ended up creating a flow with flatMapConcat:
With this flow the bytes of the response get accumulated to a single 
ByteString  
for example:

final Flow bytestringFlow = 
Flow.of(Pair.class).flatMapConcat((Pair pair) -> {
   Try responseTry = (Try) pair.first();
   Source dataBytes = 
responseTry.get().entity().getDataBytes();
   return dataBytes;
});


Am Mittwoch, 27. Januar 2016 15:13:32 UTC+1 schrieb Richard Grossman:
>
> Hi
>
> I need to exactly the same I must get the response on http call into my 
> flow.
> I see that you think this tickets can solve your problem is it true ?
>
> Thanks
>
> On Tuesday, August 4, 2015 at 6:45:07 PM UTC+3, john@gmail.com wrote:
>>
>> i think I need to wait for https://github.com/akka/akka/issues/15089
>>
>> Am Donnerstag, 30. Juli 2015 08:18:18 UTC+2 schrieb john@gmail.com:
>>>
>>> // this is part of a BidiFlow
>>>
>>> FlowShape, RequestResult>,
>>>   Tuple2>
>>>   bottom =
>>>   b.graph(Flow., Object>>empty().
>>> mapAsync(4, pair ->
>>> getEntityBytes(pair._1().get(), pair._2(), 
>>> materializer)
>>> ).map((pair) -> new Tuple2<>(pair._1(), pair._2(;
>>>
>>>
>>>
>>> static Future>
>>>getEntityBytes( final HttpResponse response,
>>>final Object requestResult,
>>>final ActorMaterializer materializer) {
>>>
>>>return response.entity().getDataBytes().runFold(
>>>  new Tuple2(ByteString.empty(),requestResult),
>>>  (aggr, next) -> new Tuple2(aggr._1().concat(next),aggr._2()), 
>>> materializer);
>>> }
>>>
>>>
>>>
>>>
>>>
>>> What looks a little funny to me is that I need to pass a materializer 
>>> to the inner flow?
>>>
>>> I am a little unsure because the docs Modularity, Composition and 
>>> Hierarchy state:
>>> "It is rarely useful to embed a closed graph shape in a larger graph"
>>>
>>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] [akka java streams] trouble with the type system

2016-01-18 Thread john . vieten
Hi Roland,
thanks alot. I am kind of trying to learn scala from reading the 
akka-streams-javadsl and sometimes get stuck by simmple things

Am Montag, 18. Januar 2016 10:31:28 UTC+1 schrieb rkuhn:
>
> Hi John,
>
> you’ll need to tell javac a bit more about that Broadcast by saying
>
> Broadcast. create(2)
>
> Regards,
>
> Roland
>
> 18 jan 2016 kl. 10:25 skrev john@gmail.com :
>
>
> Just curious the following code (adapted from 
> "http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0.2/java/stream-graphs.html";)
>  compile fails with
> an Error: 
> java: incompatible types: 
> akka.stream.UniformFanOutShape cannot be 
> converted to 
> akka.stream.UniformFanOutShape
>
> if I change 
> final UniformFanOutShape bcast = 
> (UniformFanOutShape)builder.add(Broadcast.create(2));
> to 
> final UniformFanOutShape bcast = 
> builder.add(Broadcast.create(2));
>
> everything works.
>
> Can Anybody explain to me what's the reason?
>
>
> import akka.stream.ClosedShape;
>
> import akka.stream.UniformFanOutShape;
> import akka.stream.javadsl.*;
> import scala.concurrent.Future;
> import java.util.List;
>
> public class Main {
>
>public static void main(String[] args) {
>   final Sink, Future>> sink = Sink.head();
>
>
>   final RunnableGraph>> result =
> RunnableGraph.>>fromGraph(
>   GraphDSL
> .create(
>   sink,
>   (builder, out) -> {
>  final UniformFanOutShape 
> bcast = (UniformFanOutShape Integer>)builder.add(Broadcast.create(2));
>  return ClosedShape.getInstance();
>   }));
>   
>}
> }
>
>
> -- 
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ: 
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >> Search the archives: https://groups.google.com/group/akka-user
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to akka-user+...@googlegroups.com .
> To post to this group, send email to akka...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> *Dr. Roland Kuhn*
> *Akka Tech Lead*
> Typesafe  – Reactive apps on the JVM.
> twitter: @rolandkuhn
> 
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [akka java streams] trouble with the type system

2016-01-18 Thread john . vieten



Just curious the following code (adapted from 
"http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0.2/java/stream-graphs.html";)
 compile fails with
an Error: 
java: incompatible types: 
akka.stream.UniformFanOutShape cannot be 
converted to akka.stream.UniformFanOutShape

if I change 
final UniformFanOutShape bcast = (UniformFanOutShape)builder.add(Broadcast.create(2));
to 
final UniformFanOutShape bcast = 
builder.add(Broadcast.create(2));

everything works.

Can Anybody explain to me what's the reason?


import akka.stream.ClosedShape;

import akka.stream.UniformFanOutShape;
import akka.stream.javadsl.*;
import scala.concurrent.Future;
import java.util.List;

public class Main {

   public static void main(String[] args) {
  final Sink, Future>> sink = Sink.head();


  final RunnableGraph>> result =
RunnableGraph.>>fromGraph(
  GraphDSL
.create(
  sink,
  (builder, out) -> {
 final UniformFanOutShape 
bcast = (UniformFanOutShape)builder.add(Broadcast.create(2));
 return ClosedShape.getInstance();
  }));
  
   }
}

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Advice on migration to Akka

2016-01-15 Thread john . vieten
Hi Johan
just one comment inline...

Am Freitag, 15. Januar 2016 09:21:41 UTC+1 schrieb Johan Andrén:
>
> Hi Henrik,
>
> I think this sounds like a good fit for persistance together with sharding.
>
> If you use sharding you will not "know" where the sharded actors are, but 
> address them with their id. Your
> controllers will however need to get their hands on the ShardRegion to 
> send messages to the sharded actors.
> The shard region will be a local actor and does not move around so it is 
> pretty much safe to look it up during 
> the bootstrap of your controller and then keep that ActorRef for all your 
> interaction.
>
> One reason why it could be an idea to think about moving away from spring 
> to akka-http in the future is that
> spring will block one thread until the request is done, so you will have 
> to block it to wait for the reply from your
>
 
Spring MVC only blocks by default. One can use 
"org.springframework.web.context.request.async.DeferredResult" 
to integrate quite nicely with akka 

sharded actor, and keeping that thread from taking other requests. While 
> akka-http is asynchronous all the way
> and will allow the "controller" to return the thread pool and then react 
> on the reply from the sharded actor.
>
> --
> Johan Andrén
> Typesafe -  Reactive apps on the JVM
> Twitter: @apnylle
>
> On Thursday, January 14, 2016 at 10:40:44 AM UTC+1, Henrik Johansson wrote:
>>
>> Hi,
>>
>> We have finally gotten around to try to migrate a fairly standard Spring 
>> REST application to Akka. It will be using the Java API (scala knowledge is 
>> moderate at best) and we could need some advice around the approach.
>>
>> The initial thought was to keep using the Spring based REST API i.e. keep 
>> all controllers and client facing API/Json serialization and use Akka 
>> persistance and sharding for our entities. Why we think this would be good 
>> is that we have quite well defined entities where the identity is explicit 
>> and guaranteed to be unique. We are also fond of the eventsourcing model. 
>> The idea is also that querying the entity for its current state would 
>> simple be a matter of rendering its current state and thus saving a trip to 
>> the database and result in better performance. We are talking perhaps 
>> single digit millions of these entities.
>>
>> Where we find that we lack explicit understanding is how we get hold of 
>> the actors from the controllers (or whatever service actually performs 
>> actor interactions). Looking up persistent actors (without sharding for 
>> simplicity) using Patterns.ask seems to work but we are unclear as to 
>> whether or not that is the way to do it. Should we do that whenever we need 
>> to get hold of an entity and is there any (significant) overhead? We would 
>> prefer not to cache the actors and it seems counterintuitive as well since 
>> actors target locations can change. Also maintaining invalidations seems a 
>> hassle.
>>
>> Any help and advice would be greatly appreciated. Caveats and gotchas etc 
>> also very welcome.
>>
>> Thanks,
>> Henrik
>>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How-to start a not uniform flow in java?

2016-01-13 Thread john . vieten
Yes that makes sense and helps me better undnerstand the streams api.
I am struggling right now though. here is my pseudo code

Flow, Integer>, BoxedUnit> flow = ;

final Flow byteStringFlow = 
flow.flatMapConcat(pair -> {
   Try responseTry = pair.first();
   return responseTry.get().entity().getDataBytes();
});


I am trying to hold onto the Integer and resulting Bytesring on flow that I 
connect to 
byteStringFlow. 

I am trying to use viaMat but I cannot find a way to add it to 
byteStringFlow





Am Mittwoch, 13. Januar 2016 16:09:38 UTC+1 schrieb drewhk:
>
> Hi,
>
> How would that work? It is an empty (identity) Flow, therefore it cannot 
> cannot change the type of the input to another type since elements are 
> unchanged.
>
> You need to add at least one combinator to the flow to change the output 
> types.
>
> -Endre
>
> On Wed, Jan 13, 2016 at 4:05 PM, > wrote:
>
>> I know  how to create a simple flow:
>>
>> Flow flowUniform = Flow.create();
>>
>> But how-to create a not uniform flow?
>>
>> Flow, Integer>, BoxedUnit> flowNotUniform = 
>> Flow.create(); // this doesn't work
>>
>> Many Greetings John?
>>
>>
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How-to start a not uniform flow in java?

2016-01-13 Thread john . vieten
I know  how to create a simple flow:

Flow flowUniform = Flow.create();

But how-to create a not uniform flow?

Flow, Integer>, BoxedUnit> flowNotUniform = 
Flow.create(); // this doesn't work

Many Greetings John?


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Does akka streams support a getDataBytes() with context flow?

2016-01-12 Thread john . vieten


Isn't the following case typical for dealing with Http().superPool(...) flows?
The superPool flow lets me nicely attach context to the HttResponse.

Now I do not want to materialize the  getDataBytes Source right away but pass 
it to flatMapConcat.
Like in the following pseudo java code: 

1) Flow, Pair, Object>, BoxedUnit> 
flow = httpClient.request();
2) Flow byteStringFlow = 
responseFlow.flatMapConcat(pair -> {
3)   // How to also pass pair.second() back?
4)   return pair.first().get().entity().getDataBytes();
5) });


In the above code I would like to also pass the context in pair.second() 
downstream. I guess this is not possible with the simple flows api?
Does akka streams support a getDataBytes() with context flow?


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Are there any libraries that help me implementing a Micro-Service Archicteture with Akka?

2015-12-09 Thread john . vieten
Yes I ran over ConductR yesterday and seems to have a lot what I need.
I think you have posted some videos on type safe.  I hope it will usable 
from  java. 
I am not allowed to use any scala

Am Mittwoch, 9. Dezember 2015 14:44:34 UTC+1 schrieb Johan Andrén:
>
> You didn't mention if you are looking for something free/OSS so not sure
> if this interests you, but there is ConductR from Typesafe that does 
> similiar
> things to what you describe.
>
> You can find more info here: http://conductr.typesafe.com/docs/1.0.x/Home
>
> --
> Johan Andrén
> Typesafe -  Reactive apps on the JVM
> Twitter: @apnylle
>
> On Friday, December 4, 2015 at 11:46:32 AM UTC+1, john@gmail.com 
> wrote:
>>
>> Hi,
>>
>> If I have a  bare bone Akka cluster running on n nodes with a fixed 
>> configuration.
>> I am cosidering to build a system where one could deploy dynamically  
>> akka-jars to this cluster.  
>> These akka-jars should be  isolated as much as possible from each other. 
>> (Maybe through different classloaders)
>>
>> Does the akka echo system offer any thing here.
>> I skimmed through the 2.4 docs but couldn't find much on this subject?
>>
>> Many Greetings
>> john
>>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: [Streams] How to use a never ending java.sql.ResultSet as a stream source?

2015-12-07 Thread john . vieten
The Actor Publish looks like a good starting place! 
And the link 

 JobManager looks like a good kickstart


Am Montag, 7. Dezember 2015 15:51:45 UTC+1 schrieb 
mathe...@sagaranatech.com:
>
> A good solution is create a source using ActorPublish to encapsulate the 
> query.
>
> Em segunda-feira, 7 de dezembro de 2015 11:47:16 UTC-3, john@gmail.com 
> escreveu:
>>
>> I am on the java stack so I can't use slick.
>>
>> 1) A sql table "data"  gets filled up by some other proccess.
>>
>> 2) I do something like  "select * from data order by time_stamp limit 
>> 1000" and use this as a stream source.
>>
>> 3) After the stream processing I delete the 1000  records and start at 1) 
>> again
>>
>> I am unsure how akka streams helps me with the stream source.
>> Should I just provide a Iterator Interface over the sql.ResultSet?
>> Or should I provide an Iterater for each "select" statement and  use 
>> flatMap?
>>
>>
>>
>>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [Streams] How to use a never ending java.sql.ResultSet as a stream source?

2015-12-07 Thread john . vieten
I am on the java stack so I can't use slick.

1) A sql table "data"  gets filled up by some other proccess.

2) I do something like  "select * from data order by time_stamp limit 1000" 
and use this as a stream source.

3) After the stream processing I delete the 1000  records and start at 1) 
again

I am unsure how akka streams helps me with the stream source.
Should I just provide a Iterator Interface over the sql.ResultSet?
Or should I provide an Iterater for each "select" statement and  use 
flatMap?




-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: total newbie question

2015-12-06 Thread john . vieten
you need to map the returned  Future to a Future

for example:

private Future send(final RequestContext ctx, final Object 
message) {
   
   Future askResult = ask(actor, message, TIME_OUT);
   Mapper func = new Mapper() {
  public RouteResult apply(Object msg) {
 Marshaller marshaller = 
Jackson.json(ObjectMapperFactory.getInstance());
 return ctx.completeAs(marshaller, msg);

  }
   };
   return askResult.map(func, ctx.executionContext());
}



Am Sonntag, 6. Dezember 2015 17:58:41 UTC+1 schrieb ash.ta:
>
> hi all,
>
> i just started to play around with akka, coming with a background in 
> node.js and other reactive/async stuff.
> so, i'm sorry in advance if this newbie questions sounds totally stupid. 
>
> i'm trying to make things happen in java due to the lack of knowledge of 
> scala (should i waste my time on this at all?) 
> i'm failing to produce a simple example of the following flow (btw, since 
> spray seems to provide only scala api (am i wrong?) i moved to latest 
> akka-http):
> http request arrives -> an actor is triggered -> some logic is done within 
> the actor -> actor returns the result back to http server -> response is 
> sent back.
>
> my basic problem is that i can't find a way to bind 
>
> Future returned from Patterns.ask() to RequestContext.complete().
>
>
> can anyone help me with an advise or point me to the existing example?
>
>
> thanks!
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Are there any libraries that help me implementing a Micro-Service Archicteture with Akka?

2015-12-04 Thread john . vieten
Hi,

If I have a  bare bone Akka cluster running on n nodes with a fixed 
configuration.
I am cosidering to build a system where one could deploy dynamically  
akka-jars to this cluster.  
These akka-jars should be  isolated as much as possible from each other. 
(Maybe through different classloaders)

Does the akka echo system offer any thing here.
I skimmed through the 2.4 docs but couldn't find much on this subject?

Many Greetings
john

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: when does the connection get passed back to the connection pool?

2015-11-25 Thread john . vieten
if the answer is line number 8. Is there a way to specify a timeout so that 
if line 6 and 7 take to long the connection gets passed back after the 
timeout?
I am using akka-http-core-experimental_2.11 version 1.0

Am Mittwoch, 25. November 2015 22:59:46 UTC+1 schrieb john@gmail.com:
>
> *In the following code, when does the connection get passed back to the 
> connection pool?*
>
>  *1 void send(*HttpRequest request) {
>
> 2  final Future responseFuture = 
> Http.get(system).singleRequest(request, mat);
>
> 3   responseFuture.onComplete(new OnComplete() {
> 4 public void onComplete(Throwable failure, HttpResponse response) {
>
> 6   *//  do some long running heavy work*
>
> *7   //  do some  more long running heavy work*
>
> 8 }
> 9 }, ec);
>
> 10
>
> 11 }
>
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] when does the connection get passed back to the connection pool?

2015-11-25 Thread john . vieten


*In the following code, when does the connection get passed back to the 
connection pool?*

 *1 void send(*HttpRequest request) {

2  final Future responseFuture = 
Http.get(system).singleRequest(request, mat);

3   responseFuture.onComplete(new OnComplete() {
4 public void onComplete(Throwable failure, HttpResponse response) {

6   *//  do some long running heavy work*

*7   //  do some  more long running heavy work*

8 }
9 }, ec);

10

11 }


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How can I restart a http connection pool;

2015-11-25 Thread john . vieten
I am using the future based variant 
http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0-M1/java/http/client-side/request-level.html#future-based-variant
Somethimes I get a "max-open-requests" exception. I think its a deployment 
issue. In such a case I would just want to restart the pool without 
restarting the actor system.
Is this possible?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] A simple Akka JMM question

2015-10-06 Thread john . vieten
I know but sometimes I need this kind of modifiable message. For example 
when the purpose of my actor is to compete the "missing pieces of 
something" ( I think I saw such designs in akka books or was it the Rolands 
coursera  webcrawler example)
May I ask why it is assured to work? Does  the akka dispatcher call a  
synchronize monitor behind the scenes to ensure field visibility?

Am Dienstag, 6. Oktober 2015 10:11:54 UTC+2 schrieb √:
>
> Hi John,
>
> yes it will work, but keep in mind that it is *highly* discouraged to send 
> mutable messages not only because it won't work across JVMs but also 
> because nothing prevents you for accidental aliasing it.
>
> On Tue, Oct 6, 2015 at 9:46 AM, > wrote:
>
>> Hi,
>> please see the code at http://pastebin.com/L0WiXTJU
>>
>> Does Akka garantee that changes to the ArrayList "theList" will always 
>> been seen by ExampleActor? 
>>
>> Or asked differently does the rule from 
>> http://doc.akka.io/docs/akka/2.4.0/general/jmm.html 
>>
>> *"The actor send rule:* the send of the message to an actor happens 
>>> before the receive of that message by the same actor" 
>>
>>  
>> ensure that my ExampleActor logic works?
>> 
>>  
>>
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Cheers,
> √
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] A simple Akka JMM question

2015-10-06 Thread john . vieten
Hi,
please see the code at http://pastebin.com/L0WiXTJU

Does Akka garantee that changes to the ArrayList "theList" will always been 
seen by ExampleActor? 

Or asked differently does the rule from 
http://doc.akka.io/docs/akka/2.4.0/general/jmm.html 

*"The actor send rule:* the send of the message to an actor happens before 
> the receive of that message by the same actor" 

 
ensure that my ExampleActor logic works?

 

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: How to log the source line number with Akka Logging?

2015-09-28 Thread john . vieten
Richard thanxs for replying. what I ended up is flaging my Logs with the 
help of MDC. 
With this meta info I am very happy in my logs. If I wanted I could even 
add a source line number to MDC but It turned out that with the right MDC 
fields like classname, etc I don't even need this info


Am Montag, 28. September 2015 10:40:05 UTC+2 schrieb Richard Bradley:
>
> Logging the source code location isn't possible in Akka without using 
> macros.
> This old thread discusses how to go about doing that: 
> https://groups.google.com/forum/#!topic/akka-user/-MonmYP6znA
>
> That fix won't be possible in Java, because it doesn't support source code 
> macros. You could write a Java pre-processor to fix this, if it's very 
> important to you.
>
> Good luck,
>
>
> Rich
>
>
> On Friday, September 25, 2015 at 4:00:53 PM UTC+1, john@gmail.com 
> wrote:
>>
>> sorry for opening up 2 threads I guess this is not possible if I am 
>> only  using java?
>>
>> Am Freitag, 25. September 2015 16:58:56 UTC+2 schrieb Patrik Nordwall:
>>>
>>> Perhaps implement your own subclass of LoggingAdapter, and override the 
>>> mdc method?
>>>
>>> On Fri, Sep 25, 2015 at 4:56 PM,  wrote:
>>>
 Patrik thanx for replying.
 If I do not have a actor context because I am in a async code block of 
 a HttpApp... how can I plug into the  DiagnosticLoggingAdapter 
 
  ? 
 Am Freitag, 25. September 2015 16:38:06 UTC+2 schrieb Patrik Nordwall:
>
> The Akka logging is asynchronous and that is why you see the line 
> number of the akka.event.slf4j.Slf4jLogger instead of your own source 
> code. 
> It would hurt performance too much to capture line number in the akka 
> logging in general but one idea of how you could add it yourself is that 
> you use the DiagnosticLoggingAdapter 
> 
>  
> and put the source location into MDC.
>
> Regards,
> Patrik
>
> On Wed, Sep 23, 2015 at 11:27 AM,  wrote:
>
>> my log4j 1.2 ConversionPattern is  [%l] 
>>
>>
>> Am Mittwoch, 23. September 2015 11:10:22 UTC+2 schrieb 
>> john@gmail.com:
>>>
>>> When using the akka.event.slf4j.Slf4jLogger and log4j  I find for 
>>> the location something like:
>>>
>>>
>>> "akka.event.slf4j.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3.apply$mcV$sp(Slf4jLogger.scala:74)
>>>
>>> Is it possible to get the correct Sorce Code Line Number in the logs?
>>>
>>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: 
>> https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to akka-user+...@googlegroups.com.
>> To post to this group, send email to akka...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe  -  Reactive apps on the JVM
> Twitter: @patriknw
>
> -- 
 >> Read the docs: http://akka.io/docs/
 >> Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
 >> Search the archives: 
 https://groups.google.com/group/akka-user
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Akka User List" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to akka-user+...@googlegroups.com.
 To post to this group, send email to akka...@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>>
>>> Patrik Nordwall
>>> Typesafe  -  Reactive apps on the JVM
>>> Twitter: @patriknw
>>>
>>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups

Re: [akka-user] Re: How to log the source line number with Akka Logging?

2015-09-25 Thread john . vieten
sorry for opening up 2 threads I guess this is not possible if I am 
only  using java?

Am Freitag, 25. September 2015 16:58:56 UTC+2 schrieb Patrik Nordwall:
>
> Perhaps implement your own subclass of LoggingAdapter, and override the 
> mdc method?
>
> On Fri, Sep 25, 2015 at 4:56 PM, > wrote:
>
>> Patrik thanx for replying.
>> If I do not have a actor context because I am in a async code block of a 
>> HttpApp... how can I plug into the  DiagnosticLoggingAdapter 
>> 
>>  ? 
>> Am Freitag, 25. September 2015 16:38:06 UTC+2 schrieb Patrik Nordwall:
>>>
>>> The Akka logging is asynchronous and that is why you see the line number 
>>> of the akka.event.slf4j.Slf4jLogger instead of your own source code. It 
>>> would hurt performance too much to capture line number in the akka logging 
>>> in general but one idea of how you could add it yourself is that you use 
>>> the DiagnosticLoggingAdapter 
>>> 
>>>  
>>> and put the source location into MDC.
>>>
>>> Regards,
>>> Patrik
>>>
>>> On Wed, Sep 23, 2015 at 11:27 AM,  wrote:
>>>
 my log4j 1.2 ConversionPattern is  [%l] 


 Am Mittwoch, 23. September 2015 11:10:22 UTC+2 schrieb 
 john@gmail.com:
>
> When using the akka.event.slf4j.Slf4jLogger and log4j  I find for the 
> location something like:
>
>
> "akka.event.slf4j.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3.apply$mcV$sp(Slf4jLogger.scala:74)
>
> Is it possible to get the correct Sorce Code Line Number in the logs?
>
> -- 
 >> Read the docs: http://akka.io/docs/
 >> Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
 >> Search the archives: 
 https://groups.google.com/group/akka-user
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Akka User List" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to akka-user+...@googlegroups.com.
 To post to this group, send email to akka...@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>>
>>> Patrik Nordwall
>>> Typesafe  -  Reactive apps on the JVM
>>> Twitter: @patriknw
>>>
>>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe  -  Reactive apps on the JVM
> Twitter: @patriknw
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: [Streams] How-to get a DiagnosticLoggingAdapter within a akka.http.javadsl.server.HttpApp class ?

2015-09-25 Thread john . vieten
yep thanks for your reply . Since I am using java I have to think of 
something different

Am Freitag, 25. September 2015 16:56:16 UTC+2 schrieb Patrik Nordwall:
>
> The reason is that it's not thread safe (must not be accessed concurrently 
> from different threads).
>
> I guess you can write your own class that is similar to 
> DiagnosticLoggingAdapter 
> but I don't know how do you intend to use it from futures. Passing 
> context (MDC) across threads is not easy.
>
>
> https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/event/Logging.scala#L1133
>
> https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/event/Logging.scala#L527
>
> /Patrik
>
> On Fri, Sep 25, 2015 at 3:44 PM, > wrote:
>
>> Ok I now see from the docs that DiagnosticLoggingAdapter must be used 
>> within an actor.
>> Hmmh a simple Logger won't work because I need to log from within 
>> futures. I am alittle affraid of using 
>>
>> Logback *AsyncAppender because it might block.*
>>
>>
>> Am Freitag, 25. September 2015 15:32:40 UTC+2 schrieb john@gmail.com:
>>>
>>> I wanted to use MDC and therefore a  DiagnosticLoggingAdapter in a class 
>>> that extends 
>>>
>>> akka.http.javadsl.server.HttpApp
>>>
>>> But there seems to be no way to create such an DiagnosticLoggingAdapter 
>>> outside of an Actor?
>>>
>>> Right now I guess I have to fallback to use a Logback *AsyncAppender*?
>>>
>>>
>>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe  -  Reactive apps on the JVM
> Twitter: @patriknw
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: How to log the source line number with Akka Logging?

2015-09-25 Thread john . vieten
Patrik thanx for replying.
If I do not have a actor context because I am in a async code block of a 
HttpApp... how can I plug into the  DiagnosticLoggingAdapter 

 ? 
Am Freitag, 25. September 2015 16:38:06 UTC+2 schrieb Patrik Nordwall:
>
> The Akka logging is asynchronous and that is why you see the line number 
> of the akka.event.slf4j.Slf4jLogger instead of your own source code. It 
> would hurt performance too much to capture line number in the akka logging 
> in general but one idea of how you could add it yourself is that you use 
> the DiagnosticLoggingAdapter 
> 
>  
> and put the source location into MDC.
>
> Regards,
> Patrik
>
> On Wed, Sep 23, 2015 at 11:27 AM, > 
> wrote:
>
>> my log4j 1.2 ConversionPattern is  [%l] 
>>
>>
>> Am Mittwoch, 23. September 2015 11:10:22 UTC+2 schrieb john@gmail.com
>> :
>>>
>>> When using the akka.event.slf4j.Slf4jLogger and log4j  I find for the 
>>> location something like:
>>>
>>>
>>> "akka.event.slf4j.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3.apply$mcV$sp(Slf4jLogger.scala:74)
>>>
>>> Is it possible to get the correct Sorce Code Line Number in the logs?
>>>
>>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe  -  Reactive apps on the JVM
> Twitter: @patriknw
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: [Streams] How-to get a DiagnosticLoggingAdapter within a akka.http.javadsl.server.HttpApp class ?

2015-09-25 Thread john . vieten
Ok I now see from the docs that DiagnosticLoggingAdapter must be used 
within an actor.
Hmmh a simple Logger won't work because I need to log from within futures. 
I am alittle affraid of using 

Logback *AsyncAppender because it might block.*


Am Freitag, 25. September 2015 15:32:40 UTC+2 schrieb john@gmail.com:
>
> I wanted to use MDC and therefore a  DiagnosticLoggingAdapter in a class 
> that extends 
>
> akka.http.javadsl.server.HttpApp
>
> But there seems to be no way to create such an DiagnosticLoggingAdapter 
> outside of an Actor?
>
> Right now I guess I have to fallback to use a Logback *AsyncAppender*?
>
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [Streams] How-to get a DiagnosticLoggingAdapter within a akka.http.javadsl.server.HttpApp class ?

2015-09-25 Thread john . vieten
I wanted to use MDC and therefore a  DiagnosticLoggingAdapter in a class 
that extends 

akka.http.javadsl.server.HttpApp

But there seems to be no way to create such an DiagnosticLoggingAdapter outside 
of an Actor?

Right now I guess I have to fallback to use a Logback *AsyncAppender*?


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: How to log the source line number with Akka Logging?

2015-09-23 Thread john . vieten
my log4j 1.2 ConversionPattern is  [%l] 


Am Mittwoch, 23. September 2015 11:10:22 UTC+2 schrieb john@gmail.com:
>
> When using the akka.event.slf4j.Slf4jLogger and log4j  I find for the 
> location something like:
>
>
> "akka.event.slf4j.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3.apply$mcV$sp(Slf4jLogger.scala:74)
>
> Is it possible to get the correct Sorce Code Line Number in the logs?
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How to log the source line number with Akka Logging?

2015-09-23 Thread john . vieten
When using the akka.event.slf4j.Slf4jLogger and log4j  I find for the 
location something like:

"akka.event.slf4j.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3.apply$mcV$sp(Slf4jLogger.scala:74)

Is it possible to get the correct Sorce Code Line Number in the logs?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [akka-streams] Does the http connection client pool provide any metrics?

2015-08-29 Thread john . vieten
Can I get any metrics from Http.get(system).singleRequest(...) ?
Just would like to know if there were any pending request in the queues 
backing the http connection pool?
Anyway does akka in general provide metrics I can hook into for example 
with https://github.com/dropwizard/metric 
 ?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Where-to handle an Exception with scala.concurrent.Future?

2015-08-24 Thread john . vieten
Thanks a lot for clarifying!
I missed the part that onComplete stops the chaining which when thinking 
about makes sense.
And indeed recover is all I need if I want to stick to the chaining  


Am Montag, 24. August 2015 14:28:46 UTC+2 schrieb Johan Andrén:
>
> Hi John,
>
> I think the Akka docs pretty much covers all of it actually, and was 
> written with a Java hat on, so it should be much easier for you as a Java 
> dev to read those than to look at the Scala-docs.
>
> You basically have two options, and both are covered in the docs:
>
> 1. side effecting using onComplete or onFailure. Note that these cannot 
> be chained so once you called either of these you get a Unit back (like 
> void in Java) so you cannot chain them in the same statement. Of course you 
> can capture your Future in a variable and call both onSuccess and 
> onFailure on that with separate statements. onComplete will get called 
> with both successful results and failures while onFailure only gets 
> called with failures.
>
> Examples for this in the docs is under "Callbacks": 
> http://doc.akka.io/docs/akka/2.3.12/java/futures.html#Callbacks
>
>
> 2. chaining transformations: if you know that you can solve the problem 
> with the exception, and transform it into a successful result, a default 
> for example, you can use recover and recoverWith as described here.
> http://doc.akka.io/docs/akka/2.3.12/java/futures.html#Exceptions
>
> Hope this helps!
> --
> Johan Andrén
> Typesafe -  Reactive apps on the JVM
> Twitter: @apnylle
>
>
> On Monday, August 24, 2015 at 10:22:40 AM UTC+2, john@gmail.com wrote:
>>
>> Hi,
>> For example I'm using:
>>
>> scala.concurrent.Future responseFuture = 
>> Http.get(system).singleRequest(request, materializer);
>>
>>
>> and then 
>>
>>
>> Future  newFuture  = responseFuture.flatMap(new 
>> Mapper>() {...}
>>
>> If I want to handle the StreamTcpException should I register a OnComplete 
>> Handler on responseFuture or on newFuture? 
>>
>>
>> As A general Question where can I get more infos about futures in akka 
>> (java) besides
>>
>> http://doc.akka.io/docs/akka/2.3.12/java/futures.html
>>
>> Should I try as a java programmer read the scala docs, articles?
>>
>>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Where-to handle an Exception with scala.concurrent.Future?

2015-08-24 Thread john . vieten
Hi,
For example I'm using:

scala.concurrent.Future responseFuture = 
Http.get(system).singleRequest(request, materializer);


and then 


Future  newFuture  = responseFuture.flatMap(new 
Mapper>() {...}

If I want to handle the StreamTcpException should I register a OnComplete 
Handler on responseFuture or on newFuture? 


As A general Question where can I get more infos about futures in akka (java) 
besides

http://doc.akka.io/docs/akka/2.3.12/java/futures.html

Should I try as a java programmer read the scala docs, articles?


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-22 Thread john . vieten
Hi Johannes,
yep you understood my question correctly.

Am Donnerstag, 20. August 2015 14:46:21 UTC+2 schrieb 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 all the 
> time. akka-http already provides `Http.singleRequest` which implements 
> exactly what you are looking for so that should be your default entry point 
> for running single requests. 
>
> I tried to refactor my code to Http.singleRequest. Actually now a lot code 
is simplified and the queue bottleneck vanished but I am having a hard time 
refactoring fan in  fan out flows.
so I might stick with the flow based Http.superflow  (To be honest code 
readability is as important as back pressure and scaleability to me)


 

> If this isn't enough (the best example IMO would be the need to provide 
> custom queuing logic) akka-stream should provide a general facility that 
> allows users to put a queue around one-to-one flows (with or without 
> context).
>
> this sounds very interesting.  but I have no idea how the client interface 
into aka-stream would look.  

 

> Johannes
>
> On Thursday, August 20, 2015 at 11:56:06 AM UTC+2, Konrad Malawski wrote:
>>
>> Hi John, 
>> good observation, however this has not shown up in our initial 
>> benchmarking as a bottle-neck so far AFAIR.
>> We're taking a systematic aproach and first improving the perf of the 
>> "biggest bang for the buck" elements of Akka Http.
>> Currently this means we're focusing on fusing and need to implement 
>> fusing of fan-in and fan-out stages, which will save a lot of actor 
>> creation during request handling.
>>
>> From there we'll benchmark again and see what then becomes the bottleneck 
>> :-)
>>
>> If you'd like to help out, we'd definitely welcome contributions (backed 
>> with benchmarks in case of perf improvements).
>>
>> Thanks!
>>
>> On Sat, Aug 15, 2015 at 1:01 PM,  wrote:
>>
>>> Is this source sound for a "flow" based on Http().superPool(...) :
>>>
>>> BlockingQueue queue = new LinkedBlockingQueue<>();
>>>
>>> Source< HttpRequest, ?> source = Source.fromIterator(() ->
>>>   new Iterator() {
>>>  public boolean hasNext() {return true;}
>>>
>>>  public HttpRequest next() {
>>> try {
>>>return queue.take();
>>> } catch (InterruptedException e) {}
>>> return null;
>>>  }
>>>  });
>>>
>>>
>>> So many clients will be adding async many  HttpRequests to the single 
>>> queue and the flow (based on Http().superPool(...)) should then process 
>>> theses requests.
>>>
>>> I do think that using a concurrent LinkedBlockingQueue does scale. But 
>>> is there an alternative?
>>>
>>>
>>>
>>> -- 
>>> >> Read the docs: http://akka.io/docs/
>>> >> Check the FAQ: 
>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>> >> Search the archives: 
>>> https://groups.google.com/group/akka-user
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Akka User List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to akka-user+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Cheers,
>> Konrad 'ktoso' Malawski
>> Akka  @ Typesafe 
>>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-15 Thread john . vieten
Is this source sound for a "flow" based on Http().superPool(...) :

BlockingQueue queue = new LinkedBlockingQueue<>();

Source< HttpRequest, ?> source = Source.fromIterator(() ->
  new Iterator() {
 public boolean hasNext() {return true;}

 public HttpRequest next() {
try {
   return queue.take();
} catch (InterruptedException e) {}
return null;
 }
 });


So many clients will be adding async many  HttpRequests to the single queue 
and the flow (based on Http().superPool(...)) should then process theses 
requests.

I do think that using a concurrent LinkedBlockingQueue does scale. But is 
there an alternative?



-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: Looking for Code example to create akka.http.javadsl.testkitTestResponse

2015-08-13 Thread john . vieten
Hi Johannes,
I think I am doing the right thing (at least I hope (-: )

Here is my testing setup:
1) My test class needs to extend "SpringJUnit4ClassRunner" (which mocks a 
spring-mvn rest server)

2) the called  spring controller needs to integrate with a akka-http 
service  And here fore  I have programmed a injected  class which extends 
RoutTest which  actually calls the akkaservice.

So I think have exactly the test scenario which you I have foreseen 
with RoutTest.
And it works like a charm! I do not need to configure any ports and can 
test a full servlet-container-akka-http-akka-backend flow.

Am Donnerstag, 13. August 2015 10:18:39 UTC+2 schrieb Johannes Rudolph:
>
> Yes, good point.
>
> https://github.com/akka/akka/pull/18201
>
> On the other hand, I wonder why you need to implement TestResponse, john? 
> You should only ever need to implement it if you want to support another 
> kind of testing framework. Is that what you are trying to achieve? To write 
> tests with JUnit just derive your test class from JUnitRouteTest.
>
> Have you seen 
> http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/java/http/routing-dsl/testkit.html
> ?
>
> Johannes
>
>
>
> On Thursday, August 13, 2015 at 9:01:40 AM UTC+2, Akka Team wrote:
>>
>> Yes, that is a little unfortunate: the Scala type system allows the 
>> expression of non-termination (the bottom type—Nothing) which Java does not 
>> know about, so this it what happens “under the hood” (i.e. in the sausage 
>> factory).
>>
>> We might want to change the return type of `fail` from Nothing to Unit, 
>> what do you think, Johannes?
>>
>> Regards,
>>
>> Roland
>>
>> On Tue, Aug 11, 2015 at 1:52 PM,  wrote:
>>
>>> ok I found out:
>>>
>>> return new TestResponse(response,null,null,null){
>>>   public  scala.runtime.Nothing$ fail( String message) { return null;}
>>>
>>>   public void assertEquals(int expected, int actual, String message) { }
>>>
>>>
>>>   public void assertEquals(Object expected, Object actual, String 
>>> message) { }
>>>
>>>   @Override
>>>   public void assertTrue(boolean predicate, String message) {}
>>>};
>>> }
>>>
>>>
>>>
>>> The "scala.runtime.Nothing$" return type on fail was not obvious to me.
>>>  
>>>
>>>
>>> Am Dienstag, 11. August 2015 12:24:32 UTC+2 schrieb john@gmail.com:

 I am extending  

 akka.http.javadsl.testkit.RouteTest.

 In one of the methods I need to return a TestResponse.

  How can I do this with java 

 public TestResponse createTestResponse(HttpResponse response) {

return new TestResponse(response,null,null,null);
 }


 does not work?

 -- 
>>> >> Read the docs: http://akka.io/docs/
>>> >> Check the FAQ: 
>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>> >> Search the archives: 
>>> https://groups.google.com/group/akka-user
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Akka User List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to akka-user+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Akka Team
>> Typesafe - Reactive apps on the JVM
>> Blog: letitcrash.com
>> Twitter: @akkateam
>>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-11 Thread john . vieten
Sorry I found the error so I don't need to post the code. When do you think 
(just roughly) will typesafe publish an updated artificat to maven central?

Am Dienstag, 11. August 2015 11:05:50 UTC+2 schrieb Johannes Rudolph:
>
> Hi John, 
>
> how can we know? You need to share more of your code :) 
>
> Johannes 
>
> On Tue, Aug 11, 2015 at 11:01 AM,  > 
> wrote: 
> > I am using Akka http Test 
> > 
> > HttpRequest request = ... 
> > TestResponse response = appRoute.run(request); 
> > 
> > Unfortunatly TestResponse is null. 
> > I think its because I am getting  the error No such instance method: 
> > 'akka.http.scaladsl.util.FastFuture' 
> > 
> > Did I compile  wrongly? 
> > 
> > 
> > 
> > 
> > Am Dienstag, 11. August 2015 09:49:29 UTC+2 schrieb Johannes Rudolph: 
> >> 
> >> Hi john, 
> >> 
> >> it seems that this is a bug that we thought to be fixed but which has 
> >> reappeared. I filed it as https://github.com/akka/akka/issues/18178 
> >> 
> >> Johannes 
> >> 
> >> On Tuesday, August 11, 2015 at 7:08:44 AM UTC+2, john@gmail.com 
> wrote: 
> >>> 
> >>> Ok I realized that it is in the release-2.3-dev branch. 
> >>> 
> >>> I can create out of the box with sbt package a 2.10 
> >>> akka-http-testkit-experimental_2.10 version. 
> >>> but I need a 2.11 version. 
> >>> 
> >>> Can somebody help? With just java know-how I have no idea how to make 
> a 
> >>> 2.11 package 
> >>> 
> >>> Am Montag, 10. August 2015 23:05:39 UTC+2 schrieb john@gmail.com: 
>  
>  I wanted to use akka.http.javadsl.testkit.JUnitRouteTest. But I can 
> only 
>  find the scala dsl  one in akka-http-testkit-experimental_2.11? 
>  
>  If its not ready can I use the scala one from java? 
> > 
> > -- 
> >>> Read the docs: http://akka.io/docs/ 
> >>> Check the FAQ: 
> >>> http://doc.akka.io/docs/akka/current/additional/faq.html 
> >>> Search the archives: https://groups.google.com/group/akka-user 
> > --- 
> > You received this message because you are subscribed to a topic in the 
> > Google Groups "Akka User List" group. 
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/akka-user/a21kE9wsbq4/unsubscribe. 
> > To unsubscribe from this group and all its topics, send an email to 
> > akka-user+...@googlegroups.com . 
> > To post to this group, send email to akka...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/akka-user. 
> > 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/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Looking for Code example to create akka.http.javadsl.testkitTestResponse

2015-08-11 Thread john . vieten
ok I found out:

return new TestResponse(response,null,null,null){
  public  scala.runtime.Nothing$ fail( String message) { return null;}

  public void assertEquals(int expected, int actual, String message) { }


  public void assertEquals(Object expected, Object actual, String message) 
{ }

  @Override
  public void assertTrue(boolean predicate, String message) {}
   };
}



The "scala.runtime.Nothing$" return type on fail was not obvious to me.
 


Am Dienstag, 11. August 2015 12:24:32 UTC+2 schrieb john@gmail.com:
>
> I am extending  
>
> akka.http.javadsl.testkit.RouteTest.
>
> In one of the methods I need to return a TestResponse.
>
>  How can I do this with java 
>
> public TestResponse createTestResponse(HttpResponse response) {
>
>return new TestResponse(response,null,null,null);
> }
>
>
> does not work?
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Looking for Code example to create akka.http.javadsl.testkitTestResponse

2015-08-11 Thread john . vieten
I am extending  

akka.http.javadsl.testkit.RouteTest.

In one of the methods I need to return a TestResponse.

 How can I do this with java 

public TestResponse createTestResponse(HttpResponse response) {

   return new TestResponse(response,null,null,null);
}


does not work?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-11 Thread john . vieten


I am using Akka http Test

HttpRequest request = ...
TestResponse response = appRoute.run(request);

Unfortunatly TestResponse is null.
I think its because I am getting the error No such instance method: 
'akka.http.scaladsl.util.FastFuture'

Did I compile wrongly?




Am Dienstag, 11. August 2015 09:49:29 UTC+2 schrieb Johannes Rudolph:
>
> Hi john,
>
> it seems that this is a bug that we thought to be fixed but which has 
> reappeared. I filed it as https://github.com/akka/akka/issues/18178
>
> Johannes
>
> On Tuesday, August 11, 2015 at 7:08:44 AM UTC+2, john@gmail.com wrote:
>>
>> Ok I realized that it is in the release-2.3-dev branch.
>>
>> I can create out of the box with sbt package a 2.10  
>> akka-http-testkit-experimental_2.10 
>> version.
>> but I need a 2.11 version.
>>
>> Can somebody help? With just java know-how I have no idea how to make a 
>> 2.11 package 
>>
>> Am Montag, 10. August 2015 23:05:39 UTC+2 schrieb john@gmail.com:
>>>
>>> I wanted to use akka.http.javadsl.testkit.JUnitRouteTest. But I can only 
>>> find the scala dsl  one in akka-http-testkit-experimental_2.11?
>>>
>>> If its not ready can I use the scala one from java? 
>>>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-11 Thread john . vieten


I am using Akka http Test

HttpRequest request = ...
TestResponse response = appRoute.run(request);

Unfortunatly TestResponse is null.
I think its because I am getting the error No such instance method: 
'akka.http.scaladsl.util.FastFuture'

Did I compile wrongly?



Am Dienstag, 11. August 2015 09:49:29 UTC+2 schrieb Johannes Rudolph:
>
> Hi john,
>
> it seems that this is a bug that we thought to be fixed but which has 
> reappeared. I filed it as https://github.com/akka/akka/issues/18178
>
> Johannes
>
> On Tuesday, August 11, 2015 at 7:08:44 AM UTC+2, john@gmail.com wrote:
>>
>> Ok I realized that it is in the release-2.3-dev branch.
>>
>> I can create out of the box with sbt package a 2.10  
>> akka-http-testkit-experimental_2.10 
>> version.
>> but I need a 2.11 version.
>>
>> Can somebody help? With just java know-how I have no idea how to make a 
>> 2.11 package 
>>
>> Am Montag, 10. August 2015 23:05:39 UTC+2 schrieb john@gmail.com:
>>>
>>> I wanted to use akka.http.javadsl.testkit.JUnitRouteTest. But I can only 
>>> find the scala dsl  one in akka-http-testkit-experimental_2.11?
>>>
>>> If its not ready can I use the scala one from java? 
>>>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-11 Thread john . vieten
thanx for replying!. ha I managed to compile myself a 2.11 version! no 
problem. 

Am Dienstag, 11. August 2015 09:49:29 UTC+2 schrieb Johannes Rudolph:
>
> Hi john,
>
> it seems that this is a bug that we thought to be fixed but which has 
> reappeared. I filed it as https://github.com/akka/akka/issues/18178
>
> Johannes
>
> On Tuesday, August 11, 2015 at 7:08:44 AM UTC+2, john@gmail.com wrote:
>>
>> Ok I realized that it is in the release-2.3-dev branch.
>>
>> I can create out of the box with sbt package a 2.10  
>> akka-http-testkit-experimental_2.10 
>> version.
>> but I need a 2.11 version.
>>
>> Can somebody help? With just java know-how I have no idea how to make a 
>> 2.11 package 
>>
>> Am Montag, 10. August 2015 23:05:39 UTC+2 schrieb john@gmail.com:
>>>
>>> I wanted to use akka.http.javadsl.testkit.JUnitRouteTest. But I can only 
>>> find the scala dsl  one in akka-http-testkit-experimental_2.11?
>>>
>>> If its not ready can I use the scala one from java? 
>>>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-10 Thread john . vieten
Ok I realized that it is in the release-2.3-dev branch.

I can create out of the box with sbt package a 2.10  
akka-http-testkit-experimental_2.10 
version.
but I need a 2.11 version.

Can somebody help? With just java know-how I have no idea how to make a 
2.11 package 

Am Montag, 10. August 2015 23:05:39 UTC+2 schrieb john@gmail.com:
>
> I wanted to use akka.http.javadsl.testkit.JUnitRouteTest. But I can only 
> find the scala dsl  one in akka-http-testkit-experimental_2.11?
>
> If its not ready can I use the scala one from java? 
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-10 Thread john . vieten
I wanted to use akka.http.javadsl.testkit.JUnitRouteTest. But I can only 
find the scala dsl  one in akka-http-testkit-experimental_2.11?

If its not ready can I use the scala one from java? 

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Is this the correct flow to retrieve bytes from an HttpResponse?

2015-08-04 Thread john . vieten
i think I need to wait for https://github.com/akka/akka/issues/15089

Am Donnerstag, 30. Juli 2015 08:18:18 UTC+2 schrieb john@gmail.com:
>
> // this is part of a BidiFlow
>
> FlowShape, RequestResult>,
>   Tuple2>
>   bottom =
>   b.graph(Flow., Object>>empty().
> mapAsync(4, pair ->
> getEntityBytes(pair._1().get(), pair._2(), 
> materializer)
> ).map((pair) -> new Tuple2<>(pair._1(), pair._2(;
>
>
>
> static Future>
>getEntityBytes( final HttpResponse response,
>final Object requestResult,
>final ActorMaterializer materializer) {
>
>return response.entity().getDataBytes().runFold(
>  new Tuple2(ByteString.empty(),requestResult),
>  (aggr, next) -> new Tuple2(aggr._1().concat(next),aggr._2()), 
> materializer);
> }
>
>
>
>
>
> What looks a little funny to me is that I need to pass a materializer to 
> the inner flow?
>
> I am a little unsure because the docs Modularity, Composition and 
> Hierarchy state:
> "It is rarely useful to embed a closed graph shape in a larger graph"
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Do I need a InputStreamSink to deal with response.get().entity().getDataBytes()?

2015-08-02 Thread john . vieten
The end result of my stream is a Pair, CustomContext>

In the Sink I now want to parse the Source into Json (with a library with 
needs an InputStream).  I also need in the Sink a reference 
to CustomContext.

I looked in Akka and found a OutputStreamSink which I think I can use as a 
blueprint for my InputStreamSink. 

(But I don't see a easy way of getting in the Sink a reference to 
CustomContext)

Since it seems some work I am asking is this the right way? Or is there 
some easier solution?



-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Can I share a mutable "Context object" between flows?

2015-08-01 Thread john . vieten
no each stage or flow needs to add data to it. 

Like 
class Context{
  String severPath;
  ByteString jsonBody
  Object result;
}

For example I have a http-redirect-Flow which might change the serverPath 
and fork back  to another flow.   In the sink I check with the serverPath 
if a change happened


Am Samstag, 1. August 2015 14:09:28 UTC+2 schrieb √:
>
> if you have a clean handoff: no reading or writing to it once it is passed 
> downstream, then it should work just fine.
>
> -- 
> Cheers,
> √
> On 1 Aug 2015 12:19, > wrote:
>
>> I simplifies my stream if I use a mutable Context Object (one per 
>> request) which gets created in the source and passed to the  flows and 
>> finally arrives out at the  sink.
>> Does this violate any concurrency rules? This context object will only be 
>> mutated  inside the stream stages.
>>
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Can I share a mutable "Context object" between flows?

2015-08-01 Thread john . vieten
Do I need to make any fields of this Context Object volatile. Since the 
different stages will likely be executed by different aka dispatcher 
threads? 

Am Samstag, 1. August 2015 12:19:45 UTC+2 schrieb john@gmail.com:
>
> I simplifies my stream if I use a mutable Context Object (one per request) 
> which gets created in the source and passed to the  flows and finally 
> arrives out at the  sink.
> Does this violate any concurrency rules? This context object will only be 
> mutated  inside the stream stages.
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Can I share a mutable "Context object" between flows?

2015-08-01 Thread john . vieten
I simplifies my stream if I use a mutable Context Object (one per request) 
which gets created in the source and passed to the  flows and finally 
arrives out at the  sink.
Does this violate any concurrency rules? This context object will only be 
mutated  inside the stream stages.

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How split a flow?

2015-07-30 Thread john . vieten
How do I split a flow? 
For example if I have a Source of ints that I want to split in even and 
uneven. Do I have to connect it to a graph(Broadcast.create(2)) and then 
filter on each of out channels?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Is this the correct flow to retrieve bytes from an HttpResponse?

2015-07-30 Thread john . vieten

yeah the streams api has really taken me (-: it reminds me of flow 
programming or go blocks or clojure async
Am Donnerstag, 30. Juli 2015 13:41:22 UTC+2 schrieb √:
>
> Happy hAkking!
>
> -- 
> Cheers,
> √
> On 30 Jul 2015 12:25, > wrote:
>
>> I think you may be showing me an  error in my design.
>> the HttpResponse contains json which I then decode back to java Objects.
>> These json payloads will never be 4 gb more 500kb - 10MB but I could be 
>> receiveing a lot concurrently which could add up
>> I need to find a way to avoid folding with 
>>
>> response.entity().getDataBytes().runFold
>> 
>>
>>
>> Am Donnerstag, 30. Juli 2015 12:04:21 UTC+2 schrieb √:
>>>
>>> so if the user sends 4gb you want to load it all into memory and crash 
>>> the jvm? :-)
>>>
>>> What's the use-case where you can't stream it?
>>>
>>> -- 
>>> Cheers,
>>> √
>>> On 30 Jul 2015 10:31,  wrote:
>>>
 the usecase is getting a "complete"  ByteString from a from 
 HttpResponse.

 I joinded a BidiFlow ( above code shows this BidiFlows bottom channel) 
 with Http.get().cachedHostConnectionPool() Flow

 Am Donnerstag, 30. Juli 2015 08:54:22 UTC+2 schrieb √:
>
> What's the use-case?
>
> -- 
> Cheers,
> √
> On 30 Jul 2015 08:18,  wrote:
>
>> // this is part of a BidiFlow
>>
>> FlowShape, RequestResult>,
>>   Tuple2>
>>   bottom =
>>   b.graph(Flow., Object>>empty().
>> mapAsync(4, pair ->
>> getEntityBytes(pair._1().get(), pair._2(), 
>> materializer)
>> ).map((pair) -> new Tuple2<>(pair._1(), pair._2(;
>>
>>
>>
>> static Future>
>>getEntityBytes( final HttpResponse response,
>>final Object requestResult,
>>final ActorMaterializer materializer) {
>>
>>return response.entity().getDataBytes().runFold(
>>  new Tuple2(ByteString.empty(),requestResult),
>>  (aggr, next) -> new Tuple2(aggr._1().concat(next),aggr._2()), 
>> materializer);
>> }
>>
>>
>>
>>
>>
>> What looks a little funny to me is that I need to pass a materializer 
>> to the inner flow?
>>
>> I am a little unsure because the docs Modularity, Composition and 
>> Hierarchy state:
>> "It is rarely useful to embed a closed graph shape in a larger graph"
>>
>>  -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: 
>> https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to akka-user+...@googlegroups.com.
>> To post to this group, send email to akka...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
> 

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Is this the correct flow to retrieve bytes from an HttpResponse?

2015-07-30 Thread john . vieten
I think you may be showing me an  error in my design.
the HttpResponse contains json which I then decode back to java Objects.
These json payloads will never be 4 gb more 500kb - 10MB but I could be 
receiveing a lot concurrently which could add up
I need to find a way to avoid folding with 

response.entity().getDataBytes().runFold



Am Donnerstag, 30. Juli 2015 12:04:21 UTC+2 schrieb √:
>
> so if the user sends 4gb you want to load it all into memory and crash the 
> jvm? :-)
>
> What's the use-case where you can't stream it?
>
> -- 
> Cheers,
> √
> On 30 Jul 2015 10:31, > wrote:
>
>> the usecase is getting a "complete"  ByteString from a from HttpResponse.
>>
>> I joinded a BidiFlow ( above code shows this BidiFlows bottom channel) 
>> with Http.get().cachedHostConnectionPool() Flow
>>
>> Am Donnerstag, 30. Juli 2015 08:54:22 UTC+2 schrieb √:
>>>
>>> What's the use-case?
>>>
>>> -- 
>>> Cheers,
>>> √
>>> On 30 Jul 2015 08:18,  wrote:
>>>
 // this is part of a BidiFlow

 FlowShape, RequestResult>,
   Tuple2>
   bottom =
   b.graph(Flow., Object>>empty().
 mapAsync(4, pair ->
 getEntityBytes(pair._1().get(), pair._2(), 
 materializer)
 ).map((pair) -> new Tuple2<>(pair._1(), pair._2(;



 static Future>
getEntityBytes( final HttpResponse response,
final Object requestResult,
final ActorMaterializer materializer) {

return response.entity().getDataBytes().runFold(
  new Tuple2(ByteString.empty(),requestResult),
  (aggr, next) -> new Tuple2(aggr._1().concat(next),aggr._2()), 
 materializer);
 }





 What looks a little funny to me is that I need to pass a materializer 
 to the inner flow?

 I am a little unsure because the docs Modularity, Composition and 
 Hierarchy state:
 "It is rarely useful to embed a closed graph shape in a larger graph"

  -- 
 >> Read the docs: http://akka.io/docs/
 >> Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
 >> Search the archives: 
 https://groups.google.com/group/akka-user
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Akka User List" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to akka-user+...@googlegroups.com.
 To post to this group, send email to akka...@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.

>>> 

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] what happens when I use a supervison strategie Resume or Restart on a pool flow?

2015-07-30 Thread john . vieten
when I have in my flow 

 Http.get(system).cachedHostConnectionPool(..) or Http().superPool(...);

If I define on the whole flow a error supervison strategie,

Lets say a connection failed or timeout error happens.

1) what happens if I return Supervision.Resume?
2) what happens if I return Supervision.Restart?

I am wondering what happens to the maybe in use connections of the pool?
If I use restart will the connection be droped

many greetings

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Is this the correct flow to retrieve bytes from an HttpResponse?

2015-07-30 Thread john . vieten
the usecase is getting a "complete"  ByteString from a from HttpResponse.

I joinded a BidiFlow ( above code shows this BidiFlows bottom channel) 
with Http.get().cachedHostConnectionPool() Flow

Am Donnerstag, 30. Juli 2015 08:54:22 UTC+2 schrieb √:
>
> What's the use-case?
>
> -- 
> Cheers,
> √
> On 30 Jul 2015 08:18, > wrote:
>
>> // this is part of a BidiFlow
>>
>> FlowShape, RequestResult>,
>>   Tuple2>
>>   bottom =
>>   b.graph(Flow., Object>>empty().
>> mapAsync(4, pair ->
>> getEntityBytes(pair._1().get(), pair._2(), 
>> materializer)
>> ).map((pair) -> new Tuple2<>(pair._1(), pair._2(;
>>
>>
>>
>> static Future>
>>getEntityBytes( final HttpResponse response,
>>final Object requestResult,
>>final ActorMaterializer materializer) {
>>
>>return response.entity().getDataBytes().runFold(
>>  new Tuple2(ByteString.empty(),requestResult),
>>  (aggr, next) -> new Tuple2(aggr._1().concat(next),aggr._2()), 
>> materializer);
>> }
>>
>>
>>
>>
>>
>> What looks a little funny to me is that I need to pass a materializer to 
>> the inner flow?
>>
>> I am a little unsure because the docs Modularity, Composition and 
>> Hierarchy state:
>> "It is rarely useful to embed a closed graph shape in a larger graph"
>>
>>  -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Is this the correct flow to retrieve bytes from an HttpResponse?

2015-07-29 Thread john . vieten


// this is part of a BidiFlow

FlowShape, RequestResult>,
  Tuple2>
  bottom =
  b.graph(Flow., Object>>empty().
mapAsync(4, pair ->
getEntityBytes(pair._1().get(), pair._2(), materializer)
).map((pair) -> new Tuple2<>(pair._1(), pair._2(;



static Future>
   getEntityBytes( final HttpResponse response,
   final Object requestResult,
   final ActorMaterializer materializer) {

   return response.entity().getDataBytes().runFold(
 new Tuple2(ByteString.empty(),requestResult),
 (aggr, next) -> new Tuple2(aggr._1().concat(next),aggr._2()), 
materializer);
}





What looks a little funny to me is that I need to pass a materializer to 
the inner flow?

I am a little unsure because the docs Modularity, Composition and Hierarchy 
state:
"It is rarely useful to embed a closed graph shape in a larger graph"

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-07-28 Thread john . vieten
Hi,
I  can get do

PathMatcher a = PathMatchers.longValue();

Can I also get a String like with the following pseudo-code?

PathMatcher b = PathMatchers.stringValue();

so b would match "test111" in  /service/test111/car




-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-07-27 Thread john . vieten
or am I supposed to use Marshallers.toEntity() but this seems quite a lot 
of work 

Am Montag, 27. Juli 2015 10:14:52 UTC+2 schrieb john@gmail.com:
>
> How do I create an Unmarshaller / Marshaller  which deserializes and 
> serializes java objects with java?
> *(unfortuneatly my scala* is  so bad so its not easy for me to translate 
> akka.http.javadsl.marshallers.jackson.Jackson.scala into java)
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-07-27 Thread john . vieten
or asked differently how do translate this class to java 

https://github.com/akka/akka/blob/release-2.3-dev/akka-http-marshallers-java/akka-http-jackson/src/main/scala/akka/http/javadsl/marshallers/jackson/Jackson.scala


Am Montag, 27. Juli 2015 10:14:52 UTC+2 schrieb john@gmail.com:
>
> How do I create an Unmarshaller / Marshaller  which deserializes and 
> serializes java objects with java?
> *(unfortuneatly my scala* is  so bad so its not easy for me to translate 
> akka.http.javadsl.marshallers.jackson.Jackson.scala into java)
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2015-07-27 Thread john . vieten
How do I create an Unmarshaller / Marshaller  which deserializes and 
serializes java objects with java?
*(unfortuneatly my scala* is  so bad so its not easy for me to translate 
akka.http.javadsl.marshallers.jackson.Jackson.scala into java)

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Does an Event Bus have an order?

2015-07-22 Thread john . vieten
I am trying to understand the "Event Bus" abstraction.
I am looking  into LookupEventBus. Why do I need to implement 
compareSubscribers?
Will the Subscribers receive the Event in the compareSubscribers order?
If I am using Actors as Subscribers can I implement a custom ActorRef 
compareTo method?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How can a stream connect to an actor?

2015-07-21 Thread john . vieten
so actor stream integration always uses futures?

I am doing now:




Source> serverSource =
  Http.get(system).bind("192.3.7.1", 8080 , materializer);
final Function> requestHandler =
  (request)->ask(actor, request, 1000l).mapTo(classTag(HttpResponse.class));




Future serverBindingFuture =
  serverSource.to(Sink.foreach(
new Procedure() {
  
   public void apply(IncomingConnection connection) throws 
Exception {
  connection.handleWith(Flow.of(HttpRequest.class)
.mapAsync(4, requestHandler), materializer);
   }
})).run(materializer);




Am Dienstag, 21. Juli 2015 12:00:51 UTC+2 schrieb Konrad Malawski:
>
> +1
>
> for
>
> mapAsync + ask 
>
> :-)
>
> -- 
> Cheers,
> Konrad 'ktoso’ Malawski
> Akka  @ Typesafe 
>
> On 21 July 2015 at 11:59:41, Viktor Klang (viktor...@gmail.com 
> ) wrote:
>
> mapAsync + ask?
>
> On Tue, Jul 21, 2015 at 11:53 AM, > 
> wrote:
>
>> In the  code example 
>> http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/java/stream-io.html
>>  
>> 
>> connection.handleWith(echo, mat);
>>
>> I would like a Actor to intercept the echo msg (maybe add a token to it)
>> How can this be done?
>>
>>
>>
>>  --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  
>
>
> --
>Cheers,
>  √
>   --
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ: 
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to akka-user+...@googlegroups.com .
> To post to this group, send email to akka...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How can a stream connect to an actor?

2015-07-21 Thread john . vieten
In the  code example 
http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/java/stream-io.html
 

connection.handleWith(echo, mat);

I would like a Actor to intercept the echo msg (maybe add a token to it)
How can this be done?



-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How scalable is this akka.io tcp client server integration?

2015-07-13 Thread john . vieten
I just read some docs about sockets and  found out if client and server are 
on different machines the ports are reused as much as possible.
this is in contrast to running client and server on the same machine where 
the client won't pick the same port number as before.
So there is not much to be worried about.


Am Montag, 13. Juli 2015 21:38:59 UTC+2 schrieb john@gmail.com:
>
> although I appreciate the reminder of the config. It doesn't help me with 
> my question.
>
> I am not concerned with the accepting server side but with  the outgoing 
> client side.
> please forgive me if I am overlooking something obvious in the config.
>
> Am Montag, 13. Juli 2015 21:29:35 UTC+2 schrieb √:
>>
>> John
>>
>> See the tcp section of the configuration,
>>
>>
>>1. tcp {
>>2.  
>>3. # The number of selectors to stripe the served channels over; each 
>>of
>>4. # these will use one select loop on the selector-dispatcher.
>>5. nr-of-selectors = 1
>>6.  
>>7. # Maximum number of open channels supported by this TCP module; 
>>there is
>>8. # no intrinsic general limit, this setting is meant to enable DoS
>>9. # protection by limiting the number of concurrently connected 
>>clients.
>>10. # Also note that this is a "soft" limit; in certain cases the 
>>implementation
>>11. # will accept a few connections more or a few less than the 
>>number configured
>>12. # here. Must be an integer > 0 or "unlimited".
>>13. max-channels = 256000
>>14.  
>>15. # When trying to assign a new connection to a selector and the 
>>chosen
>>16. # selector is at full capacity, retry selector choosing and 
>>assignment
>>17. # this many times before giving up
>>18. selector-association-retries = 10
>>19.  
>>20. # The maximum number of connection that are accepted in one go,
>>21. # higher numbers decrease latency, lower numbers increase 
>>fairness on
>>22. # the worker-dispatcher
>>23. batch-accept-limit = 10
>>24.  
>>25. # The number of bytes per direct buffer in the pool used to read 
>>or write
>>26. # network data from the kernel.
>>27. direct-buffer-size = 128 KiB
>>28.  
>>29. # The maximal number of direct buffers kept in the direct buffer 
>>pool for
>>30. # reuse.
>>31. direct-buffer-pool-limit = 1000
>>32.  
>>33. # The duration a connection actor waits for a `Register` message 
>>from
>>34. # its commander before aborting the connection.
>>35. register-timeout = 5s
>>36.  
>>37. # The maximum number of bytes delivered by a `Received` message. 
>>Before
>>38. # more data is read from the network the connection actor will 
>>try to
>>39. # do other work.
>>40. # The purpose of this setting is to impose a smaller limit than 
>>the 
>>41. # configured receive buffer size. When using value 'unlimited' it 
>>will
>>42. # try to read all from the receive buffer.
>>43. max-received-message-size = unlimited
>>44.  
>>45. # Enable fine grained logging of what goes on inside the 
>>implementation.
>>46. # Be aware that this may log more than once per message sent to 
>>the actors
>>47. # of the tcp implementation.
>>48. trace-logging = off
>>49.  
>>50. # Fully qualified config path which holds the dispatcher 
>>configuration
>>51. # to be used for running the select() calls in the selectors
>>52. selector-dispatcher = "akka.io.pinned-dispatcher"
>>53.  
>>54. # Fully qualified config path which holds the dispatcher 
>>configuration
>>55. # for the read/write worker actors
>>56. worker-dispatcher = "akka.actor.default-dispatcher"
>>57.  
>>58. # Fully qualified config path which holds the dispatcher 
>>configuration
>>59. # for the selector management actors
>>60. management-dispatcher = "akka.actor.default-dispatcher"
>>61.  
>>62. # Fully qualified config path which holds the dispatcher 
>>configuration
>>63. # on which file IO tasks are scheduled
>>64. file-io-dispatcher = "akka.actor.default-dispatcher"
>>65.  
>>66. # The maximum number of bytes (or "unlimited") to transfer in one 
>>batch
>>67. # when using `WriteFile` command which uses 
>>`FileChannel.transferTo` to
>>68. # pipe files to a TCP socket. On some OS like Linux 
>>`FileChannel.transferTo`
>>69. # may block for a long time when network IO is faster than file 
>>IO.
>>70. # Decreasing the value may improve fairness while increasing may 
>>improve
>>71. # throughput.
>>72. file-io-transferTo-limit = 512 KiB
>>73.  
>>74. # The number of times to retry the `finishConnect` call after 
>>being notified about
>>75. # OP_CONNECT. Retries are needed if the OP_CONNECT notification 
>>doesn't imply that
>>76. # `finishConnect` will succeed, which is the case on Android.
>> 

Re: [akka-user] How scalable is this akka.io tcp client server integration?

2015-07-13 Thread john . vieten
although I appreciate the reminder of the config. It doesn't help me with 
my question.

I am not concerned with the accepting server side but with  the outgoing 
client side.
please forgive me if I am overlooking something obvious in the config.

Am Montag, 13. Juli 2015 21:29:35 UTC+2 schrieb √:
>
> John
>
> See the tcp section of the configuration,
>
>
>1. tcp {
>2.  
>3. # The number of selectors to stripe the served channels over; each 
>of
>4. # these will use one select loop on the selector-dispatcher.
>5. nr-of-selectors = 1
>6.  
>7. # Maximum number of open channels supported by this TCP module; 
>there is
>8. # no intrinsic general limit, this setting is meant to enable DoS
>9. # protection by limiting the number of concurrently connected 
>clients.
>10. # Also note that this is a "soft" limit; in certain cases the 
>implementation
>11. # will accept a few connections more or a few less than the number 
>configured
>12. # here. Must be an integer > 0 or "unlimited".
>13. max-channels = 256000
>14.  
>15. # When trying to assign a new connection to a selector and the 
>chosen
>16. # selector is at full capacity, retry selector choosing and 
>assignment
>17. # this many times before giving up
>18. selector-association-retries = 10
>19.  
>20. # The maximum number of connection that are accepted in one go,
>21. # higher numbers decrease latency, lower numbers increase fairness 
>on
>22. # the worker-dispatcher
>23. batch-accept-limit = 10
>24.  
>25. # The number of bytes per direct buffer in the pool used to read 
>or write
>26. # network data from the kernel.
>27. direct-buffer-size = 128 KiB
>28.  
>29. # The maximal number of direct buffers kept in the direct buffer 
>pool for
>30. # reuse.
>31. direct-buffer-pool-limit = 1000
>32.  
>33. # The duration a connection actor waits for a `Register` message 
>from
>34. # its commander before aborting the connection.
>35. register-timeout = 5s
>36.  
>37. # The maximum number of bytes delivered by a `Received` message. 
>Before
>38. # more data is read from the network the connection actor will try 
>to
>39. # do other work.
>40. # The purpose of this setting is to impose a smaller limit than 
>the 
>41. # configured receive buffer size. When using value 'unlimited' it 
>will
>42. # try to read all from the receive buffer.
>43. max-received-message-size = unlimited
>44.  
>45. # Enable fine grained logging of what goes on inside the 
>implementation.
>46. # Be aware that this may log more than once per message sent to 
>the actors
>47. # of the tcp implementation.
>48. trace-logging = off
>49.  
>50. # Fully qualified config path which holds the dispatcher 
>configuration
>51. # to be used for running the select() calls in the selectors
>52. selector-dispatcher = "akka.io.pinned-dispatcher"
>53.  
>54. # Fully qualified config path which holds the dispatcher 
>configuration
>55. # for the read/write worker actors
>56. worker-dispatcher = "akka.actor.default-dispatcher"
>57.  
>58. # Fully qualified config path which holds the dispatcher 
>configuration
>59. # for the selector management actors
>60. management-dispatcher = "akka.actor.default-dispatcher"
>61.  
>62. # Fully qualified config path which holds the dispatcher 
>configuration
>63. # on which file IO tasks are scheduled
>64. file-io-dispatcher = "akka.actor.default-dispatcher"
>65.  
>66. # The maximum number of bytes (or "unlimited") to transfer in one 
>batch
>67. # when using `WriteFile` command which uses 
>`FileChannel.transferTo` to
>68. # pipe files to a TCP socket. On some OS like Linux 
>`FileChannel.transferTo`
>69. # may block for a long time when network IO is faster than file IO.
>70. # Decreasing the value may improve fairness while increasing may 
>improve
>71. # throughput.
>72. file-io-transferTo-limit = 512 KiB
>73.  
>74. # The number of times to retry the `finishConnect` call after 
>being notified about
>75. # OP_CONNECT. Retries are needed if the OP_CONNECT notification 
>doesn't imply that
>76. # `finishConnect` will succeed, which is the case on Android.
>77. finish-connect-retries = 5
>78.  
>79. # On Windows connection aborts are not reliably detected unless an 
>OP_READ is
>80. # registered on the selector _after_ the connection has been 
>reset. This
>81. # workaround enables an OP_CONNECT which forces the abort to be 
>visible on Windows.
>82. # Enabling this setting on other platforms than Windows will cause 
>various failures
>83. # and undefined behavior.
>84. # Possible values of this key are on, off and au

[akka-user] How scalable is this akka.io tcp client server integration?

2015-07-13 Thread john . vieten
I am using basically the java client from 
http://doc.akka.io/docs/akka/2.3.12/java/io-tcp.html (public class Client 
extends UntypedActor)
to integrate  to an akka tcp backend on another machine.

Since the client is also a server it will be creating many short-lived  tcp 
client outgoing connections. 
like:
 127.0.0.1:5695 -> backend:99
 127.0.0.1:5696 -> backend:99
  
  127.0.0.1:7696 -> backend:99

I am a little worried that I may have problems with port exhaustion .
The code  is running on a  Linux box.

Does somebody have a similar setup in production? What are you experiences 
so far? 
 

  

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Do I need to take into account that the int might arrive in srveral ByteStrings?

2015-07-13 Thread john . vieten
when receiving a message from a akka.io TCP connection:

.match(Tcp.Received.class, msg -> {
ByteString data = msg.data();
}

Is there any  garantee on the min amount of bytes transfered. 
I am asking because I am implementing a prefix length protocol. 
And the first part of the message is a length int.

Do I need to take into account that the int might arrive in serveral 
ByteStrings?

Does anybody have any sample code in java?
 


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Is there any akka contrib or pattern which can split and join large payload messages?

2015-07-11 Thread john . vieten
actually I realised that some work has been done:
like 
https://github.com/sourcedelica/akka/blob/wip-3842-message-sequence-pattern-ericp/akka-contrib/src/main/scala/akka/contrib/pattern/MessageSequence.scala

but as I get deeper into akka I think the best way is not to slice messages 
(since the slices will also jam the single tcp connection that aka uses for 
all remoteing )
I ended up using   Akka IO for these big payload messages. 

Although it does complicate error handling.
My application is clustered and I first need to use messaging to find the 
right Akka IO server and then deserialize my messages.  
Anyway its only a  small  price  and Akka IO is awesome   



Am Freitag, 10. Juli 2015 19:55:58 UTC+2 schrieb john@gmail.com:
>
> Right now I am using the maximum-frame-size to allow large message 
> payloads.
> Is there any akka lib which can "transparently" on one side split and on 
> the other side join such a message? 
>
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Is there any akka contrib or pattern which can split and join large payload messages?

2015-07-10 Thread john . vieten
Right now I am using the maximum-frame-size to allow large message payloads.
Is there any akka lib which can "transparently" on one side split and on 
the other side join such a message? 


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Could somebody explain what "avoid inbound connections from other cluster nodes" means?

2015-07-09 Thread john . vieten
here is the 
code 
https://github.com/akka/akka/blob/master/akka-cluster-tools/src/main/scala/akka/cluster/client/ClusterClient.scala#L523
 
https://github.com/akka/akka/blob/master/akka-cluster-tools/src/main/scala/akka/cluster/client/ClusterClient.scala#L612
I don't see why it is necessary to wrap the client in a tunnel actor other 
than setting a timeout. How does the tunnel protect the client?
whats wrong with pubSubMediator.tell(msg, sender())

Am Donnerstag, 9. Juli 2015 19:23:15 UTC+2 schrieb john@gmail.com:
>
> In http://doc.akka.io/docs/akka/2.3.0/contrib/cluster-client.html there 
> is following sentence:
>
> "Response messages from the destination actor are tunneled via the 
> receptionist to avoid inbound connections from other cluster nodes to the 
> client"
>
> Could somebody explain why this is necessary? I am struggling with the 
> phrase "avoid inbound connections"
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Could somebody explain what "avoid inbound connections from other cluster nodes" means?

2015-07-09 Thread john . vieten
In http://doc.akka.io/docs/akka/2.3.0/contrib/cluster-client.html there is 
following sentence:

"Response messages from the destination actor are tunneled via the 
receptionist to avoid inbound connections from other cluster nodes to the 
client"

Could somebody explain why this is necessary? I am struggling with the 
phrase "avoid inbound connections"

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: How can I be notified if a message send to ClusterClient cannot be delivered because that cluster is down?

2015-07-09 Thread john . vieten
I looked at scala source code and see that  when no backend connection 
exists the message is stashed. 
So I guess my only option is to work with a receive timeout on the sender 
of the message...

Am Donnerstag, 9. Juli 2015 11:54:57 UTC+2 schrieb john@gmail.com:
>
> If the cluster backend goes down the clusterclient from now on logs 
> "Association with remote system [akka.tcp://Cluster@127.0.0.1:8098] has 
> failed, address is now gated"
>
> I would expect a message that is now send to the ClusterClient to be 
> forwarded to death letters. But this doesn't happen.
> How can I get notified that this message cannot be delivered?
>
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How can I be notified if a message send to ClusterClient cannot be delivered because that cluster is down?

2015-07-09 Thread john . vieten
If the cluster backend goes down the clusterclient from now on logs 
"Association with remote system [akka.tcp://Cluster@127.0.0.1:8098] has 
failed, address is now gated"

I would expect a message that is now send to the ClusterClient to be 
forwarded to death letters. But this doesn't happen.
How can I get notified that this message cannot be delivered?


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How forgiving can my cluster fail over detector be?

2015-07-03 Thread john . vieten
In my akka cluster I see that the fail over detector often "downs" nodes. 

This happens because sometimes  I have
A)  too much load from other processes or
B) simply my actors are under heavy load (proably bad programming (-:)

How can I configure my fail-over detector so that A) will not be considered 
a unreachable condition?

Are there any best practices in configuring and what are the most important 
config params?

Can I use a  config like for example gate a node only after 2 mins 
unreachable?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How-to create a resilient cluster?

2015-07-01 Thread john . vieten
Hi,
my applicataion consists of two front end akka processes which forward 
messages to 5 backend nodes.

The frontend actors use  ConstantHashingRouting to devide work to the 
backened nodes.

If any backend nodes become "unreachable" I would like the backends not 
only to be auto-removed (I know this is possible through config) but
also I would like a new backend node to be automatically added to the 
cluster so that I allways have min 5 backend nodes running.

Are there any akka backend tools which help me achieve this scenario?

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] how do I use the scala repl to inspect a "in java written" actor system.

2015-06-29 Thread john . vieten
Sorry that  I know so little about scala. 
I have written a java akka system which uses maven for dependeny management.

I would now like to inspect my configuration (Typesafe Config Library 
) with a scala repl. 
This is described in 
http://doc.akka.io/docs/akka/2.3.11/general/configuration.html 
"Logging of Configuration"


How do I import my jar into the scala repl so that I can inspect with the 
repl my cofig?



-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


  1   2   >