[akka-user] akka-cluster split brain when enable auto-down and set a node random package loss rate 50%

2016-07-21 Thread Yutao Shuai
  In a 5-node cluster, hypothesis the nodes is A,B,C,D,E. All nodes monitor 
each other, enable auto-down,  and we  set the node-A random package loss 
rate 50%,  after a period of time, the cluster 
  will divide into two or more clusters. How can I fix this problem?

-- 
>>  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 http client only excecute the `max-connections` times ~

2016-07-21 Thread lzc6
thanks for your reply ~
i changed my code like this , it works well when i set the `max-connections 
= 10`

```

(1 to 500).foreach{idx=>
  val futureResponse = 
Source.single(httpRequest->1).via(poolFlow).runWith(Sink.head).map(_._1).flatMap(Future.fromTry)
  futureResponse.andThen{
case Success(response) =>
  *response.entity.dataBytes.runWith(Sink.ignore)*
  println(s"${atomicLong.incrementAndGet()} -> 
${Thread.currentThread().getName} ")
case Failure(e) =>
  e.printStackTrace()
  println(s"error ${e.getMessage}")
  }

```

but when i enlarge the `max-connections = 100` ,  the errors occured again, 
only 2/3 of the request was excuted ~

the debug exception info as belows:

```
[DEBUG] [07/22/2016 10:21:31.279] 
[httpClient-akka.actor.default-dispatcher-15] 
[akka://httpClient/user/SlotProcessor-53] Slot 53 disconnected after 
java.util.concurrent.TimeoutException: No elements passed in the last 1 
minute.
[DEBUG] [07/22/2016 10:21:31.279] 
[httpClient-akka.actor.default-dispatcher-7] 
[akka://httpClient/user/StreamSupervisor-0/flow-78-0-unknown-operation] 
Aborting tcp connection because of upstream failure: No elements passed in 
the last 1 minute.
akka.stream.impl.Timers$IdleTimeoutBidi$$anon$7.onTimer(Timers.scala:160)
akka.stream.stage.TimerGraphStageLogic.akka$stream$stage$TimerGraphStageLogic$$onInternalTimer(GraphStage.scala:1125)
akka.stream.stage.TimerGraphStageLogic$$anonfun$akka$stream$stage$TimerGraphStageLogic$$getTimerAsyncCallback$1.apply(GraphStage.scala:1114)
akka.stream.stage.TimerGraphStageLogic$$anonfun$akka$stream$stage$TimerGraphStageLogic$$getTimerAsyncCallback$1.apply(GraphStage.scala:1114)
akka.stream.impl.fusing.GraphInterpreter.runAsyncInput(GraphInterpreter.scala:572)
akka.stream.impl.fusing.GraphInterpreterShell.receive(ActorGraphInterpreter.scala:419)
akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:603)
akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:618)
akka.actor.Actor$class.aroundReceive(Actor.scala:484)
akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:529)
akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
akka.actor.ActorCell.invoke(ActorCell.scala:495)
akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
akka.dispatch.Mailbox.run(Mailbox.scala:224)
akka.dispatch.Mailbox.exec(Mailbox.scala:234)
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
```

Another info to be mentioned , as begining,everything works well as 
expected, 100 request was excuted at once . 
but after that ,  the output is more and more slower, the following diagram 
show that the threads was blocked ~
i want to know what cause this ~

thanks again ~





在 2016年7月21日星期四 UTC+8下午4:10:58,Konrad Malawski写道:
>
> You're not using the data you've requested, thus stalling the connections. 
> This is by design. Akka HTTP is a *streaming* HTTP Client.
>
> Please read the docs about this: 
> http://doc.akka.io/docs/akka/2.4/scala/http/implications-of-streaming-http-entity.html
>
>
> -- 
> Konrad `ktoso` Malawski
> Akka  @ Lightbend 
>
> On 21 July 2016 at 10:09:56, lz...@vip.qq.com  (
> lz...@vip.qq.com ) wrote:
>
>
> *When I use the pool-client to issue some requests, *
>
> *the program seems only execute only 10 times ,just the value of 
> `max-connections` ,*
>
> *the remaining 90 requests didn't execute at all;*
>
> *And after a while, *
>
> *the connection in the connection pool are closed ,no more connection alive ~*
>
>
> *i don't know what happended, thansk for your help ~*
>
>
>
> ```the scala code ~
>
> val poolFlow = Http().newHostConnectionPool[Int]("www.baidu.com")
>
> (1 to 100).foreach{idx=>
>   val futureResponse = 
> Source.single(httpRequest->1).via(poolFlow).runWith(Sink.head).map(_._1).flatMap(Future.fromTry)
>   futureResponse.andThen{
> case Success(_) =>
>   println(s"${atomicLong.incrementAndGet()} -> 
> ${Thread.currentThread().getName} ")
> case Failure(e) =>
>   e.printStackTrace()
>   println(s"error ${e.getMessage}")
>   }
>
> }
>
> ```
>
>
> the application.conf
>
> ```
>
> http {
>   host-connection-pool {
> max-connections = 10
> min-connections = 10
> max-retries = 0
> max-open-requests = 1048576
>   }
> }
>
> ```
>
>
> 
>
> the output :
>
> ```
>
> after pool ~
> after execute !
> 1 -> httpClient-akka.actor.default-dispatcher-2  
> 4 -> 

[akka-user] Akka auto-down and akka-cluster split brain

2016-07-21 Thread Yutao Shuai
In a 5-node cluster, hypothesis the nodes is A,B,C,D,E. All nodes monitor 
each other, enable auto-down,  and we  set the node-A random package loss 
rate 50%,  after a period of time, all nodes  in the cluster will restart. 
The result we expect is one or two nodes restart, how can I fix this 
problem?

-- 
>>  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: Akka Cluster + Leveldb : Persistence failure when replaying events for ...

2016-07-21 Thread Manoj Santhakumaran
Hi Patrik,

Thank you very much for your reply.

Correct me if I'm wrong. By "single point of failure" what I meant was, in 
case of any failure in the primary node, the events which is not yet 
persisted in the leveldb will be lost. But the events which is already 
persisted should be available in the leveldb (since it is in disk file). 
The leveldb store is shared by second node in the cluster through NFS 
mount. When primary is down, cann't we start the "SharedLeveldbStore" in 
the second node on receipt of "MemberRemoved/MemberExited" cluster events?

Thanks,
Manoj

On Wednesday, 20 July 2016 23:37:55 UTC-7, Patrik Nordwall wrote:
>
> SharedLeveldbJournal is not resillient. It's a single point of failure 
> since it is only running on one node. It's only intended for demo examples. 
> Please use a real distributed jounal, such as akka-persistence-cassandra
>
> /Patrik
> tors 21 juli 2016 kl. 01:24 skrev Manoj Santhakumaran  >:
>
>> Hi All,
>>
>> Today I analyzed by consuming cluster events.
>> When first node is down, I got only an UnreachableMember event. I was 
>> expecting a MemberRemoved or MemberExited event after UnreachableMember. Is 
>> that correct? I didn't get either of them.
>>
>> Is this because I have only two nodes in the cluster and no one alive in 
>> first node to send out a MemberRemoved or MemberExited?
>>
>> I have attached here the logs of node 2 when node 1 goes down.
>>
>> Any suggestions/pointers on how we can enable proper fail-over when 
>> primary node crashed?
>>
>> Thanks and regards,
>> Manoj
>>
>>
>>
>> On Tuesday, 19 July 2016 13:05:55 UTC-7, Manoj Santhakumaran wrote:
>>>
>>> Hi All,
>>>
>>> I'm facing following problem with my Akka cluster environment which has 
>>> two nodes, and Akka persistence using leveldb-journal.
>>>
>>> Both nodes are started with "ClusterSingletonManager" and 
>>> "ClusterSingletonProxy". My "UntypedPersistentActor" is started as 
>>> "ClusterClientReceptionist". In my first node, I'm starting the 
>>> "SharedLeveldbStore" and setting that by 
>>> "SharedLeveldbJournal.setStore(...)" call. But in second node, I'm only 
>>> setting "SharedLeveldbJournal.setStore(..)" of the first node when starts 
>>> up.
>>>
>>> When both nodes are running, everything works fine.
>>>
>>> But when the first node died, I was expecting the second node takes up 
>>> the charge and replay the persisted events. But it is throwing following 
>>> exception in the logs and became zombie (process is running but not doing 
>>> its job). I noticed that the "postStop" event handler of my 
>>> "UntypedPersistentActor" is called after this error.
>>>
>>> ERROR | 2016-07-19 11:37:24 | 
>>> [ClusterSystem-akka.actor.default-dispatcher-18] ? - 
>>> [sourceThread=ClusterSystem-akka.actor.default-dispatcher-18, 
>>> sourceActorSystem=ClusterSystem, 
>>> akkaSource=akka.tcp://ClusterSystem@hostname2:2552/user/master/singleton, 
>>> akkaTimestamp=18:37:24.195UTC] - Persistence failure when replaying events 
>>> for persistenceId [master]. Last known sequence number [0]
>>> akka.pattern.CircuitBreaker$$anon$1: Circuit Breaker Timed out.
>>>
>>> My environment : Play (2.4.0), Akka (2.4.4), Akka Persistence (2.3.9), 
>>> Leveldb (0.7), Leveldb-Jni (1.8)
>>>
>>> My application.conf have following cluster configuration.
>>>
>>>   extensions = ["akka.cluster.client.ClusterClientReceptionist"]
>>>   cluster {
>>>   seed-nodes = [
>>> "akka.tcp://ClusterSystem@hostname1:2551",
>>> "akka.tcp://ClusterSystem@hostname2:2552"]
>>>   }
>>>   persistence {
>>> journal.plugin = "akka.persistence.journal.leveldb-shared"
>>> journal.leveldb-shared.store {
>>>   # This is non-prod
>>>   native = off
>>>   dir = "/shared-vol1/leveldb-journal"
>>> }
>>> snapshot-store.plugin = "akka.persistence.snapshot-store.local"
>>> snapshot-store.local.dir = "target/snapshots"
>>>   }
>>>
>>> I appreciate any solution/suggestion/pointer to resolve this issue.
>>>
>>> Thank you very much.
>>> Manoj
>>>
>>> -- 
>> >> 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 

Re: [akka-user] Configurable parallelism/elastic groupBy

2016-07-21 Thread Richard Rodseth
Or perhaps you are talking about something like

http://doc.akka.io/docs/akka/2.4.8/scala/stream/stream-cookbook.html#Balancing_jobs_to_a_fixed_pool_of_workers

but using the Partition stage instead of Balance

http://doc.akka.io/api/akka/2.4.7/?_ga=1.10841340.933910455.1454640777#akka.stream.scaladsl.Partition

which does not appear to be documented here

http://doc.akka.io/docs/akka/2.4.8/scala/stream/stages-overview.html#Fan-out_stages

On Thu, Jul 21, 2016 at 10:00 AM, Richard Rodseth 
wrote:

> Thanks. That gives me some terms to Google, but any further pointers
> welcome. I see references to FlexiRoute being replaced by GraphStage.
> Presumably that's what I need to study next?
>
> On Thu, Jul 21, 2016 at 12:59 AM, Viktor Klang 
> wrote:
>
>> A routing stage with consistent hashing and then a N-Way merge to insert
>> into db?
>>
>> --
>> Cheers,
>> √
>>
>> On Jul 20, 2016 9:09 PM, "Richard Rodseth"  wrote:
>>
>>> I'm sure I've asked this before in numerous ways, but it's still an
>>> issue for me.
>>>
>>> I have an ETL stream that reads per-channel data and writes it to a
>>> destination without backpressure. Within a channel, order of writes must be
>>> preserved. So I want parallelism between channels, but not within.
>>>
>>> If I groupBy by channel, I can't control the degree of parallelism  and
>>> the destination is overwhelmed.
>>> Should I make an ActorSubscriber for the write, that backpressures
>>> (based on an integer value) and use alsoTo on the SubFlow?
>>>
>>> Any way to achieve this with standard components?
>>>
>>> --
>>> >> 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.
>>>
>> --
>> >> 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.
>>
>
>

-- 
>>  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] Pass Future to Sink.ignore, how do I know it's completed

2016-07-21 Thread Gary Struthers
My Sink receives a Future. I don't want to do anything with it so I use 
Sink.ignore but then I don't know when it's completed and that I need to 
know. Should I write a custom Sink or does the API already have a solution 
for this?

Gary

-- 
>>  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: Make HTTPS request using akka-http to jenkins server

2016-07-21 Thread Ajinkya Shukla
The jenkins server has a self signed certificate which is not trusted by 
akka-http. I downloaded the certificate and placed it in the project 
directory. Following is the certificate config

ssl-config.ssl {

  trustManager = {
stores = [
  { type = "PEM", path = "globalsign.crt" }
]
  }
}

How can i use the config in the above code ?


On Wednesday, July 20, 2016 at 9:33:02 AM UTC-4, Konrad Malawski wrote:
>
> Pretty sure there's a stack trace there though?
> What happens on default settnigs – dont manually set the JVM default 
> context.
>
> -- 
> Konrad `ktoso` Malawski
> Akka  @ Lightbend 
>
> On 20 July 2016 at 14:13:39, Ajinkya Shukla (ajinkya...@gmail.com 
> ) wrote:
>
> I get the following exception in DEBUG mode.
>
> disconnected after javax.net.ssl.SSLHandshakeException: General SSLEngine 
> problem
>
> On Wednesday, July 20, 2016 at 8:01:04 AM UTC-4, Ajinkya Shukla wrote: 
>>
>> How can i make the following HTTPS request using akka-http to a jenkins 
>> server? 
>>
>> curl -v -k --user "$USERNAME:$API_TOKEN" https://HOSTNAME.com/api/json
>>
>> The curl produces the following HTTPS request:
>>
>> Connected to HOST.com
>> * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
>> * Server certificate: Default Company Ltd
>> * Server auth using Basic with user 'USERNAME'
>> > GET /api/json HTTP/1.1
>> > Host: HOSTNAME
>> > Authorization: Basic API_TOKEN
>> > User-Agent: curl/7.43.0
>> > Accept: */*
>>
>> However I am not able to make the above request using akka-http. I get a 
>> SSL certificate error. Here is my code:
>>
>>
>> import javax.net.ssl.SSLContext
>>
>> import akka.actor.{Actor, ActorLogging, ActorSystem}
>> import akka.http.scaladsl.model._
>> import akka.http.scaladsl.model.headers.{Authorization, 
>> BasicHttpCredentials}
>> import akka.http.scaladsl.{Http, HttpsConnectionContext}
>> import akka.stream.{ActorMaterializer, ActorMaterializerSettings, 
>> Materializer}
>> import akka.util.ByteString
>> import com.typesafe.sslconfig.akka.AkkaSSLConfig
>> import com.typesafe.sslconfig.ssl.{SSLConfigSettings, SSLParametersConfig}
>>
>> import scala.concurrent.Future
>>
>> class Main extends Actor
>>   with ActorLogging {
>>
>>   import akka.pattern.pipe
>>   import context.dispatcher
>>
>>   implicit val system = ActorSystem("HelloSystem")
>>
>>   final implicit val materializer: ActorMaterializer = 
>> ActorMaterializer(ActorMaterializerSettings(context.system))
>>
>>   val modernHttpsConnectionContext: HttpsConnectionContext = new 
>> HttpsConnectionContext(
>> SSLContext.getDefault,
>> enabledProtocols = Some("TLSv1.2" :: "TLSv1.1" :: Nil)
>>   )
>>
>>   class HttpClientSingleCustomHttps(connectionContext: 
>> HttpsConnectionContext)
>>(implicit val system: ActorSystem, val 
>> mat: Materializer) {
>> def sendHttpReq(req: HttpRequest): Future[HttpResponse] =
>>   Http().singleRequest(req, connectionContext = 
>> connectionContext).pipeTo(self)
>>   }
>>
>>   override def preStart() = {
>> log.info("Making request")
>> val client = new 
>> HttpClientSingleCustomHttps(modernHttpsConnectionContext)
>> val jenkinsRequest: HttpRequest = HttpRequest(
>>   uri = "https://HOSTNAME.com/api/json;,
>>   headers = List(
>> Authorization(BasicHttpCredentials("USERNAME","PASSWORD"))
>>   )
>> )
>> client.sendHttpReq(jenkinsRequest)
>>   }
>>
>>   def receive = {
>> case HttpResponse(StatusCodes.OK, headers, entity, _) =>
>>   log.info("Got response, body: " + 
>> entity.dataBytes.runFold(ByteString(""))(_ ++ _))
>> case HttpResponse(code, _, _, _) =>
>>   log.info("Request failed, response code: " + code)
>>   }
>>
>> }
>>
>> --
> >> 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 

[akka-user] Retry only has meaning for restart in SuperVisorStragety?

2016-07-21 Thread Yan Pei
Hello,

   From the doc and my testing, looks like "retry only is meaningful if I 
want to restart the Actor? For resume() it will not apply the retry? Do I 
understand it correctly?

Thanks,
Yan

-- 
>>  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: Akka Java IO TLS

2016-07-21 Thread Vinay Gajjala
After rethinking and researching was wondering if I can configure/code the 
netty API which Akka uses to achieve the TLS. I am now sure how efficient 
is this. Any help would be greatly appreciated

Thanks
Vinay

On Monday, July 18, 2016 at 11:13:33 AM UTC-5, Vinay Gajjala wrote:
>
> Hi 
>
> I am a newbie in Akka and I implemented a TCP server which listens to 
> device traffic. I have searched online and could not find any concrete 
> examples of how to configure TLS using Akka IO.
>
> I am not sure if I am missing the obvious.
>
> Thanks in advance,
> Vinay
>

-- 
>>  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] Question about fork-join with actors

2016-07-21 Thread Justin du coeur
There are a lot of ways you *could* slice this, but the most
straightforward is the simple Actor-per-request model.  Actors are fairly
lightweight, so it's sometimes worthwhile to just stand one up for a
complex request like this.  So you instantiate an Actor in charge of
managing the authorization process; that sends out the requests to the
various SecurityProvider workers, and collates the requests.  If any come
back negative, it immediately responds negative; if they all return
positive, it responds positive.

In practice, I would typically expect to have a Session Actor that is
managing the interactions for a particular User; that could often handle
this responsibility.

On Thu, Jul 21, 2016 at 3:33 AM, Nader Aeinehchi 
wrote:

> I have a classic question: how to fork some work and then join the results.
>
> Let me explain the problem:
>
> There is a security manager that asks several security providers (e.g.
> Active Directory, Tivoli, Mainframe) if a given call is authorized.  If all
> the security providers say "yes", the call is authorized. But if at least
> one of the security providers says "no", the called is denied.
>
> In the context of parallelism, a call to each of security providers is
> delegated to a worker (securityProvider).  Workers need to work in parallel.
>
> If one of the workers says "no", there is no point waiting for the answer
> from other workers. Then security mangager should immediately answer "no".
>
> Note that the application is multi-user.  Therefore, each fork-join should
> be related to some correlation id, e.g. a requestId.
>
> I would like to know how the above problem can be solved using actors.
> Let me assert that my motivations with actors is the fault-tolerance
> ability that actor model offers.
>
> In advance thank you very much.
>
> Nader
>
> 
>
> type AccessRequest = Tuple2[RequestId, Payload]
>
>   def isAuthorized(accessRequest: AccessRequest): AccessDecision = {
>
> var decision: AccessDecision = No
>
> val loop = new Breaks
> loop.breakable {
>   for (securityProvider <- securityProviders.values) {
>
> val newDecision = securityProvider.check(accessRequest)
>
> if (newDecision == No)) {
>   loop.break
> }
>
> decision = newDecision
>
>   }
> }
> decision
>   }
> 
>
>
> --
> >> 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.
>

-- 
>>  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: Akka Cluster + Leveldb : Persistence failure when replaying events for ...

2016-07-21 Thread Justin du coeur
Just an observation: this is a common enough point of confusion that I
actually think y'all might want to consider removing the LevelDB default.
As I recently discovered, it's almost ridiculously easy to boot up a local
Cassandra development "cluster" using ccm .
 (With zero Cassandra knowledge, I got it up and running with Akka
Persistence in something like 15 minutes.)  You might want to use that as
the recommended default to start with instead...

On Thu, Jul 21, 2016 at 2:37 AM, Patrik Nordwall 
wrote:

> SharedLeveldbJournal is not resillient. It's a single point of failure
> since it is only running on one node. It's only intended for demo examples.
> Please use a real distributed jounal, such as akka-persistence-cassandra
>
> /Patrik
>
> tors 21 juli 2016 kl. 01:24 skrev Manoj Santhakumaran <
> manojnai...@gmail.com>:
>
>> Hi All,
>>
>> Today I analyzed by consuming cluster events.
>> When first node is down, I got only an UnreachableMember event. I was
>> expecting a MemberRemoved or MemberExited event after UnreachableMember. Is
>> that correct? I didn't get either of them.
>>
>> Is this because I have only two nodes in the cluster and no one alive in
>> first node to send out a MemberRemoved or MemberExited?
>>
>> I have attached here the logs of node 2 when node 1 goes down.
>>
>> Any suggestions/pointers on how we can enable proper fail-over when
>> primary node crashed?
>>
>> Thanks and regards,
>> Manoj
>>
>>
>>
>> On Tuesday, 19 July 2016 13:05:55 UTC-7, Manoj Santhakumaran wrote:
>>>
>>> Hi All,
>>>
>>> I'm facing following problem with my Akka cluster environment which has
>>> two nodes, and Akka persistence using leveldb-journal.
>>>
>>> Both nodes are started with "ClusterSingletonManager" and
>>> "ClusterSingletonProxy". My "UntypedPersistentActor" is started as
>>> "ClusterClientReceptionist". In my first node, I'm starting the
>>> "SharedLeveldbStore" and setting that by
>>> "SharedLeveldbJournal.setStore(...)" call. But in second node, I'm only
>>> setting "SharedLeveldbJournal.setStore(..)" of the first node when starts
>>> up.
>>>
>>> When both nodes are running, everything works fine.
>>>
>>> But when the first node died, I was expecting the second node takes up
>>> the charge and replay the persisted events. But it is throwing following
>>> exception in the logs and became zombie (process is running but not doing
>>> its job). I noticed that the "postStop" event handler of my
>>> "UntypedPersistentActor" is called after this error.
>>>
>>> ERROR | 2016-07-19 11:37:24 |
>>> [ClusterSystem-akka.actor.default-dispatcher-18] ? -
>>> [sourceThread=ClusterSystem-akka.actor.default-dispatcher-18,
>>> sourceActorSystem=ClusterSystem,
>>> akkaSource=akka.tcp://ClusterSystem@hostname2:2552/user/master/singleton,
>>> akkaTimestamp=18:37:24.195UTC] - Persistence failure when replaying events
>>> for persistenceId [master]. Last known sequence number [0]
>>> akka.pattern.CircuitBreaker$$anon$1: Circuit Breaker Timed out.
>>>
>>> My environment : Play (2.4.0), Akka (2.4.4), Akka Persistence (2.3.9),
>>> Leveldb (0.7), Leveldb-Jni (1.8)
>>>
>>> My application.conf have following cluster configuration.
>>>
>>>   extensions = ["akka.cluster.client.ClusterClientReceptionist"]
>>>   cluster {
>>>   seed-nodes = [
>>> "akka.tcp://ClusterSystem@hostname1:2551",
>>> "akka.tcp://ClusterSystem@hostname2:2552"]
>>>   }
>>>   persistence {
>>> journal.plugin = "akka.persistence.journal.leveldb-shared"
>>> journal.leveldb-shared.store {
>>>   # This is non-prod
>>>   native = off
>>>   dir = "/shared-vol1/leveldb-journal"
>>> }
>>> snapshot-store.plugin = "akka.persistence.snapshot-store.local"
>>> snapshot-store.local.dir = "target/snapshots"
>>>   }
>>>
>>> I appreciate any solution/suggestion/pointer to resolve this issue.
>>>
>>> Thank you very much.
>>> Manoj
>>>
>>> --
>> >> 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.
>>
> --
> >> 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 

Re: [akka-user] Configurable parallelism/elastic groupBy

2016-07-21 Thread Richard Rodseth
Thanks. That gives me some terms to Google, but any further pointers
welcome. I see references to FlexiRoute being replaced by GraphStage.
Presumably that's what I need to study next?

On Thu, Jul 21, 2016 at 12:59 AM, Viktor Klang 
wrote:

> A routing stage with consistent hashing and then a N-Way merge to insert
> into db?
>
> --
> Cheers,
> √
>
> On Jul 20, 2016 9:09 PM, "Richard Rodseth"  wrote:
>
>> I'm sure I've asked this before in numerous ways, but it's still an issue
>> for me.
>>
>> I have an ETL stream that reads per-channel data and writes it to a
>> destination without backpressure. Within a channel, order of writes must be
>> preserved. So I want parallelism between channels, but not within.
>>
>> If I groupBy by channel, I can't control the degree of parallelism  and
>> the destination is overwhelmed.
>> Should I make an ActorSubscriber for the write, that backpressures (based
>> on an integer value) and use alsoTo on the SubFlow?
>>
>> Any way to achieve this with standard components?
>>
>> --
>> >> 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.
>>
> --
> >> 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.
>

-- 
>>  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] What is ProtocolStateActor.invoke and why is it so time consuming?

2016-07-21 Thread kraythe
We have been doing load tests on our development environment to isolate out 
slow operations in our system. One of the endpoints that NewRelic reported 
taking lots of time is ProtocolStateActor.invoke. The output is provided in 
the attached, redacted for NDA reasons, screenshot. Can anyone tell me what 
this is and why it appears to be consuming so much time? I am wondering if 
I am doing something wrong or if I just have everything so heavily 
optimized that this thing is showing up.



-- 
>>  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] Error about download akka proj from github and open it as a proj in intellij

2016-07-21 Thread Leo Wolf
By the way, the error shows this message:




Very thanks for the help!


Leo Wolf於 2016年7月21日星期四 UTC+8下午6時46分13秒寫道:
>
> Hi Konrad,
>
> Thank you for getting back to me.
> I have create a scala test file under Akka-http-sprayjson and the path is 
> "/akka/akka-http-marshallers-scala/akka-http-spray-json/src/main/scala/akka/http/scaladsl/marshallers/sprayjson/UploadHandler.scala",
>  
> and package it as package akka.http.scaladsl.marshallers.sprayjson
> , but some strange error shown:
>
>
> 
>
> But the whole same scala file in a new project using sbt to include the 
> normal akka library , I mean something like "com.typesafe.akka" %% 
> "akka-http-experimental" 
> % akkaVer withSources() withJavadoc(),is OK:
>
>
> 
>
>
>
> And I do not really know why these errors occurred...
>
>
>
> Konrad Malawski於 2016年7月21日星期四 UTC+8下午4時25分16秒寫道:
>>
>> Hi Leo,
>> what PR are you working on?
>>
>> But I found out there are lots of errors in build.sbt in every directory. 
>> For instance,
>>
>> For the most part you can ignore these if intellij doesn't pick them up.
>>
>> The import into intellij from sbt feature works properly.
>>
>> And, I create a test.scala in akka.http.scaladsl.server.Directives, but 
>> I found out I can't import akka.http.scaladsl.marshallers.sprayjson because 
>> I can't find the directory below the menu:
>>
>>
>> 
>>
>>
>> "Akka-http" does not depend on "Akka-http-sprayjson", so it's not 
>> available there.
>> "Akka-http-sprayjson" does depend on "Akka HTTP" though, so in that 
>> project you have all you need to write your test.scala
>>
>> Hope this helps
>>
>> -- konrad
>>
>

-- 
>>  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] Error about download akka proj from github and open it as a proj in intellij

2016-07-21 Thread Leo Wolf
Hi Konrad,

Thank you for getting back to me.
I have create a scala test file under Akka-http-sprayjson and the path is 
"/akka/akka-http-marshallers-scala/akka-http-spray-json/src/main/scala/akka/http/scaladsl/marshallers/sprayjson/UploadHandler.scala",
 
and package it as package akka.http.scaladsl.marshallers.sprayjson
, but some strange error shown:



But the whole same scala file in a new project using sbt to include the 
normal akka library , I mean something like "com.typesafe.akka" %% 
"akka-http-experimental" 
% akkaVer withSources() withJavadoc(),is OK:





And I do not really know why these errors occurred...



Konrad Malawski於 2016年7月21日星期四 UTC+8下午4時25分16秒寫道:
>
> Hi Leo,
> what PR are you working on?
>
> But I found out there are lots of errors in build.sbt in every directory. 
> For instance,
>
> For the most part you can ignore these if intellij doesn't pick them up.
>
> The import into intellij from sbt feature works properly.
>
> And, I create a test.scala in akka.http.scaladsl.server.Directives, but I 
> found out I can't import akka.http.scaladsl.marshallers.sprayjson because 
> I can't find the directory below the menu:
>
>
> 
>
>
> "Akka-http" does not depend on "Akka-http-sprayjson", so it's not 
> available there.
> "Akka-http-sprayjson" does depend on "Akka HTTP" though, so in that 
> project you have all you need to write your test.scala
>
> Hope this helps
>
> -- konrad
>

-- 
>>  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: akka-http web socket issue

2016-07-21 Thread Konrad Malawski
Yes it works. What's wrong about Streamed?
That's a feature that it's streaming the data – consume it using the
dataBytes contained in the Streamed message.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 21 July 2016 at 10:45:03, allobi...@gmail.com (allobi...@gmail.com)
wrote:

does this work when receiving large json data..? i have problem receiving
large json data because sometimes it returns TextMessage.Streamed instead
of TextMessage.Strict and another issue is when connecting to wss://
s2.ripple.com:443 i can't connect using this url but can connect to other
websocket servers..

On Thursday, July 7, 2016 at 6:34:02 AM UTC+8, Eric Swenson wrote:
>
> I wrote a simple python client:
>
> $ cat ws-test.py
> import os
> from websocket import create_connection
>
> eiid=os.getenv("EIID")
> token=os.getenv("BEARER_TOKEN")
> header="Authorization: Bearer %s" % token
> ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid,
> header=[header])
> while True:
> x = ws.recv()
> print(x)
>
> And used it with my server.  It does not disconnect and correctly responds
> to all messages sent by the server.  So that rules out problems with the
> akka-http-based server.  it would appear that the issue is with the
> akka-http client (whose code I got from this web page:
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>
>
> Is there some reason why this code does not work?  As mentioned
> previously, the code connects, retrieves and displays one message sent by
> the server just after connection, and then promptly disconnects the
> websocket connection.
>
> Are there known issues with client-side web socket support in 2.4.7?
>
> — Eric
>
> --
>> 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.

-- 
>>  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: akka-http web socket issue

2016-07-21 Thread allobiano
does this work when receiving large json data..? i have problem receiving 
large json data because sometimes it returns TextMessage.Streamed instead 
of TextMessage.Strict and another issue is when connecting 
to wss://s2.ripple.com:443 i can't connect using this url but can connect 
to other websocket servers..

On Thursday, July 7, 2016 at 6:34:02 AM UTC+8, Eric Swenson wrote:
>
> I wrote a simple python client:
>
> $ cat ws-test.py
> import os
> from websocket import create_connection
>
> eiid=os.getenv("EIID")
> token=os.getenv("BEARER_TOKEN")
> header="Authorization: Bearer %s" % token
> ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid, 
> header=[header])
> while True:
> x = ws.recv()
> print(x)
>
> And used it with my server.  It does not disconnect and correctly responds 
> to all messages sent by the server.  So that rules out problems with the 
> akka-http-based server.  it would appear that the issue is with the 
> akka-http client (whose code I got from this web page:
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>
>
> Is there some reason why this code does not work?  As mentioned 
> previously, the code connects, retrieves and displays one message sent by 
> the server just after connection, and then promptly disconnects the 
> websocket connection.
>
> Are there known issues with client-side web socket support in 2.4.7?
>
> — Eric
>
>

-- 
>>  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: akka-http web socket issue

2016-07-21 Thread allobiano
does this work when receiving large json data ?

On Thursday, July 7, 2016 at 6:34:02 AM UTC+8, Eric Swenson wrote:
>
> I wrote a simple python client:
>
> $ cat ws-test.py
> import os
> from websocket import create_connection
>
> eiid=os.getenv("EIID")
> token=os.getenv("BEARER_TOKEN")
> header="Authorization: Bearer %s" % token
> ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid, 
> header=[header])
> while True:
> x = ws.recv()
> print(x)
>
> And used it with my server.  It does not disconnect and correctly responds 
> to all messages sent by the server.  So that rules out problems with the 
> akka-http-based server.  it would appear that the issue is with the 
> akka-http client (whose code I got from this web page:
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>
>
> Is there some reason why this code does not work?  As mentioned 
> previously, the code connects, retrieves and displays one message sent by 
> the server just after connection, and then promptly disconnects the 
> websocket connection.
>
> Are there known issues with client-side web socket support in 2.4.7?
>
> — Eric
>
>

-- 
>>  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] Error about download akka proj from github and open it as a proj in intellij

2016-07-21 Thread Konrad Malawski
Hi Leo,
what PR are you working on?

But I found out there are lots of errors in build.sbt in every directory.
For instance,

For the most part you can ignore these if intellij doesn't pick them up.

The import into intellij from sbt feature works properly.

And, I create a test.scala in akka.http.scaladsl.server.Directives, but I
found out I can't import akka.http.scaladsl.marshallers.sprayjson because I
can't find the directory below the menu:




"Akka-http" does not depend on "Akka-http-sprayjson", so it's not available
there.
"Akka-http-sprayjson" does depend on "Akka HTTP" though, so in that project
you have all you need to write your test.scala

Hope this helps

-- konrad

-- 
>>  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] Error about download akka proj from github and open it as a proj in intellij

2016-07-21 Thread Leo Wolf
Hi,

I'm new to akka-proj. I encounter some problems about modify the akka-proj, 
and found you have made some pull request on it so I decide to ask you 
about it.
I have forked the akka-proj, download it, and open it as a project in 
intellij. But I found out there are lots of errors in build.sbt in every 
directory. For instance,

build.sbt in akka proj:



build.sbt in 
akka/akka-http-marshallers-scala/akka-http-spray-json/build.sbt:



And even the line of import akka._ is useless and encounter errors with 
AkkaBuild??


And, I create a test.scala in akka.http.scaladsl.server.Directives, but I 
found out I can't import akka.http.scaladsl.marshallers.sprayjson because I 
can't find the directory below the menu:





I'll very appreciate if you can give me some advices. Thank you for your 
attention to this matter.



-- 
>>  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 http client only excecute the `max-connections` times ~

2016-07-21 Thread Konrad Malawski
You're not using the data you've requested, thus stalling the connections.
This is by design. Akka HTTP is a *streaming* HTTP Client.

Please read the docs about this:
http://doc.akka.io/docs/akka/2.4/scala/http/implications-of-streaming-http-entity.html


-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 21 July 2016 at 10:09:56, l...@vip.qq.com (l...@vip.qq.com) wrote:


*When I use the pool-client to issue some requests, *

*the program seems only execute only 10 times ,just the value of
`max-connections` ,*

*the remaining 90 requests didn't execute at all;*

*And after a while, *

*the connection in the connection pool are closed ,no more connection alive ~*


*i don't know what happended, thansk for your help ~*



```the scala code ~

val poolFlow = Http().newHostConnectionPool[Int]("www.baidu.com")

(1 to 100).foreach{idx=>
  val futureResponse =
Source.single(httpRequest->1).via(poolFlow).runWith(Sink.head).map(_._1).flatMap(Future.fromTry)
  futureResponse.andThen{
case Success(_) =>
  println(s"${atomicLong.incrementAndGet()} ->
${Thread.currentThread().getName} ")
case Failure(e) =>
  e.printStackTrace()
  println(s"error ${e.getMessage}")
  }

}

```


the application.conf

```

http {
  host-connection-pool {
max-connections = 10
min-connections = 10
max-retries = 0
max-open-requests = 1048576
  }
}

```




the output :

```

after pool ~
after execute !
1 -> httpClient-akka.actor.default-dispatcher-2
4 -> httpClient-akka.actor.default-dispatcher-19
5 -> httpClient-akka.actor.default-dispatcher-12
2 -> httpClient-akka.actor.default-dispatcher-13
6 -> httpClient-akka.actor.default-dispatcher-10
3 -> httpClient-akka.actor.default-dispatcher-8
7 -> httpClient-akka.actor.default-dispatcher-13
8 -> httpClient-akka.actor.default-dispatcher-4
9 -> httpClient-akka.actor.default-dispatcher-4
10 -> httpClient-akka.actor.default-dispatcher-15

```


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

-- 
>>  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] A problem ablout Akka cluster brain crack

2016-07-21 Thread Yutao Shuai


Description of the problem:

  In a 3-node cluster, all nodes monitor each other, when a connection 
between two nodes fails, the cluster divide into 3 cluster, every cluster 
have one node. 

 

Example:

For example, In 3-node cluster, the default value of 
monitored-by-nr-of-members is 5, and enable the auto-down, assume the 
cluster nodes is 1-2-3, when the connection between 2 and 3 fails, 2 think 
3 is unreachable, and 3 think is unreachable too. After a period of time, 1 
remove the 2 and 3 from the cluster, because of the connection failure 
between 2 and 3, the cluster divide into three 1-node cluster eventually.


-- 
>>  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] Is Akka the right choice for my simple distributed system?

2016-07-21 Thread Richard Whitehead
I wonder if the community can help me get started.
 
I’m trying to design the architecture of a project and I think that using 
Akka may make sense, but I am completely new to distributed systems and to 
Akka (I am a very experienced developer, but my expertise is image 
processing on Windows!).
 
The task is very simple: call 3 or 4 executables in sequence to process 
some image data.  The data is just a simple image and the processing takes 
tens of minutes.  Each processing step takes an image file in and produces 
an image file out.
 
We are considering a distributed architecture to increase throughput 
(latency does not matter).  So we need a way to queue work on remote 
computers, potentially running more than one pipeline at once, and a way to 
move the data around.  The architecture will have to work on a single 
server, or on a couple of servers in a rack, or in the cloud; 2 or 3 
computers maximum.
 
Being new to all this I would prefer something simple rather than something 
super-powerful.  Certainly I don't want something that will take over the 
project, I want something that does what we tell it rather than the other 
way round.
 
If I'm understanding it, Akka should help with launching the processing 
steps and with getting the data to and from the remote machines / 
containers, is that right?  Would it also help with keeping track of the 
processing pipelines?
 
Huge thanks in advance.

Richard

-- 
>>  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] Configurable parallelism/elastic groupBy

2016-07-21 Thread Viktor Klang
A routing stage with consistent hashing and then a N-Way merge to insert
into db?

-- 
Cheers,
√

On Jul 20, 2016 9:09 PM, "Richard Rodseth"  wrote:

> I'm sure I've asked this before in numerous ways, but it's still an issue
> for me.
>
> I have an ETL stream that reads per-channel data and writes it to a
> destination without backpressure. Within a channel, order of writes must be
> preserved. So I want parallelism between channels, but not within.
>
> If I groupBy by channel, I can't control the degree of parallelism  and
> the destination is overwhelmed.
> Should I make an ActorSubscriber for the write, that backpressures (based
> on an integer value) and use alsoTo on the SubFlow?
>
> Any way to achieve this with standard components?
>
> --
> >> 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.
>

-- 
>>  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] Question about fork-join with actors

2016-07-21 Thread Nader Aeinehchi
I have a classic question: how to fork some work and then join the results.

Let me explain the problem:

There is a security manager that asks several security providers (e.g. 
Active Directory, Tivoli, Mainframe) if a given call is authorized.  If all 
the security providers say "yes", the call is authorized. But if at least 
one of the security providers says "no", the called is denied.

In the context of parallelism, a call to each of security providers is 
delegated to a worker (securityProvider).  Workers need to work in parallel.

If one of the workers says "no", there is no point waiting for the answer 
from other workers. Then security mangager should immediately answer "no".

Note that the application is multi-user.  Therefore, each fork-join should 
be related to some correlation id, e.g. a requestId.

I would like to know how the above problem can be solved using actors.  Let 
me assert that my motivations with actors is the fault-tolerance ability 
that actor model offers.

In advance thank you very much.

Nader



type AccessRequest = Tuple2[RequestId, Payload]

  def isAuthorized(accessRequest: AccessRequest): AccessDecision = {

var decision: AccessDecision = No

val loop = new Breaks
loop.breakable {
  for (securityProvider <- securityProviders.values) {

val newDecision = securityProvider.check(accessRequest)

if (newDecision == No)) {
  loop.break
}

decision = newDecision

  }
}
decision
  }



-- 
>>  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: Akka Cluster + Leveldb : Persistence failure when replaying events for ...

2016-07-21 Thread Patrik Nordwall
SharedLeveldbJournal is not resillient. It's a single point of failure
since it is only running on one node. It's only intended for demo examples.
Please use a real distributed jounal, such as akka-persistence-cassandra

/Patrik
tors 21 juli 2016 kl. 01:24 skrev Manoj Santhakumaran :

> Hi All,
>
> Today I analyzed by consuming cluster events.
> When first node is down, I got only an UnreachableMember event. I was
> expecting a MemberRemoved or MemberExited event after UnreachableMember. Is
> that correct? I didn't get either of them.
>
> Is this because I have only two nodes in the cluster and no one alive in
> first node to send out a MemberRemoved or MemberExited?
>
> I have attached here the logs of node 2 when node 1 goes down.
>
> Any suggestions/pointers on how we can enable proper fail-over when
> primary node crashed?
>
> Thanks and regards,
> Manoj
>
>
>
> On Tuesday, 19 July 2016 13:05:55 UTC-7, Manoj Santhakumaran wrote:
>>
>> Hi All,
>>
>> I'm facing following problem with my Akka cluster environment which has
>> two nodes, and Akka persistence using leveldb-journal.
>>
>> Both nodes are started with "ClusterSingletonManager" and
>> "ClusterSingletonProxy". My "UntypedPersistentActor" is started as
>> "ClusterClientReceptionist". In my first node, I'm starting the
>> "SharedLeveldbStore" and setting that by
>> "SharedLeveldbJournal.setStore(...)" call. But in second node, I'm only
>> setting "SharedLeveldbJournal.setStore(..)" of the first node when starts
>> up.
>>
>> When both nodes are running, everything works fine.
>>
>> But when the first node died, I was expecting the second node takes up
>> the charge and replay the persisted events. But it is throwing following
>> exception in the logs and became zombie (process is running but not doing
>> its job). I noticed that the "postStop" event handler of my
>> "UntypedPersistentActor" is called after this error.
>>
>> ERROR | 2016-07-19 11:37:24 |
>> [ClusterSystem-akka.actor.default-dispatcher-18] ? -
>> [sourceThread=ClusterSystem-akka.actor.default-dispatcher-18,
>> sourceActorSystem=ClusterSystem,
>> akkaSource=akka.tcp://ClusterSystem@hostname2:2552/user/master/singleton,
>> akkaTimestamp=18:37:24.195UTC] - Persistence failure when replaying events
>> for persistenceId [master]. Last known sequence number [0]
>> akka.pattern.CircuitBreaker$$anon$1: Circuit Breaker Timed out.
>>
>> My environment : Play (2.4.0), Akka (2.4.4), Akka Persistence (2.3.9),
>> Leveldb (0.7), Leveldb-Jni (1.8)
>>
>> My application.conf have following cluster configuration.
>>
>>   extensions = ["akka.cluster.client.ClusterClientReceptionist"]
>>   cluster {
>>   seed-nodes = [
>> "akka.tcp://ClusterSystem@hostname1:2551",
>> "akka.tcp://ClusterSystem@hostname2:2552"]
>>   }
>>   persistence {
>> journal.plugin = "akka.persistence.journal.leveldb-shared"
>> journal.leveldb-shared.store {
>>   # This is non-prod
>>   native = off
>>   dir = "/shared-vol1/leveldb-journal"
>> }
>> snapshot-store.plugin = "akka.persistence.snapshot-store.local"
>> snapshot-store.local.dir = "target/snapshots"
>>   }
>>
>> I appreciate any solution/suggestion/pointer to resolve this issue.
>>
>> Thank you very much.
>> Manoj
>>
>> --
> >> 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.
>

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