Re: [akka-user] Akka Unix Domain Socket support interest given code written

2017-11-24 Thread Martynas Mickevičius
Hi,

this looks really cool! I think extracting it to a separate module for
Alpakka is a great idea as well.

On Thu, Nov 23, 2017 at 7:09 AM Christopher Hunt  wrote:

> Hi Akka team,
>
> Over the past week, I've implemented Akka Streams support for Unix Domain
> Sockets by leveraging the JNR library. There's more work to be done and my
> progress can be seen here: https://github.com/huntc/landlord/pull/14 (the
> UnixDomainSocket class itself:
> https://github.com/huntc/landlord/pull/14/files#diff-b745088184322d5d8e53de44d17b9ca6R20).
> The code is complete but I need to provide unit tests which is what I'm now
> doing.
>
> I was wondering if this functionality would be of interest in general and,
> if so, where would the best place be to raise a PR e.g. Akka core, Alpakka
> etc. given consideration to its JNR library dependency (all Apache licensed
> and totaling about 2MB of class files).
>
> Please advise.
>
> Kind regards,
> Christopher
>
> --
> >> 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] Shutdown system when all actors are terminated

2017-11-24 Thread Martynas Mickevičius
Hi,

your approach sounds good. You can also have one parent supervisor actor,
which when sees that all of its children has been stopped, would shut down
the actor system itself.



On Tue, Nov 21, 2017 at 11:23 AM gervais.b  wrote:

> Hello there.
>
> I have a system that I would like to shutdown when all actors are
> terminated. My system contains two supervisors with some of actors for each
> of them.
> The supervisors are watching their children an terminate themselves via a 
> *PoisonPill
> *when there is no more children.
> Some child actors are just executing one command and *PoisonPill*
> themselves after that.
> But I have some actors that send events and expect a response to those
> events. For this case, I have a collection of sent events from which I
> remove the events that have been replied so that I can *PoisonPill *the
> actor when this collection is empty.
>
> That works but I wonder if there is a better way of waiting for all
> responses before doing an action.
>
> 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 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] Http proxy/tuneling with cachedHostConnectionPool

2017-11-24 Thread Martynas Mickevičius
Hi,

the original flow was a flow from HttpRequest to HttpResponse. However the
flow from cachedHostConnectionPool is

Flow[(HttpRequest, T), (Try[HttpResponse], T), ...]

 Here a flow accepts requests with a marker object from that request. And
responses are wrapped in a try and come back together with the original
marker object. Marker objects are provided to correlate responses to
requests. When using connection pool responses for later requests can come
before responses for earlier requests.

Take a look at the documentation and code examples which should help you
get up to speed with the api:

https://doc.akka.io/docs/akka-http/10.0.10/scala/http/client-side/host-level.html#using-a-host-connection-pool

On Tue, Nov 21, 2017 at 10:10 AM Jozsef Zsido  wrote:

> Hi,
>
> I'm trying to expand the following example and replace the flow with
> cachedHostConnectionPool
> https://gist.github.com/rklaehn/3aa3215046df2c0a7795
>
> My problem is that I'm unable to write compilable code:
>
> val flow = Http(system).cachedHostConnectionPool[HttpResponse]("localhost", 
> 56700)
>
> Source.single(context.request)
>   .map {
> _.withHeaders(HttpUtils.completeHeaderList(request))
>   .withUri(request.uri.path.toString())
>   }
>   .map(r => {
> println(r)
> r
>   })
>   .via(flow)
>   .runWith(Sink.head)
>   .flatMap(f => {
> context.complete(f)
>   })
>
>
> What I'm doing wrong?
>
> Thanks,
> Jozsef
>
> --
> >> 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] No source code for the Getting Started Guide on Akka web site??

2017-11-24 Thread Martynas Mickevičius
Hi,

you can find the code here:
https://github.com/akka/akka/tree/f38b928e139a11cb92605b496adf1d76fab60e29/akka-docs/src/test/scala/tutorial_2

On Sun, Nov 19, 2017 at 10:00 PM  wrote:

> Hi, I'm an Akka newbie and try to learn more about it. I go to Akka main
> web site and try to follow the tutorial lessons at:
> https://doc.akka.io/docs/akka/current/java/guide/tutorial.html. However,
> there's only source code for the "Quickstart" guide but there's no source
> code for the IoT Example Use case. (for example, when clicking the source
> code link at the bottom of the tutorial page, which points to:
> https://github.com/akka/akka/tree/master/akka-docs/src/main/paradox/java/guide/tutorial_2.md
> , there's no code there). Please advise. Thank you very much.
>
> Santa.
>
> --
> >> 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] HttpClient is blocking forever

2017-11-24 Thread Martynas Mickevičius
Could it be that the response is really large and the Unmarshaller is just
spending all of the time concatenating really large string?

On Fri, Nov 24, 2017 at 5:03 PM Andrew  wrote:

> Hi,
>
> I'm trying to use akka http to make a api call but it just it just blocks.
> I do see the headers and status print and it's successful in that regard,
> but it blocks on the unmarshal of the body. This is supposed to be json.
> Any ideas?
>
> val fileId = "abc.."
>
>   val request = HttpRequest(
> method = HttpMethods.GET,
> uri = Uri(s"https://www.googleapis.com/drive/v2/files/${fileId}";),
> headers = oauthHeader(token.accessToken)
>   )
>
>   val f = Http().singleRequest(request).flatMap{ httpResponse =>
> log.debug(s"Response status ${httpResponse.status} headers 
> ${httpResponse.headers}")
> Unmarshal(httpResponse.entity).to[String]
>   }
>
>
> val folder = Await.result(*f*, Duration.Inf)
>
>
>
>
>
> --
> >> 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] Akka HTTP Ajax call with parameters

2017-11-24 Thread Martynas Mickevičius
Hi,

here is a simple snippet that does that:

import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.marshalling.Marshaller._
import akka.http.scaladsl.model._
import akka.stream.ActorMaterializer

import scala.concurrent.Future

object HttpClientFormData extends App {

  implicit val sys = ActorSystem("HttpClientFormData")
  implicit val mat = ActorMaterializer()
  implicit val exc = sys.dispatcher

  val uri = Uri("http://localhost:8080/HYzYYhcOxrhIxsezap3U";)
  val data = Map("session.id" -> "123", "name" -> "john")

  val request: Future[HttpRequest] = Marshal((HttpMethods.POST, uri,
FormData(data))).to[HttpRequest]
  val response: Future[HttpResponse] =
request.flatMap(Http().singleRequest(_))
  response.onComplete(println)
}

You can read up on Marshalling

to
get a better feel of how the tuple of the HTTP method, uri and formdata got
converted to HttpRequest.

Also for the HTTPS you will need some additional configuration. You can
find a working HTTPS server and a client example here:
https://github.com/2m/akka-http/commit/6562550ca495cb209b5c05957c2303f99ff7b60c



On Thu, Nov 16, 2017 at 5:56 AM  wrote:

> I am working with a use case where I need to make a call to Azkaban via
> AJAX APi provided by Azkaban which is like
>
> curl -k -X POST --data 
> "session.id=9089beb2-576d-47e3-b040-86dbdc7f523e&name=&description=11"
> https://localhost:8443/manager?action=create
>
> Now how using akka HTTP rest services can I send a payload with --data
> parameter ie --data 
> "session.id=9089beb2-576d-47e3-b040-86dbdc7f523e&name=&description=11"
> part
> what is the proper approach to do this.
>
>
>
>
>
>
> *DISCLAIMER:*
> All the content in email is intended for the recipient and not to be
> published elsewhere without Exadatum consent. And attachments shall be send
> only if required and with ownership of the sender. This message contains
> confidential information and is intended only for the individual named. If
> you are not the named addressee, you should not disseminate, distribute or
> copy this email. Please notify the sender immediately by email if you have
> received this email by mistake and delete this email from your system.
> Email transmission cannot be guaranteed to be secure or error-free, as
> information could be intercepted, corrupted, lost, destroyed, arrive late
> or incomplete, or contain viruses. The sender, therefore, does not accept
> liability for any errors or omissions in the contents of this message which
> arise as a result of email transmission. If verification is required,
> please request a hard-copy version.
>
> --
> >> 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] [HTTP] stream a subpart of another stream

2017-12-04 Thread Martynas Mickevičius
Hi,

judging by the fact that the example of streaming large files using circe
removes the top level object definition (
https://github.com/circe/circe/blob/75061316f210aaf90e12faed5bdda48e105723f4/examples/sf-city-lots/README.md)
I think it is not quite feasible to do what you want currently with circe
(streaming arbitrary nested json structure).

You will have to take a look at event based json parsers. I have played
before with one such marshaller that uses event based parser: ts-reaktive (
https://github.com/Tradeshift/ts-reaktive).

Here is an code example that uses that library to parse responses from
github:
https://github.com/2m/authors/blob/master/core/src/main/scala/GithubProtocol.scala

On Sat, Dec 2, 2017 at 10:53 PM Guillaume  wrote:

> Hi folks,
>
> I'm stuck with an HttpRequest query processing. I try to return a stream
> who contains a subpart of a a REST stream response.  eg:
>
> GET /foo
> =>
> {
>  bar: {},
>  
>  results: [
>   {foo: 1},
>   {foo: 2},
>   {foo: 3},
>   {foo: 4},
>   {foo: 5},
>
>   {foo: 100}
>  ]
> }
>
> What I want to stream :
> [
>   {foo: 1},
>   {foo: 2},
>   {foo: 3},
>   {foo: 4},
>   {foo: 5},
>
>   {foo: 100}
>  ]
>
> My current code use akka-stream-circe and akka-http-circe and looks like :
>
> val request = HttpRequest(uri =
>   Uri(cfg.get[String]("my.endpoint"))
> .withPath(Path("/foo"))
> .withQuery(Query("search" -> "foo"))
> )
>
> Http()
>   .singleRequest(request)
>   .map(response => response.entity.dataBytes.via( 
> CirceStreamSupport.decode[???] )) pipeTo sender
>
>
> Unfortunately, I don't understand  how to configure Jawn with Circe to
> "ignore" all json content except this array... Maybe Akka HTTP module allow
> me to do that out of the box ?
>
> Regards,
>
> --
> >> 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] Terminate system after one-shot message send

2018-01-12 Thread Martynas Mickevičius
Hi,

message send will be indeed in a race with system termination. A better
approach would be to use an ? (ask) and have the actor under `actorUrl` to
send a response when everything is sent and done.

On Thu, Jan 11, 2018 at 7:58 PM Patrick Roemer 
wrote:

> Hi,
>
> I'm triggering a Spark job from a service. I need to communicate the
> job's computation result back to the service. The service has an actor
> system running, anyway, so the idea was to use (remote) actors for this
> channel, too. There's no other use for actors on the Spark side, so
> basically I have this in the Spark runner's main:
>
> 
> val system = ActorSystem("spark-launcher")
> // ...
> val selection = system.actorSelection(actorUrl)
> val actF = selection.resolveOne(3 seconds)
> val resF = actF.map(_ ! result).andThen {
>   case _ => system.terminate()
> }
> Await.ready(resF, 3 seconds)
> 
>
> So far this seemed to work. However, in a test case that duplicates this
> exact behavior in a "mock Spark cluster", I have found that the message
> sometimes, non-deterministically, does not arrive. Logging/debugging
> seems to indicate that the message is actually sent from the
> "spark-launcher" system's deadLetters, it just doesn't make it to the
> other side. My best guess is that there's a race condition between send
> and terminate, terminate "winning" in the failure cases.
>
> I'm aware that Akka does not guarantee message delivery. I just naively
> hoped that upon system termination, it would do a best effort to send
> out pending messages from its queues.
>
> Is my analysis correct/is this expected behavior? Is there any way to
> detect that a message has "really" been sent in order to trigger a
> system shutdown afterwards? Does this approach make any sense at all? Is
> there a better way?
>
> Thanks and best regards,
> Patrick
>
> --
> >>  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] Akka-http directive for running code after response is sent?

2018-01-12 Thread Martynas Mickevičius
Hi,

if you complete a request with a `Source` you can attach cleanup actions
using watchTermination.

On Thu, Jan 11, 2018 at 11:55 PM Daniel Armak  wrote:

> Is there a way to be notified when a response has been sent to the client?
>
> I’d like to cleanup some resources used to produce the response after I
> know it has been sent and that the non-strict HttpEntity I created will not
> be accessed again. After the cleanup runs, trying to materialize the entity
> data stream again would fail.
> The closest approximation I’ve found so far is to use mapRouteResult to
> call response.entity.transformDataBytes and use Flow.concat to run the
> code when the stream has been consumed (or fails). This seems imperfect,
> because it’s possible that the entity will be consumed more than once (in
> other word, the entity stream might be materialized more than once), e.g.
> by a badly coded outer directive. I’m not really worried that this will
> happen (without my tests catching it), but if there’s a better way I’d like
> to know about it.
>
> Thanks,
> ​
> --
> Daniel Armak
>
>
> --
> >> 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] Akka cluster sharding

2018-01-12 Thread Martynas Mickevičius
Hi,

are your Cassandra nodes in one cluster?

On Fri, Jan 12, 2018 at 2:17 PM  wrote:

> Hi
>
> I have just started using Akka and creating a demo application using Akka
> persistence. This application has only one actor persisting event in
> cassandra. I am running this application in docker cluster. Currently I am
> running it in 3 nodes. But the problem I am facing is when I am persisting
> any event, the node which gets hit is update by that event, but other two
> nodes are not getting updated by that event. So when I am fetching the even
> it some times comes blank and some times it fetches the event, depending
> upon which not gets the fetch request. Will cluster sharding help me on
> this. I am not if this is the proper use case of sharding. Kindly suggest
> me a solution on this.
>
> Thanks
> Joy
>
> --
> >> 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] How to build the Akka API documentation for offline use?

2018-02-19 Thread Martynas Mickevičius
Run the unidoc task in sbt. It comes from sbt-unidoc and aggregates the API
docs from all sub-projects to ./target/unidoc/

On Mon, Feb 19, 2018 at 9:45 AM Thai  wrote:

> Hi All,
>
> I noticed that the Akka API doc is unavailable to download like Scala, so
> I git-cloned the akka and ran `doc` in sbt. However the API docs were
> separated like this:
>
> ./akka/akka-cluster-sharding/target/api
> ./akka/akka-contrib/target/api
> ./akka/akka-cluster-tools/target/api
> ./akka/akka-cluster/target/api
> ./akka/akka-agent/target/api
> ./akka/akka-camel/target/api
> ./akka/akka-persistence-tck/target/api
> ./akka/akka-multi-node-testkit/target/api
> ./akka/akka-distributed-data/target/api
> ./akka/akka-cluster-sharding-typed/target/api
> ./akka/akka-stream-testkit/target/api
> ./akka/akka-remote/target/api
> ./akka/akka-cluster-metrics/target/api
> ./akka/akka-protobuf/target/api
> ./akka/akka-persistence-query/target/api
> ./akka/akka-persistence/target/api
> ./akka/akka-testkit-typed/target/api
> ./akka/akka-cluster-typed/target/api
> ./akka/akka-actor-typed/target/api
> ./akka/akka-stream/target/api
> ./akka/akka-osgi/target/api
> ./akka/akka-testkit/target/api
> ./akka/akka-persistence-typed/target/api
>
> Does anybody know how to put them together so that I can have something
> similar to https://doc.akka.io/api/akka/current/akka/actor/index.html?
>
> Regards.
>
> --
> >> 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][deprecated] Re: how to define materialized value

2018-11-04 Thread Martynas Mickevičius
Did you send any elements to the stream? internalCounter is incremented in
the map operator for every incoming stream element.

Trait is only used to hide the implementation details of the counter.

On Thu, Nov 1, 2018 at 12:04 AM  wrote:

> Hi Rafal,
>
> I just stumbled upon your reply. Could you explain why you have to wrap
> the AtomicLong into the Counter trait? I tried returning the naked
> AtomicLong in the 'mapMaterializedValue' function, but the resulting value
> was always 0. Why does wrapping in a trait produce a different result?
>
> Best,
> Jurgis
>
>
> On Sunday, March 6, 2016 at 1:46:12 AM UTC+1, Rafał Krzewski wrote:
>>
>> Hi,
>> there are a few ways of doing that. Probably the simplest one is using
>> Flow.mapMaterializedValue. Suppose you'd like to create a Flow that counts
>> the elements that pass through it and makes the current count available
>> through a "side channel":
>>
>>   trait Counter {
>> def get: Long
>>   }
>>
>>   def counter[T]: Flow[T, T, Counter] = {
>> val internalCounter = new AtomicLong(0)
>> Flow[T].map{ elem ⇒
>>   internalCounter.incrementAndGet()
>>   elem
>>  }.mapMaterializedValue(_ ⇒ new Counter{
>>override def get = internalCounter.get
>>  })
>>   }
>>
>> Another way is using a GraphStageWithMaterializedValue while building a
>> custom Flow / Sink / Source. Instead of returning a GraphStageLogic,
>> like an ordinary GraphStage, you return a pair of GraphStageLogic and
>> the materialized value.
>>
>> Cheers,
>> Rafał
>>
>> W dniu niedziela, 6 marca 2016 01:02:56 UTC+1 użytkownik Arun Sethia
>> napisał:
>>>
>>> Hi,
>>>
>>> can some explain what does it mean of materialized value ? I have see
>>> documentation at
>>> http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0.3/scala/stream-quickstart.html#transforming-and-consuming-simple-streams
>>>
>>> I am not sure how Flow can define materialize type, for example the
>>> following code has Input - Tweet, output - Int but Mat is Unit. I would
>>> like to see how someone can define Mat as Int or any example where Flow or
>>> source is defining Mat other than Unit.
>>>
>>>
>>>- val count: Flow[Tweet, Int, Unit] = Flow[Tweet].map(_ => 1)
>>>
>>>
>>>
>>> It is quite confusing for me to understand difference between "out"  and
>>> "Mat".
>>>
>>>
>>> Thanks
>>>
>>> As
>>>
>>> --
>
> *
> ** New discussion forum: https://discuss.akka.io/ replacing akka-user
> google-group soon.
> ** This group will soon be put into read-only mode, and replaced by
> discuss.akka.io
> ** More details:
> https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
>
> *
> >>
> >> 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.
>

-- 
*
** New discussion forum: https://discuss.akka.io/ replacing akka-user 
google-group soon.
** This group will soon be put into read-only mode, and replaced by 
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*
>> 
>>  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][deprecated] Re: how to define materialized value

2018-11-04 Thread Martynas Mickevičius
Here is a quick scalafiddle that runs the code from 2 years ago :)

https://scalafiddle.io/sf/xaGO6Yr/0

On Mon, Nov 5, 2018 at 8:18 AM Martynas Mickevičius <2...@lightbend.com>
wrote:

> Did you send any elements to the stream? internalCounter is incremented
> in the map operator for every incoming stream element.
>
> Trait is only used to hide the implementation details of the counter.
>
> On Thu, Nov 1, 2018 at 12:04 AM  wrote:
>
>> Hi Rafal,
>>
>> I just stumbled upon your reply. Could you explain why you have to wrap
>> the AtomicLong into the Counter trait? I tried returning the naked
>> AtomicLong in the 'mapMaterializedValue' function, but the resulting value
>> was always 0. Why does wrapping in a trait produce a different result?
>>
>> Best,
>> Jurgis
>>
>>
>> On Sunday, March 6, 2016 at 1:46:12 AM UTC+1, Rafał Krzewski wrote:
>>>
>>> Hi,
>>> there are a few ways of doing that. Probably the simplest one is using
>>> Flow.mapMaterializedValue. Suppose you'd like to create a Flow that counts
>>> the elements that pass through it and makes the current count available
>>> through a "side channel":
>>>
>>>   trait Counter {
>>> def get: Long
>>>   }
>>>
>>>   def counter[T]: Flow[T, T, Counter] = {
>>> val internalCounter = new AtomicLong(0)
>>> Flow[T].map{ elem ⇒
>>>   internalCounter.incrementAndGet()
>>>   elem
>>>  }.mapMaterializedValue(_ ⇒ new Counter{
>>>override def get = internalCounter.get
>>>  })
>>>   }
>>>
>>> Another way is using a GraphStageWithMaterializedValue while building a
>>> custom Flow / Sink / Source. Instead of returning a GraphStageLogic,
>>> like an ordinary GraphStage, you return a pair of GraphStageLogic and
>>> the materialized value.
>>>
>>> Cheers,
>>> Rafał
>>>
>>> W dniu niedziela, 6 marca 2016 01:02:56 UTC+1 użytkownik Arun Sethia
>>> napisał:
>>>>
>>>> Hi,
>>>>
>>>> can some explain what does it mean of materialized value ? I have see
>>>> documentation at
>>>> http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0.3/scala/stream-quickstart.html#transforming-and-consuming-simple-streams
>>>>
>>>> I am not sure how Flow can define materialize type, for example the
>>>> following code has Input - Tweet, output - Int but Mat is Unit. I would
>>>> like to see how someone can define Mat as Int or any example where Flow or
>>>> source is defining Mat other than Unit.
>>>>
>>>>
>>>>- val count: Flow[Tweet, Int, Unit] = Flow[Tweet].map(_ => 1)
>>>>
>>>>
>>>>
>>>> It is quite confusing for me to understand difference between "out"
>>>> and "Mat".
>>>>
>>>>
>>>> Thanks
>>>>
>>>> As
>>>>
>>>> --
>>
>> *
>> ** New discussion forum: https://discuss.akka.io/ replacing akka-user
>> google-group soon.
>> ** This group will soon be put into read-only mode, and replaced by
>> discuss.akka.io
>> ** More details:
>> https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
>>
>> *
>> >>>>>>>>>>
>> >>>>>>>>>> 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.
>>
>

-- 
*
** New discussion forum: https://discuss.akka.io/ replacing akka-user 
google-group soon.
** This group will soon be put into read-only mode, and replaced by 
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*
>>>>>>>>>> 
>>>>>>>>>>  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] Dependency injection of ShardRegion actor

2014-07-18 Thread Martynas Mickevičius
Hi Chris,

if the ShardRegion will get restarted by its guardian, ActorRefs pointing
to it will not go stale. They will go stale if ShardRegion would be stopped
and then started again. But I can not see a likely scenario for that to
happen.

I am not really sure about alternative 1). How would you construct actor
selection?

Alternative 2) is very cheap, because ClusterSharding.shardRegion(...) is a
lookup in a map. You could abstract that away in a implicit conversion.


On Fri, Jul 18, 2014 at 6:52 AM, Chris Toomey  wrote:

> We're going to use cluster sharding to route messages to the appropriate
> actors on the servers in a cluster.  We'll have many actors that will be
> sending messages via the ShardRegion actor, and were thinking originally
> we'd inject that actor as a dependency into the actors that need it as we
> do other dependencies (e.g., an event bus).
>
> But since ClusterSharding.shardRegion() returns an ActorRef, presumably
> that could become stale (if the ShardRegion actor was restarted) and hence
> wouldn't make sense as an injected dependency.  The alternatives I can
> think of are 1) obtaining the ShardRegion's ActorSelection and passing that
> as the dependency, or 2) passing in the shard entry name and calling
> ClusterSharding.shardRegion()  every time to get the current ActorRef.  Of
> these, 1) is definitely cleaner as it doesn't couple the dependent actors
> to ClusterSharding at all.
>
> Am I right in assuming that the performance overhead of 1) and 2) are
> comparable, and negligible in the grand scheme of things, compared to
> sending directly to the ActorRef?
>
> thx,
> Chris
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Generic Resizable Routing Pool

2014-07-18 Thread Martynas Mickevičius
Could you elaborate more on dynamically resize? Do you want it to change
size while running? Or do you want it to have different sizes according to
configuration in different application instances?
2014 liep. 17 11:12 "Rachel"  rašė:

> I am trying to do two things. First, I would like to choose a specific
> router-actor pool type at runtime to create as the child of my supervising
> actor (see parts 1 and 2 below). Second, I would like that pool to
> dynamically resize according to the defaults I define in the config file
> (see part 0). The code below does not compile but shows the general idea of
> what I am trying to do. Is this possible, or do I need to hard-code each
> specific kind of Pool inside the AddRouter case (in part 2)? Or
> programmatically override the resizer?
>
> *Part 0: in config file*
>
> akka.actor.deployment.default{
>   resizer {
>   enabled = on
>   lower-bound = 1
>   upper-bound = 10
>   pressure-threshold = 1
>   rampup-rate = 0.2
>   backoff-threshold = 0.3
>   backoff-rate = 0.1
>   messages-per-resize = 10
>   }
> }
>
>
> *Part 1: ("supervisor" is an actorRef of type X that has been created
> earlier)*
>
> supervisor ! AddRouter(listenerType,
>   routerType match {
>   case 1 => RoundRobinPool  *// here, compiler requires
> RoundRobinPool.apply(nrOfInstances = someInt) to be the correct type, but
> this appears to prevent dynamic resizing from config*
>   case 2 => RandomPool
>   case 3 => BalancingPool
>   case 4 => SmallestMailboxPool
>   case 5 => ConsistentHashingPool
> })
>
>
> *Part 2:*
>
> object X {
>   //...
>   case class AddRouter(actorType: Class[_<: Actor], routerType: Pool)
>   //...
> }
>
> class X extends Actor {
>
>   def receive {
> case AddRouter(listenerType, routerType) => {
>
>   //...
> val router: ActorRef =
>   context.actorOf(routerType.props(Props[actorType]),
> "myRouteeName")
>   //...
> }
>   }
> }
>
> 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.
>

-- 
>>  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 LoggingReceive and stackable traits - strange behaviour

2014-07-28 Thread Martynas Mickevičius
spatcher-6]
> DEBUG commands.application.RotationService - started
> (commands.application.RotationService@44af61a4)
> 15:46:14.534
> [TestActorSystem-5c322748c8fd4465b79823a366dabea4-akka.actor.default-dispatcher-6]
> DEBUG akka.io.UdpSender - started (akka.io.UdpSender@101cd25f)
> 15:46:14.535
> [TestActorSystem-5c322748c8fd4465b79823a366dabea4-akka.actor.default-dispatcher-6]
> DEBUG akka.io.UdpSender - now watched by
> Actor[akka://TestActorSystem-5c322748c8fd4465b79823a366dabea4/system/IO-UDP-FF/selectors/$a#887910570]
> 15:46:14.536
> [TestActorSystem-5c322748c8fd4465b79823a366dabea4-akka.actor.default-dispatcher-6]
> DEBUG commands.application.RotationService - received handled message
> CreateRotation()
> +++CreateRotation()
>
> So now I am getting two log messages about incoming message - one from
> LoggingReceive: *15:46:14.536
> [TestActorSystem-5c322748c8fd4465b79823a366dabea4-akka.actor.default-dispatcher-6]
> DEBUG commands.application.RotationService - received handled message
> CreateRotation()* and one from my *println.*
>
>
> I am wondering then what is the cause of this - why the *LoggingReceive *does
> not want to work properly in the first case?
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Pooled router initialisation

2014-07-29 Thread Martynas Mickevičius
Hi Jabbar,

if you still want to use pooled router you can specify arguments to routee
constructor in the props. For example:


   1. val router1: ActorRef =
   2. context.actorOf(FromConfig.props(Props(classOf[Worker], argument1,
   argument2)), "router1")



On Tue, Jul 29, 2014 at 10:31 AM, Jabbar Azam  wrote:

> OK I found it. A non clustered group router with externally assigned
> routees.
>
> --
> >>>>>>>>>>  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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Neo4j as overlay state-DB for a "graph of Akka Actors"

2014-07-29 Thread Martynas Mickevičius
Hello Muthu,

that is certainly an interesting use case you have. Would love to hear
about the final solution you will end up with.

I think that you should not store ActorRefs in the DB because they can get
stale if the corresponding actor will be stopped and started again. Instead
you can store only the name or full path of the actor and do ActorSelection
to get ActorRef.


On Sun, Jul 27, 2014 at 9:33 AM, Muthukumaran Kothandaraman <
muthu.kmk2...@gmail.com> wrote:

> I have a domain problem where the graph of actors (actors as nodes of
> graph and links represent communication channels between actors) is not
> dictated by the natural supervisory hierarchy but by external configuration
> of connectivity between actors - which is stored in Neo4j. Most of the
> actors representing nodes of the graph are long-living in nature. Other
> characteristics include
>
> - Short-lived actors never form part of the "actor graph". End users (not
> necessarily humans always) can control the lifecycle of nodes and edges of
> graph. -
>
> - Lifecycle of actors (nodes of graph) is aligned with the lifecycle of
> corresponding nodes in graph-db. This rule also applies to edges. So when
> one of actors receive a specific message, it has to query the graph
> database and
>   route the message to other actors. Receiving actor may or may not
> execute any other business-logic before forwarding message to other actors.
>
> So, I am thinking of following option :
>
> Have some neutral Actor-identifier stored in the Neo4j with ActorRef as as
> one of node attribute and use the graph query mechanisms for various query
> types (immediate neighbors, immediate neighbors filtered based on edge
> properties etc etc) and determine the target actors to which the messages
> could be forwarded. I would have to think about the robustness aspects of
> actor-deaths and probably caching query-results from Neo4j within each
> actor for specific type of query (so that we do not hit Neo4j for each and
> every message) etc. But I could think of such cases once the basic approach
> is decided.
>
> Above approach is effectively trying to treat Neo4j as a logical
> graph-overlay for actors.
>
> I wanted to get opinions from experiences of others.
>
> PS : I would still use supervisor actors primarily for managing the
> activities such as child-restart upon crash and supervisor actors need not
> necessarily form part of actor-graph.
>
> Thanks in advance
>
> Muthu
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] actor ask future manipulation

2014-07-29 Thread Martynas Mickevičius
Hi Rob,

after the map you will have failed Future if you throw an exception inside
a map. So your example seems correct. Check out this full compiling and
running sample code:

import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global

def mapIt(f: Future[Option[Int]]) = f.map {
case Some(i) => i
case None => throw new Exception("None found")
}

val f = mapIt(Future { Some(123) })
val g = mapIt(Future { None })

Thread.sleep(100)

println(f.value)
println(g.value)

Which would print:

Some(Success(123))
Some(Failure(java.lang.Exception: None found))


On Tue, Jul 29, 2014 at 3:35 PM, Rob Jones  wrote:

> The following code is part of a Play asynchronous action
>
> The actor actorRef replies to GETVALUE with Option[Int]
>
> I would like a response of None to give a failed future f but instead the
> exception is thrown
>
> val f = (actorRef ? GETVALUE) map {
>  case Some(i; Int) =>
>  case None => throw new Exception("value not found")
> }
>
> Is this to do with the threading in the particular usage?
>
> Many 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 I can watch for actor child change

2014-07-29 Thread Martynas Mickevičius
Hi Sean,

I can not think of a clean way of doing that. One idea that popped into my
mind was to write a custom Mailbox implementation where it would be
possible to track mailbox owners. This is surely and definitely a hack.
Maybe it will give you some nicer ideas. :)

Writing custom ActorRef provider would be another hacky idea, because for
that you would need to go to private[akka] code.


On Tue, Jul 29, 2014 at 3:51 PM, Sean Zhong  wrote:

> The child's path is not known.
>
> I want get notified when a new child come up no matter what the path is.
>
>
> On Monday, July 28, 2014 2:48:28 PM UTC+8, 09goral wrote:
>>
>> use context.watch(ActorRef) to register for chaning of actor's life cycle.
>>
>> W dniu niedziela, 27 lipca 2014 09:23:14 UTC+2 użytkownik Sean Zhong
>> napisał:
>>>
>>> I cannot change the code of this actor, I want to get notified when
>>> there is a child created or stopped, how can this be done?
>>>
>>> There was ActorRegistry, but it was removed in akka 2. (
>>> http://doc.akka.io/docs/akka/1.3.1/java/actor-registry.
>>> html#ActorRegistry__Finding_Actors)
>>>
>>>
>>>
>>>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: child doesn't get notified or killed when remote parent is dead

2014-07-30 Thread Martynas Mickevičius
Hi all,

I tested it will akka 2.3.4 end it all works properly. Child is stopped
when JVM with parent actor is stopped.

[DEBUG] [07/30/2014 12:15:26.527] [sys-akka.actor.default-dispatcher-3]
[akka://sys/remote/akka.tcp/sys@localhost:2553/user/actorWithRemoteChild/$a]
stopped
[DEBUG] [07/30/2014 12:15:26.539]
[sys-akka.remote.default-remote-dispatcher-5]
[akka.tcp://sys@localhost:2552/system/remote-watcher]
Unwatching: [akka://sys/remote -> akka.tcp://sys@localhost
:2553/user/actorWithRemoteChild]

It seems that RemoteWatcher is taking care of that.


On Wed, Jul 30, 2014 at 12:09 PM, Endre Varga 
wrote:

> Hi Sean,
>
> I think this might be a real issue. Remote deployment should maybe
> automatically initiate a watch from the child to the parent. This problem
> rings a bell though... Have you tried this in Akka 2.3.4? I have a feeling
> that we fixed something like that before.
>
> As a sidenote, I don't really like the current remote deployment (as in
> hooking a remote actor into the local supervision hierarchy) and I hope
> Akka 3 will move instead to a recepcionist style remote deployment.
>
> -Endre
>
>
> On Tue, Jul 29, 2014 at 11:22 PM, 09goral  wrote:
>
>> To be honest, I don't know the answer but you can easily check what child
>> actor receives. Just log every message child actor receives and see if
>> comes any message that would indiciate that parent got killed.
>>
>> Buy according to  docs
>> <http://doc.akka.io/docs/akka/2.3.4/scala/actors.html#Restart_Hooks> by
>> default it should terminate all childrens. If you haven't overriden
>> preRestart() method I imagine that it depends on way you kill parent actor.
>>
>>
>> W dniu wtorek, 29 lipca 2014 15:07:06 UTC+2 użytkownik Sean Zhong napisał:
>>
>>> Test case:
>>> parent actor: in a local machine, child actor, in a remote machine.
>>> child actor is created by parent actor by akka remote deployment.
>>>
>>> Behavior observed:
>>> when the parent JVM is killed, the child actor is *NOT* stopped. I have
>>> not use child context.watch(parent) for this case.  I oringally thought
>>> when the parent actor *cannot* connected, the child actor should
>>> *suicide itself.*
>>>
>>> Is this expected? I use akka 2.2.3
>>>
>>>
>>> Sean
>>>
>>>
>>>
>>>  --
>> >>>>>>>>>> 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.
>>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Example project: Coding an elevator state machine with Akka FSM

2014-07-30 Thread Martynas Mickevičius
Hi Tom,

really nice example. Very easy to go through and grok the inner workings of
the elevator. I have added couple of comments on commits in GitHub.


On Wed, Jul 30, 2014 at 10:09 AM, 09goral  wrote:

> Thanks for that. I will definetly take a closer look. I've been looking
> for some nice example projects of FSM recently.
>
> W dniu środa, 30 lipca 2014 07:06:35 UTC+2 użytkownik Tom Bray napisał:
>
>> Hi folks,
>>
>> I really fell in love with Akka when I discovered the Finite State
>> Machine DSL and thought I'd share the love with an example project that
>> demonstrates how to build an elevator state machine using TDD.
>>
>> Here's the project:  https://github.com/tombray/akka-fsm-examples
>> Here's the elevator FSM:  https://github.com/tombray/
>> akka-fsm-examples/blob/master/src/main/scala/com/tombray/
>> examples/akka/ElevatorActor.scala
>> And here are the tests:  https://github.com/tombray/
>> akka-fsm-examples/blob/master/src/test/scala/com/tombray/examples/akka/
>> ElevatorActorSpec.scala
>>
>> Please let me know if you have any suggestions for improvements or ideas
>> for future examples.
>>
>> Cheers,
>>
>> Tom
>>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Detecting Closure of Reactive Streams

2014-07-30 Thread Martynas Mickevičius
Hi Carl,

could you provide more concrete example?

AFAICS if a client is restarted then HTTP connection will be dropped on the
server side which would indicate for producer to stop producing.


On Sun, Jul 27, 2014 at 9:54 PM,  wrote:

> Hi,
>   I'm experimenting with Akka HTTP and reactive streams. Currently, I'm
> thinking about unreliable clients that have successfully established a
> (reverse) Akka HTTP stream chunking connection to some HTTP
> endpoint/server. In other words, the server response (to the client HTTP
> connection) is a chunk based producer (communicated via the HTTP response's
> HTTPEntity). In my specific example, I'm thinking about the producer being
> an ActorProducer instance.
>
> If the client is restarted and the connection reestablished, then the
> server side (actor) producer will find itself in a situation whereby it
> thinks it has multiple subscribers. As a result, it looks like one should
> detect the connection closure (on the server side) and then cancel any
> existing (actor) producer subscription.
>
> So, is it possible to detect the connections closure? Or maybe my use-case
> could do with some refinement?
>
> Any help greatly appreciated,
>
>   Carl.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Futures vs actors

2014-07-30 Thread Martynas Mickevičius
Hi Bartłomiej,

you have laid quite a few arguments for one and the other camp.

One more limitation of Future compared with an Actor is that data can flow
only one way in the Future. On the contrary data can flow forward, backward
or even to some other direction when using an Actor.



On Mon, Jul 28, 2014 at 12:42 AM, Bartłomiej Szczepanik 
wrote:

> I would like ask more experienced people how you choose between futures
> and actors when you are about to implement some asynchronous
> processing/business logic. I was thinking hard and reading about it and had
> a lot of discussion with different people.
>
>
>
> The first, quite obvious criterion for me is statefulness or
> statelessness. Actors are great for state encapsulation and management. For
> example they fit ideally to DDD Aggregate pattern (and akka-persistence
> helps here a lot).
>
>
>
> So let's say we are about to implement something stateless. I've heard
> from some people that in this case Futures are the best option. They
> compose nicely what really helps to manage more complicated business logic.
> I am not sure the Futures are the way to go because I have seen a lot of
> examples in activators, documentation and blog posts with stateless
> behavior.
>
>
>
> The main point against the stateless actors is that they are transactional
> units. Handling of each message is done one by one and it seems to be very
> inefficient. Of course we can get rid of it by spawning multiple actors and
> setting up routers in front of them. But still it seems to be unnecessary
> complicated comparing to simply starting many futures or executing the same
> lines of code parallelly (I assume thread safety).
>
>
>
> Do you have a good criteria to choose the better option in particular use
> case? What disadvantages Futures have which make actors more attractive in
> stateless scenario?
>
>
> Best,
>
> Bartłomiej
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Tackling the ask pattern and `timeout hell`

2014-07-30 Thread Martynas Mickevičius
> it's impossible in reactive approach, please explain that and give some
> alternatives. I'd be very grateful for that.
>
>
> Best,
>
> Bartłomiej
>
>
>
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 architecture pattern vs typed actors

2014-07-31 Thread Martynas Mickevičius
Hi Muki,

I have skimmed through the template and added a few comments.

Since you have mentioned that the main pro of this pattern is ease of use
and typesafety I think that Akka Typed Actors
<http://doc.akka.io/docs/akka/2.3.4/scala/typed-actors.html> provide just
that. Have you considered using them? If so, what did you like or found
hard about them to roll your own solution?


On Thu, Jul 31, 2014 at 1:06 AM, Muki  wrote:

> Hi,
>
> I created a small sample app for a little architecture pattern for akka
> applications.
> The idea can be terribly wrong, but I wanted to get some feedback on it:
>
>https://github.com/muuki88/akka-architecture
>
>
> The  README explains the pattern and how to apply it. It's more or less a
> way
> around typed actors.
>
> cheers,
> Muki
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] combining Akka Persistence with Akka Scheduling

2014-07-31 Thread Martynas Mickevičius
Hi Greg,

just dropping this in case you have not seen that it is possible to use
quartz
<https://github.com/akka/akka/blob/9dae0ad525a92ebf8b0f5f42878a10628ac24aae/akka-samples/akka-sample-camel-scala/src/main/scala/sample/camel/QuartzExample.scala>
through
akka-camel.


On Fri, Jul 25, 2014 at 5:46 PM, Greg Flanagan  wrote:

> Endre,
>
> Seems reasonable to keep the scheduler light weight and performant. My
> plans were to build something around it. Thanks.
>
> Greg
>
>
>
> On Friday, July 25, 2014 7:40:39 AM UTC-7, Akka Team wrote:
>
>> Hi Greg,
>>
>>
>> On Fri, Jul 25, 2014 at 4:20 PM, Greg Flanagan  wrote:
>>
>>> Hey Konrad, I wasn't planning on making it as powerful as quartz but
>>> simply making what's available in the scheduler persistent, so that work
>>> that is deferred (i.e. scheduled) will not be lost on jvm shutdown. my use
>>> case doesn't require Quartz (i.e. run at 4:50 am on Tuesday), but I do need
>>> the deferred jobs to persisted through jvm restarts.
>>>
>>
>> The Akka scheduler has been designed for high-volume low-resolution
>> timing tasks, typically timeouts -- all with the requirement of high
>> performance. While you can combine persistence and the Akka scheduler to
>> achieve what you want, we will keep the scheduler simple -- since this is a
>> highly performance sensitive module we do not want to add features there.
>> You can definitely build something around it though.
>>
>> -Endre
>>
>>
>>>
>>> cheers,
>>> Greg
>>>
>>>
>>> On Friday, July 25, 2014 1:18:47 AM UTC-7, Konrad Malawski wrote:
>>>
>>>> Hello Greg,
>>>> short question - do you aim to provide something as powerful as quartz
>>>> using this?
>>>> I mean "on monday at 13:02" etc. Because that's not really what our
>>>> scheduler is designed to do - we only work with "in X amount of time".
>>>>
>>>> Instead maybe you'd simply like to integrate quartz with akka, as this
>>>> extension does: https://github.com/typesafehub/akka-quartz-scheduler
>>>> And let it do it's job :-)
>>>>
>>>>
>>>> On Fri, Jul 25, 2014 at 1:05 AM, Greg Flanagan 
>>>> wrote:
>>>>
>>>>> I'm interested in combining Akka persistence which Akka Scheduling and
>>>>> wanted to know if there was an interest out there for something like this?
>>>>> I basically need a scheduler that doesn't loose state after a vm crash.
>>>>> I've used Quartz before and it's too much framework for what I want. Any
>>>>> requests of features people would like to see in this type of module? Has
>>>>> it already been done and I just haven't searched google enough?
>>>>>
>>>>> Cheers,
>>>>> Greg
>>>>>
>>>>>
>>>>>  --
>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c
>>>>> urrent/additional/faq.html
>>>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou
>>>>> p/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
>>>> hAkker @ Typesafe
>>>>
>>>> <http://typesafe.com>
>>>>
>>>  --
>>> >>>>>>>>>> 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 becaus

Re: [akka-user] Akka-Camel Custom Polling strategy

2014-07-31 Thread Martynas Mickevičius
Hello Ratika,

since Camel does not support HornetQ out-of-the-box could you elaborate a
bit more how are you using it with akka-camel? Also do you have a way of
changing poll strategy when using HornetQ from Camel without akka?


On Tue, Jul 29, 2014 at 3:25 PM,  wrote:

> Hi,
>
> In our Akka based application there is a need to control the
> UntypedConsumerActors ( required for flow control) who listen on the
> endpoint URI's. Is there a way we can set up an custom poll strategy on
> these Endpoint URI and consumers so that it polls (consumes messages from
> Endpoint which is HornetQ) when required and otherwise not. Kindly help.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] reddis based job queue framework in akka? similiar to reque?

2014-07-31 Thread Martynas Mickevičius
Hi,

what is your use-case? Why do you want reddis?

You can easily build a persistent job queue with akka-persistence.


On Tue, Jul 29, 2014 at 8:22 PM, gitted  wrote:

> Hello!
>
> Is there a akka based job/queue framework out there in the open source
> world?
>
> I'm looking for something similiar to https://github.com/resque/resque.
>
> Basically a queue that is built on top of redis.  Resque also then has a
> base class where you build your custom worker processes that will process
> the messages off redis queue.
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] overriding actor toString

2014-08-01 Thread Martynas Mickevičius
Hello,

when you create an actor you get an ActorRef back. So it is not an instance
of your actor but a reference to it. Therefore overridden toString method
is not the one being called.

You can access the name of your actor from ActorRef with: doTest.path.name


On Fri, Aug 1, 2014 at 10:02 AM, workingdog  wrote:

> I have the following test code:
>
> import akka.actor.{Props, Actor, ActorSystem}
>
> object TestString {
>   def main(args: Array[String]) {
> implicit val context = ActorSystem("TestString")
> val doTest = context.actorOf(Props(classOf[TestMe], "test_name"))
> println("doTest: " + doTest.toString)
>   }
> }
>
> class TestMe(name: String) extends Actor {
>   def receive = { case _ => println("in TestMe") }
>   override def toString(): String = name
> }
>
>
> which gives something like:
> doTest: Actor[akka://TestString/user/$a#-1774851695]
>
> I don't understand why my toString does not override the Actor toString.
> Any ideas?
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] does classpath order matter when running akka application

2014-08-01 Thread Martynas Mickevičius
Hi Mohnish,

can you try running latest akka 2.3.4 and have all akka artifacts of the
same version?


On Fri, Aug 1, 2014 at 5:18 AM, Mohnish Kodnani 
wrote:

> Hi,
> I am using gradle to build an akka application.
> All the dependencies are in the lib folder. There is a startup script
> which lies in the bin folder.
> I am using akka-clustering which internally depends on akka-remote which
> depends on netty.
> When I run the application I get the following error.
> java.lang.NoSuchMethodError:
> org.jboss.netty.channel.socket.nio.NioWorkerPool.(Ljava/util/concurrent/Executor;I)V
> at
> akka.remote.transport.netty.NettyTransport.(NettyTransport.scala:283)
> at
> akka.remote.transport.netty.NettyTransport.(NettyTransport.scala:240)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at
> akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$2.apply(DynamicAccess.scala:78)
> at scala.util.Try$.apply(Try.scala:161)
> at
> akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:73)
>
>
> Now, when I put netty-3.8.0.Final.jar before the akka-remote jar in the
> classpath this error goes away.
>
> Does the ordering of jars matter in the classpath  ?
>
> akka-actor version 2.3.2, akka-cluster : 2.3.3
>
> -Mohnish
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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-docs] Fix on 2.0 first tutorial

2014-08-14 Thread Martynas Mickevičius
Hello Jonathan,

you have stumbled upon a documentation page for Akka 2.0. Latest Akka right
now is 2.3.5 and an introduction page to the latest version can be found
here: http://doc.akka.io/docs/akka/2.3.5/intro/index-scala.html


On Fri, Aug 15, 2014 at 1:07 AM, Jonathan Urzúa  wrote:

> Hi!
>
> I'm new to Akka and was reading the first tutorial that Google pointed me
> to.
>
> http://doc.akka.io/docs/akka/2.0/intro/getting-started-first-scala.html
>
> I found some problems along the way and here are my solutions.
>
> The repo links changed, so they don't point to the correct files anymore,
> those are the ones that need to be updated:
>
>
>-
>https://github.com/akka/akka/tree/master/akka-tutorials/akka-tutorial-first
>to
>
> https://github.com/akka/akka/tree/new-docs-2.0/akka-tutorials/akka-tutorial-first
>-
>
> https://github.com/akka/akka/blob/master/akka-tutorials/akka-tutorial-first/src/main/scala/akka/tutorial/first/scala/Pi.scala
> to
>
> https://github.com/akka/akka/blob/new-docs-2.0/akka-tutorials/akka-tutorial-first/src/main/scala/akka/tutorial/first/scala/Pi.scala
>
> And I couldn't compile the code as it, so I needed to made this
> modification (line 69 of the above file):
>
> from:
>
> listener ! PiApproximation(pi, duration = (System.currentTimeMillis -
> start).millis)
>
> to:
>
> listener ! PiApproximation(pi, duration = Duration(System.currentTimeMillis
> - start, "millis"))
>
>
> I don't know if this is the correct place to post this kind of things, but
> I wanted to help somehow.
>
> Best regards.
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 Persistence: Using Stackable Trait pattern in PersistentActor

2014-09-02 Thread Martynas Mickevičius
Hi Damon,

if you use context.become(stateB) in your concrete actor you replace the
receive function defined in stackable traits with stateB. I think instead
of using context.become you should make wrappedReceive a var and change
that to whichever state you want your concrete actor to have.

I did a quick experiment <https://gist.github.com/2m/1695454e19fff3260dc8>
with this.


On Sat, Aug 30, 2014 at 8:47 AM, Damon Rolfs  wrote:

> I am hoping for some guidance on how to handle message envelope processing
> outside of my concrete PersistentActors. In my system I am wrapping
> commands in an envelope. I wrote a stackable trait to abstract the envelope
> handling away from my business logic.
>
> I am following the pattern as described by Ooyala
> <http://www.slideshare.net/EvanChan2/akka-inproductionpnw-scala2013> (slides
> 15+):
>
> trait PersistentActorStack extends PersistentActor { outer: ActorLogging
> =>
>   def wrappedReceiveCommand: Receive
>   def wrappedReceiveRecover: Receive
>
>   override def receiveCommand: Receive = {
> case c if wrappedReceiveCommand.isDefinedAt( c ) =>
> wrappedReceiveCommand( c )
> case c => unhandled( c )
>   }
>
>   override def receiveRecover: Receive = {
> case e if wrappedReceiveRecover.isDefinedAt( e ) =>
> wrappedReceiveRecover( e )
> case e => unhandled( e )
>   }
> }
>
> My concrete actor ultimately extends this trait and implements a state
> machine via become with something like the following states:
>
> val stateA: Receive = { ... }
> val stateB: Receive = { ... }
> val stateC: Receive = { ... }
>
> I start off with startA:
>
> override def wrappedReceiveCommand: Receive = stateA
>
> The actor behaves and processed commands as expected until I become
> another state; e.g., stateB. Once I call context.become( stateB ), the
> state isn't recognized and I see that wrappedReceiveCommand is called and
> returning stateA. (I used logging to see this.) This doesn't surprise me,
> however the examples I've seen in tutorials and tests utilize
> context.become(). I am struggling to find non-trivial example using become
> with a stackable trait pattern. Do they fit together? Is there a suggested
> alternative.
>
> Thanks so much for your advice!
>
> Damon
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] JVM shutdown when I use ActorDSL Act.whenStarting

2014-09-02 Thread Martynas Mickevičius
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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Facing Sharding issue in akka-contrib_2.10-2.3.4.jar

2014-09-02 Thread Martynas Mickevičius
Hi Asha,

I would guess that persistence system fails to initialize. What persistence
plugin and settings do you use? If you are prototyping and using LevelDB
you either need to provide native LevelDB libraries or use Java LevelDB
implementation by adding the following to your application.conf file:

akka.persistence.journal.leveldb.native = off

Just remember to select a plugin <http://akka.io/community/#journal-plugins>
for a distributed journal when going to production.


On Mon, Sep 1, 2014 at 1:11 PM, Asha  wrote:

> I think, i have given very less information.
>
> Here is the detailed description
>
> I am using Akka-pull pattern in my project. i am using
> akka-contrib_2.10-2.3.4.jar and akka-persistence-experimental_2.10-2.3.4.jar
> Front end, master, worker all are running different nodes. The actor
> system of front end and  master is   "ClusterSystem".
> The actor system of worker is "WorkerSystem". Request form Browser is
> coming to Front end .
> Request flow
> Browser -> FrontEnd -> Master -> Worker
>
> Worker is able to pull the work from master and processing the same. I
> want to persit the state after processing work. I am using single writer.
> Shard for the persisted actor is stared when node comes up. For persisting
> the state, i am hitting the shard region of the Persisted Actor. It is a
> able resovle the shard,
> but failing to resolve the persisted actor(not executing the idExtractor
> ())
>
> Below is the code.
>
> val idExtractor: ShardRegion.IdExtractor = {
> case created: LedgerCreated =>{
>   println("% IdExtractor : " +created.ledgerId.id.toString)
>   (created.ledgerId.id.toString, created)
> }
> case edited: LedgerEdited   => (edited.ledgerId.id.toString, edited)
> case deleted: LedgerDeleted => (deleted.ledgerId.id.toString, deleted)
>   }
>
>   val shardResolver: ShardRegion.ShardResolver = msg => msg match {
> case created: LedgerCreated =>{
>println("% ShardResolver : " +created.ledgerId.id % shards)
>   (created.ledgerId.id % shards).toString
> }
> case edited: LedgerEdited   => (edited.ledgerId.id % shards).toString
> case deleted: LedgerDeleted => (deleted.ledgerId.id % shards).toString
>   }
>
>  I am getting the log written in the ShardResolver. But the log written in
> the IdExtractor is not coming.
>
> Please help me to solve this problem.
>
>
>
>
> On Monday, 1 September 2014 15:00:16 UTC+5:30, Asha wrote:
>>
>> Hi,
>>
>>   I am using Akka-pull pattern in my project. Request from the browser
>> will land on spray layer, it will pass the request to master then master to
>> worker.
>>   In worker i am hitting the shard region. When i hit the shard region
>>  it is able to resolve shard but failing to execute the idExtractor.  It is
>> not throwing any error.
>>
>>   Not getting whether issue with the jar or my code.  Please help  me to
>> resolve this problem
>>
>> Thanks
>> Asha
>>
>>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 cluster Set up

2014-09-02 Thread Martynas Mickevičius
Hi Padma,

you need to add the address of node1 to the seed-node list in the
configuration of node2 and node3. More information on seed nodes can be
found in the documentation
<http://doc.akka.io/docs/akka/2.3.5/scala/cluster-usage.html>.


On Tue, Sep 2, 2014 at 2:06 PM, padma priya chitturi  wrote:

> Hi,
>
>  I wanted to setup akka cluster on 3 modes such that-
>
>   one of my node would be starting ActorSystem and would join this to the
> cluster.
>   Node 2 and Node 3 might join the cluster at any point of time, Once the
> nodes are up, they must be joined to the cluster.
>  I am trying to visualize the actors on node2 and node3 as remote actors.
> How do they knew the actorsystem  and the cluster hat has been created on
> node1. Is there any way to specify this in application.conf file >
>
> Is there any other solution to implement this ?
>
> Regards,
> Padma Ch
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Facing Sharding issue in akka-contrib_2.10-2.3.4.jar

2014-09-03 Thread Martynas Mickevičius
Hello Asha,

as far as I understand the configuration you posted is for the front-end
node which connects to the master via ClusterClient. So front-end node and
master are not in the same cluster. What do you use the journal for in the
front-end then?

What persistence settings do you use on master? I am asking this, because
it seems that you are running ClusterSharding on master and it also needs
persistence to be set up.


On Wed, Sep 3, 2014 at 10:29 AM, Asha  wrote:

>
> Hi Patrik,
>
>I didn't get where to put idExtractor.isDefinedAt(msg).
>
>   As u told i have added  akka.loglevel=DEBUG  in conf file. I am getting
> below line in logs.
> *  2014 12:46:46.465] [WorkerSystem-akka.actor.default-dispatcher-16]
> [akka.tcp://WorkerSystem@127.0.0.1:4001/user/sharding/LedgerProcessor
> <http://WorkerSystem@127.0.0.1:4001/user/sharding/LedgerProcessor>]* *Request
> shard [0] home*
>   After that no logs.
>
>  Below is my conf file.
>
>  akka {
>
>   //actor.provider = "akka.remote.RemoteActorRefProvider"
>   actor.provider = "akka.cluster.ClusterActorRefProvider"
>
>   remote.netty.tcp.port=4001
>   remote.netty.tcp.hostname=127.0.0.1
>
>   extensions = ["akka.contrib.pattern.ClusterReceptionistExtension"]
>   loglevel=DEBUG
>
>persistence {
> journal.plugin = "cassandra-journal"
> journal.leveldb.native = off
>   }
>
>
> }
>
> contact-points = [
>   "akka.tcp://ClusterSystem@127.0.0.1:2551"
>// Master nodes info
>   ]
>
> cassandra-journal {
>class = "akka.persistence.journal.cassandra.CassandraJournal"
>contact-points = ["172.26.145.251"]
>
>   # Name of the keyspace to be created/used by the journal
>   keyspace = "akka"
>
>   # Name of the table to be created/used by the journal
>   table = "messages"
>
>   # Replication factor to use when creating a keyspace
>   replication-factor = 1
>
>   # Write consistency level
>   write-consistency = "QUORUM"
>
>   # Read consistency level
>   read-consistency = "QUORUM"
>
>   # Maximum number of entries per partition (= columns per row).
>   # Must not be changed after table creation (currently not checked).
>   max-partition-size = 500
>
>   # Maximum size of result set
>   max-result-size = 50001
>
>   # Dispatcher for fetching and replaying messages
>   replay-dispatcher =
> "akka.persistence.dispatchers.default-replay-dispatcher"
> }
>
> I am not using the akka.cluster.seed-nodes to connect to master.  From
> this conf i am getting the master's contact point. and using the
> clusterclient i am able to connect to master and communicate.
>
> Please let me know wt did i missed in the conf file.
>
> Thanks
> Asha
>
>
>
>
> On Wednesday, 3 September 2014 12:11:36 UTC+5:30, Patrik Nordwall wrote:
>
>> Hi Asha and Prakhyat (you will not receive help faster by double-posting),
>>
>> First checks that it is a valid message with idExtractor.isDefinedAt(msg).
>> That will not invoke your prints in idExtractor.
>> Then it uses the shardExtractor, which you see in the logs.
>> Before creating the entry, or delegating to the right node, it must get
>> information from the coordinator. It is probably this that is not
>> successful.
>>
>> You will find more information about what is going on by enabling
>> akka.loglevel=DEBUG and look log messages from the "/user/sharding" actors.
>>
>> Regards,
>> Patrik
>>
>>
>> On Tue, Sep 2, 2014 at 8:02 PM, Asha  wrote:
>>
>>>
>>> Hi Martynas,
>>>
>>>I am using* Cassandra plugin * for *persistance*, For the same below
>>> are configuration changes in application.conf for persistance.
>>>
>>>akka{
>>>  persistence {
>>> journal.plugin = "cassandra-journal"
>>>   }
>>>  }
>>>
>>> cassandra-journal {
>>>contact-points = ["xxx..xxx.xxx"]
>>> }
>>>
>>> For this i am using below jars
>>>   akka-persistence-cassandra_2.11-0.3.3.jar
>>>   akka-persistence-experimental_2.10-2.3.4.jar
>>>   cassandra-driver-core-2.0.3.jar
>>>
>>> I am not using LevelDB.
>>>
>>> Thanks
>>> Asha
>>>
>>>
>>> On Tuesday, 2 September 2014 19:02:22 UTC+5:30, Martynas Mickevičius
>>> wrote:
>>>
>>>> Hi Asha,
>>>>
>>>> I would guess that persistence system fails to initialize. What
&

Re: [akka-user] Typed actors - Lookup & Remoting: more info is needed :)

2014-09-03 Thread Martynas Mickevičius
Hi Lajos,

the code snippet you are referring basically wraps ActorRef to a
TypedActor. So for that to work you need to get ActorRef which can be
achieved in a couple of ways:

* you could send (actor tell) it in a message to the actor which creates
the TypedActor
* you could get ActorRef by looking up remote
<http://doc.akka.io/docs/akka/2.3.5/scala/remoting.html#Looking_up_Remote_Actors>
actors using ActorSelection

Have you gone through the code in the documentation page you have linked
to? You can find complete code file here
<https://github.com/akka/akka/blob/cb05725c1ec8a09e9bfd57dd093911dd41c7b288/akka-docs/rst/java/code/docs/actor/TypedActorDocTest.java>
.


On Wed, Sep 3, 2014 at 11:51 AM,  wrote:

> Hi,
>
> I would like to build a client-server connection with Akka.
> I can see that I should go with typed actors and "Lookup & remoting" in my
> case as it is written shortly in the docs (
> http://doc.akka.io/docs/akka/snapshot/java/typed-actors.html)
> Till now I did not find a more detailed example, or sample how I can build
> it up with typed actors.
> Can you please send me a link regarding this if there is any?
>
> Thank you,
> Lajos Fulep
> Hungary
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 Remote Ask Pattern Doesn't Handle Connection Error

2014-09-03 Thread Martynas Mickevičius
Hi Ji,

it seems you are using very old Akka. Try the latest 2.3.5 and see if it
still behaves the same.


On Wed, Sep 3, 2014 at 12:46 PM, Ji ZHANG  wrote:

> Hi,
>
> I'm using akka 2.1.
>
> When I 'ask' a remote actor, if it's not available, the log will print out
> an exception immediately, but the 'ask' future still waits for the timeout.
>
> Is it possible to immediately complete the future when the underlying
> connection is not available, just like a normal http request?
>
> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Exception on FSM non caught by the Supervisor

2014-09-04 Thread Martynas Mickevičius
Hi Creyer,

this looks like a bug to me. Could you register an issue in the Akka issue
tracker on github?


On Thu, Sep 4, 2014 at 6:39 PM, creyer s  wrote:

> I have an Actor with FSM which connects to the database on several
> occasions. This Actor has a supervisor, which for all exceptions is
> restarting it. I have noticed that if the database fails to respond, and an
> exception is thrown, the actor is not restarted. This only happens when the
> connection to the database is done on the onTransition branch.
> The way I have fixed the issue, is by manually propagating the exception,
> from the onTermination (called with throwable or cause message).
>
> But this seems weird to me, is this normal??? Exceptions that happens on
> onTransition, are not caught by the supervisor, and the actor terminates.
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Help! Having trouble overriding my application.conf file with environment-specific conf

2014-09-04 Thread Martynas Mickevičius
Hi lakshmi,

its good to see that you have solved your problem. Indeed config library
documentation <https://github.com/typesafehub/config#standard-behavior>
mentions
that config.file system property can be used to change config source.


On Thu, Sep 4, 2014 at 10:03 PM, lakshmi  wrote:

> Actually, it looks like I fixed whatever was wrong by letting the default
> load happen, as it already seems to pick up all configuration files from
> the configuration directory.
>
> In MyApp.java, change from:
>
>  Config configuration = ConfigFactory.parseFile(new File("configuration/
> application.conf"))
> .withFallback(ConfigFactory.load());
>
> To:
> Config configuration = ConfigFactory.load();
>
> - lakshmi
>
>
>
> On Thursday, September 4, 2014 10:32:58 AM UTC-7, lakshmi wrote:
>>
>> Here is the actual config I am interested in overriding:
>>
>> In configuration/application.conf:
>>
>> redis {
>>   back-off-retry {
>> interval-millis = 100
>> factor = 2
>>   }
>>
>>   host = "10.200.14.60"
>>   port = 6379
>> }
>>
>> In configuration/application.conf:
>>
>> redis {
>>   host = "127.0.0.1"
>> }
>>
>> - lakshmi
>>
>> On Thursday, September 4, 2014 8:52:44 AM UTC-7, lakshmi wrote:
>>>
>>> Hello,
>>>
>>> I'm using Akka with Java 8. Here is my directory structure and jsvc
>>> command that runs the application as a daemon
>>>
>>> *Directory structure:*
>>>
>>> myapp
>>>  \-myapp.jar
>>>  \-configuration
>>> \--application.conf
>>> \--application-dev.conf
>>> \--lib
>>> \--mylib1.jar
>>> \--mylib2.jar
>>> \--daemon-base.sh
>>> \--run.sh
>>>
>>>
>>> *application-dev.conf:*
>>>
>>> include "application"
>>>
>>> akka {
>>> ..
>>> ..
>>> ..
>>> }
>>>
>>>
>>>
>>> *Application run command:*
>>>
>>> jsvc.exec -cp /deploydir/myapp:/deploydir/myapp/myapp-1.0-SNAPSHOT.jar:/
>>> deploydir/myapp:/deploydir/myapp/lib/*.jar:/deploydir/myapp/configuration
>>> *-Dconfig.file=/deploydir/myapp/configuration/application-dev.conf*
>>> -Dakka.log-config-on-start=on -pidfile .myapp.pid com.company.myapp.daemon.
>>> MyAppDaemon
>>>
>>> *MyApp.java:*
>>>
>>> Config configuration = ConfigFactory.parseFile(new
>>> File("configuration/application.conf"))
>>> .withFallback(ConfigFactory.load());
>>>
>>> *Log of config on startup:*
>>>
>>> # merge of configuration/application.conf: 4,system
>>> properties,/deploydir/myapp/configuration/application-dev.conf:
>>> 3,/deploydir/myapp/configuration/application.conf: 4,system
>>> properties,reference.conf: 7-77
>>>
>>>
>>>
>>> As you can see in the jsvc command, I am overriding application.conf by
>>> providing -Dconfig.file. However, when I log the configuration on startup I
>>> see it is actually overriding the other way. I am not sure what the numbers
>>> mean exactly, but at least the final result takes the values from
>>> application.conf instead of application-dev.conf.
>>>
>>> Can you please help me figure out what is wrong with my code?
>>>
>>> Thanks a lot!
>>>
>>> lakshmi
>>>
>>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 2.3.6 Released!

2014-09-05 Thread Martynas Mickevičius
Dear hAkkers,

We—the Akka committers—are pleased to be able to announce the availability
of Akka 2.3.6 <http://akka.io/news/2014/09/05/akka-2.3.6-released.html>.
This is the sixth maintenance release of the 2.3 branch. This release
contains the following improvements:

* A fix <https://github.com/akka/akka/issues/15671> for a wrong snapshot
file being offered to a recovering persistent actor was contributed by
blawlor <https://github.com/blawlor>.
* A fix <https://github.com/akka/akka/issues/15730> for a PersistentView
which was not working with context.become.
* An addition <https://github.com/akka/akka/issues/15544> to the
ever-growing akka-bench-jmh
<https://github.com/akka/akka/tree/master/akka-bench-jmh/src/main/scala/akka>
micro-benchmarks. This time a benchmark for AtLeastOneDelivery trait was
contributed by hepin1989 <https://github.com/hepin1989>.

The complete list of closed tickets can be found in the 2.3.6 github issues
milestone
<https://github.com/akka/akka/issues?q=milestone%3A2.3.6+is%3Aclosed>.

Akka 2.3.6 is released for Scala 2.10.4 and 2.11.2. This release is
backwards binary compatible with version 2.3.5 which means that the new
JARs are a drop-in replacement for the old one (but not the other way
around) as long as your build does not enable the inliner (Scala-only
restriction). Always make sure to use at least the latest version required
by any of your project’s dependencies.

When migrating an existing project from Akka 2.2.x please have a look at
the migration guide
<http://doc.akka.io/docs/akka/2.3.6/project/migration-guide-2.2.x-2.3.x.html?_ga=1.124739530.1150407535.1394739016>
.

Credits
commits added removed
  229   7 Roland Kuhn
  1   104 104 Martynas Mickevicius
  1 1   1 Richard Summerhayes
  1   181   3 Patrik Nordwall
  1   214   0 kerr
  171   1 Brendan Lawlor

Happy hAkking!

-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Routing to subset of children

2014-09-06 Thread Martynas Mickevičius
Hello Richard,

I think Event Bus <http://doc.akka.io/docs/akka/2.3.6/scala/event-bus.html> can
help you there where children can subscribe to an interested channel on a
bus.


On Fri, Sep 5, 2014 at 11:44 PM, Richard Rodseth  wrote:

> Suppose I have messages containing a "channel id" coming to a parent
> actor. There are many children, each of which is interested in one or more
> channels. In other words, a channel message needs to be dispatched to a
> subset of the children.
>
> I'm aware of ActorSelection and have looked at the routing docs, but
> neither seemed to fit.
>
> I could maintain a Map in the parent from channelid to list of actor
> paths, or I could send each message to all children.
>
> Am I missing anything?
>
> Thanks in advance.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Relative router path in configuration file in Akka (Did I miss something?)

2014-09-06 Thread Martynas Mickevičius
Hi Raphael.

currently an asterisk matches only one level of actors. So you will have to
have some repetition to express your current setup:

my-router {
  router = balancing-pool
  nr-of-instances = 50
}

akka.actor.deployment {
  "/*/*/*/querierRouter" = ${my-router}
  "/*/*/*/*/querierRouter" = ${my-router}
  "/*/*/*/*/*/querierRouter" = ${my-router}
}

If I understood correctly this is only to make development easier. After
your actor paths get more stable then you can only leave the required
configuration.

I also did some archaeology and found a thread related to the issue you are
hitting. A closed ticket
<https://www.assembla.com/spaces/akka/tickets/2003#/activity/ticket:> in
Akka old issue tracker argues that it is hard to implement such a feature
because it would require searching all deployment configuration on every
actor creation.


On Tue, Sep 2, 2014 at 4:18 AM, Raphael do Vale 
wrote:

> I am studying the Akka framework (Java) and building a crawler (which,
> hopefully, will be open source in the coming months...). I've create some
> low-level actors which will be responsible to effectively crawl over data
> sources and return the found data as a message. This actors are running
> inside an akka router as I currently can’t make non-blocking calls over my
> data sources (this solution is suggested in akka documentation). One of the
> cool features of the framework is that I can simply configure how the
> routers works in configuration files, which makes easier to change my
> system’s behavior. I.e.:
>
> akka.actor.deployment {
>>   /"*"/querierRouter {
>> router = balancing-pool
>> nr-of-instances = 50
>>   }
>>
>>
> This configuration worked fine in my simpler unit test. The akka system
> was capable to identify the configuration and associated it to the desired
> router. However, as my application increased in complexity, different paths
> from different sizes were created and both of them reach to this router.
> Currently, I’ve paths like this (simplified version):
>
> akka://CRAWLER/user/$a/$a/RESOURCE_PROCESSOR/$a/QUERY/querierRouter
>
>
> Which the Akka system is unable to find the correct configuration, sending
> the following message:
>
>
>> akka.ConfigurationException: Configuration missing for router 
>> [akka://CRAWLER/user/$a/$a/RESOURCE_PROCESSOR/$a/QUERY/querierRouter]
>> in 'akka.actor.deployment' section.
>
>
>
> I have searched the documentation but did not found any information about
> a solution for this. So, my question is: how can I specify a configuration
> that is valid for ANY path that ends with “querierRouter”? In my mind, this
> is mandatory to make it viable (as the path can vary dynamically). Or did I
> miss something? I have to isolate my blocking threads into a router to
> avoid blocks inside my actor system but I do not know how to configure this
> router in a situation which many kinds of actors could ask for data.
>
> Thanks in advance.
>
>
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] exactly *one* persistence actor with the same persistenceId active ?

2014-09-06 Thread Martynas Mickevičius
Hi Olger,

yes, a unique PersistenceId per PersistentActor. However there can be as
many PersistentViews having the same PersistenceId.


On Fri, Sep 5, 2014 at 6:26 PM, Olger Warnier  wrote:

> Hi guys,
>
> simple question: is it expected that exactly 1 PersistentActor that makes
> use of a specific persistenceId is active ?
>
> In order to get all changes of my AggregateRoot, I've build a publisher
> that tells that this aggregate has changed. By using a single
> persistenceId, it's possible to read for all instances of the aggregate and
> thereafter fire up a specific view for the specific AggregateRoot. (nothing
> new here, all discussed in other threads)
>
> My idea was to build an extension for that as that is a nice and usable
> way to publish these changes.
> Side effect is that every actor system that actually does the domain for
> this aggregate (and with cluster sharding, it is expected to be more than
> 1) will run such a publisher actor (that is actually a PersistentActor).
> This gives 'strange' behaviour around the persistence sequence numbers
> (actually counting per live actor system) that made me wondering if this
> approach appropriate.
>
> I've got the feeling that the answer is 'yes', still handy to have it here
> for the record.
>
> Kind regards,
>
> Olger
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 Cluster 2.3.4 nodes unable to reconnect to cluster

2014-09-06 Thread Martynas Mickevičius
> #auto-down-unreachable-after = 10s
>
> use-dispatcher = akka.cluster-dispatcher
>   }
>
>   loggers = ["akka.event.slf4j.Slf4jLogger"]
>   # Options: OFF, ERROR, WARNING, INFO, DEBUG
>   loglevel = "INFO"
>   log-config-on-start = off
>
> }
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Cluster aware routers with routees that needs some time to be initialized

2014-09-06 Thread Martynas Mickevičius
Hi Bartłomiej,

I would suggest to have one actor for the long initialization and the other
one which would match the routee path. Then the first one can start the
second one after the initialization is complete, and the second one can
relay messages to the first one via context.parent or explicitly passed
ActorRef.


On Wed, Sep 3, 2014 at 1:02 AM, Bartłomiej Szczepanik 
wrote:

> Dear Akka users,
>
> I want to user group router as a load balancer for an actor deployed on
> different nodes. The actor needs some time to become usable, let us say 1
> minute. Currently I am using registerOnMemberUp pattern to create the actor
> after the cluster is in UP state. As far as understood from the docs,
> router will immediately try to use the new actor when I add a new node. How
> can I avoid it? Should I join to the cluster after the actor will be
> initialized fully? What if I need to do it earlier for some purposes? Is
> there any more elegant solutions for that?
>
> Best,
> Bartłomiej
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 as MQs

2014-09-06 Thread Martynas Mickevičius
Hi Behard,

for reliability on fail-over you can use PersistentActor
<http://doc.akka.io/docs/akka/2.3.6/scala/persistence.html> with
AtLeastOnceDelivery trait. For priority management you can look at Mailbox
<http://doc.akka.io/docs/akka/2.3.6/scala/mailboxes.html> implementations
that support priority handling.


On Mon, Sep 1, 2014 at 8:23 AM, Behrad Zari  wrote:

> I'm new to akka, since I have some Erlang experience it was looking
> familiar for me at first step. We are going to rewrite a SMS
> aggregator/gateway whose job is to route messages between different SMSC
> endpoints. I'm trying to it with least complexity (akka + camel) without
> any Message Broker involved.
> I want to here your points How well can akka play a message broker role in
> my case?
>
> We will be charged twice if we send a message twice (don't think we want
> at-least-once reliability)
> We need some reliability and failover not to miss many messages.
> We may need priority Queues as well later.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Cluster aware routers with routees that needs some time to be initialized

2014-09-08 Thread Martynas Mickevičius
I think the documentation has not been updated on that topic. There is an
issue <https://github.com/akka/akka/issues/15241> to fix that.

Since Akka 2.3 group routers use ActorSelection which should work for your
case.


On Sat, Sep 6, 2014 at 6:30 PM, Bartłomiej Szczepanik 
wrote:

> Thanks for the reply. I was thinking about this approach, but I discarded
> it after seeing this warning in the documentation:
> "The routee actors should be started as early as possible when starting
> the actor system, because the router will try to use them as soon as the
> member status is changed to 'Up'. If it is not available at that point it
> will be removed from the router and it will only re-try when the cluster
> members are changed."
>
> Can I somehow enforce cluster-aware router to re-try the lookup without
> changing the memberships in the cluster?
>
> Best,
> Bartłomiej
>
>
> 2014-09-06 11:15 GMT+02:00 Martynas Mickevičius <
> martynas.mickevic...@typesafe.com>:
>
>> Hi Bartłomiej,
>>
>> I would suggest to have one actor for the long initialization and the
>> other one which would match the routee path. Then the first one can start
>> the second one after the initialization is complete, and the second one can
>> relay messages to the first one via context.parent or explicitly passed
>> ActorRef.
>>
>>
>> On Wed, Sep 3, 2014 at 1:02 AM, Bartłomiej Szczepanik 
>> wrote:
>>
>>> Dear Akka users,
>>>
>>> I want to user group router as a load balancer for an actor deployed on
>>> different nodes. The actor needs some time to become usable, let us say 1
>>> minute. Currently I am using registerOnMemberUp pattern to create the actor
>>> after the cluster is in UP state. As far as understood from the docs,
>>> router will immediately try to use the new actor when I add a new node. How
>>> can I avoid it? Should I join to the cluster after the actor will be
>>> initialized fully? What if I need to do it earlier for some purposes? Is
>>> there any more elegant solutions for that?
>>>
>>> Best,
>>> Bartłomiej
>>>
>>> --
>>> >>>>>>>>>> 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.
>>>
>>
>>
>>
>> --
>> Martynas Mickevičius
>> Typesafe <http://typesafe.com/> – Reactive
>> <http://www.reactivemanifesto.org/> Apps on the JVM
>>
>> --
>> >>>>>>>>>> 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.
>>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Cluster aware routers with routees that needs some time to be initialized

2014-09-10 Thread Martynas Mickevičius
Thank you, Konrad!

On Tue, Sep 9, 2014 at 12:36 PM, Konrad Malawski  wrote:

> Hi guys,
> I've updated the docs (and resolved this issue).
> It should now be clearer to users what to expect from the group router:
> https://github.com/akka/akka/issues/15241
>
> Cheers!
>
> On Mon, Sep 8, 2014 at 9:09 AM, Martynas Mickevičius <
> martynas.mickevic...@typesafe.com> wrote:
>
>> I think the documentation has not been updated on that topic. There is an
>> issue <https://github.com/akka/akka/issues/15241> to fix that.
>>
>> Since Akka 2.3 group routers use ActorSelection which should work for
>> your case.
>>
>>
>> On Sat, Sep 6, 2014 at 6:30 PM, Bartłomiej Szczepanik 
>> wrote:
>>
>>> Thanks for the reply. I was thinking about this approach, but I
>>> discarded it after seeing this warning in the documentation:
>>> "The routee actors should be started as early as possible when starting
>>> the actor system, because the router will try to use them as soon as the
>>> member status is changed to 'Up'. If it is not available at that point it
>>> will be removed from the router and it will only re-try when the cluster
>>> members are changed."
>>>
>>> Can I somehow enforce cluster-aware router to re-try the lookup without
>>> changing the memberships in the cluster?
>>>
>>> Best,
>>> Bartłomiej
>>>
>>>
>>> 2014-09-06 11:15 GMT+02:00 Martynas Mickevičius <
>>> martynas.mickevic...@typesafe.com>:
>>>
>>>> Hi Bartłomiej,
>>>>
>>>> I would suggest to have one actor for the long initialization and the
>>>> other one which would match the routee path. Then the first one can start
>>>> the second one after the initialization is complete, and the second one can
>>>> relay messages to the first one via context.parent or explicitly passed
>>>> ActorRef.
>>>>
>>>>
>>>> On Wed, Sep 3, 2014 at 1:02 AM, Bartłomiej Szczepanik <
>>>> mequ...@gmail.com> wrote:
>>>>
>>>>> Dear Akka users,
>>>>>
>>>>> I want to user group router as a load balancer for an actor deployed
>>>>> on different nodes. The actor needs some time to become usable, let us say
>>>>> 1 minute. Currently I am using registerOnMemberUp pattern to create the
>>>>> actor after the cluster is in UP state. As far as understood from the 
>>>>> docs,
>>>>> router will immediately try to use the new actor when I add a new node. 
>>>>> How
>>>>> can I avoid it? Should I join to the cluster after the actor will be
>>>>> initialized fully? What if I need to do it earlier for some purposes? Is
>>>>> there any more elegant solutions for that?
>>>>>
>>>>> Best,
>>>>> Bartłomiej
>>>>>
>>>>> --
>>>>> >>>>>>>>>> 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.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Martynas Mickevičius
>>>> Typesafe <http://typesafe.com/> – Reactive
>>>> <http://www.reactivemanifesto.org/> Apps on the JVM
>>>>
>>>> --
>>>> >>>>>>>>>> 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 th

Re: [akka-user] Per-request actor trait

2014-09-15 Thread Martynas Mickevičius
Hi Richard,

you can use type parameters in the case classes and in the creator methods.

trait PerRequest[Request] extends Actor {
  ...
}

object PerRequest {
  case class WithActorRef[Request](r: RequestContext,target:
ActorRef,message: Request) extends PerRequest[Request]
}

trait PerRequestCreator { this: Actor =>
  def perRequest[Request](r: RequestContext,target: ActorRef,
  message: Request) = context.actorOf(Props(new WithActorRef(r,
target, message)))
}


On Sat, Sep 13, 2014 at 5:47 PM, Richard Rodseth  wrote:

> I asked about this on spray-user, but thought I'd try here since this list
> rocks and it relates to Akka and an Activator template.
>
> I'm wondering how one would make this:
>
>
> https://github.com/NET-A-PORTER/spray-actor-per-request/blob/master/src/main/scala/com/netaporter/routing/PerRequest.scala
>
> more generic. In the sample, the messages are assumed to extend a trait
> RestMessage, which in the sample is part of the domain package. I don't
> suppose that's a great burden, and it doesn't have to be part of the domain
> package, but I wondered if it could be a type parameter or type member.
> When I tried, I ran into a problem with the definitions in the companion
> object not having access to the type.
>
> Perhaps I'm barking up the wrong tree, but if anyone else has thought
> about this, or there are other equally good expressions of the per-request
> actor pattern, please let me know.
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Restarting Actor System in JBoss application server

2014-09-16 Thread Martynas Mickevičius
ava:724)
>>>
>>> We have the Akka Remoting properties set as :
>>>
>>> "remote":{"netty":{"tcp":{"port":10024,"hostname":""}}}
>>>
>>> We need this fixed remote port for other nodes in the akka cluster to
>>> connect to.
>>>
>>> Is there a way we can avoid this bind exception during actor system
>>> restart? Please advise.
>>>
>>> Regards,
>>> Anoop
>>>
>>>  --
>>> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] From an Akka newbie: a design challenge

2014-10-07 Thread Martynas Mickevičius
Hi Khoa,

it is great that you find Akka exciting. Let me help you with your
questions.

On Fri, Oct 3, 2014 at 10:07 PM, Khoa Nguyen  wrote:

> I am supposed to design and implement a distributed solution for a client.
> I look at Akka and the Actor's model and immediately fall in love :-) But
> can this love last?
>
> Here is the brief description of the application, say MyApp:
>
> MyApp reads and immediately acks requests from HTTPS client(s): HTTP POST
> --> 201 created.
> Each request has a unique tracsaction ID and contains multiple sub-requests
> MyApp extracts sub-requests from a request
> MyApp posts each sub-request on a JMS queue for external backend system
> External system consumes and processes each sub-request and post
> sub-response on another JMS queue or topic
> MyApp consumes sub-responses and correlates them by transaction ID into a
> single response
> Send the response back to client
>
> MyApp is going to be deployed on 4 or more nodes to support geo-redundancy.
>
> I am thinking of Akka cluster and trying to come up with a design but
> still have difficulties:
>
> 1) Request*Reader*Actor: read and ack requests
>Question: client should be able to connect to any node. Do I need 4 of
> this, one per node, or a clustered actor is ok, or there's a better way?
>

It is always hard to answer such questions directly. Client will have to
use Akka Cluster Client
<http://doc.akka.io/docs/akka/2.3.6/contrib/cluster-client.html> to send
messages to the cluster. There you can use Cluster Sharding
<http://doc.akka.io/docs/akka/2.3.6/contrib/cluster-sharding.html> to
distribute request handling actors throughout the cluster.

2) RequestReaderActor on receiving a request message:
>
> 2a) Sends the request to Request*Handler*Actor: split the request
> into multiple sub-requests and put them on JMS queue
> Question: Should I instead make RequestReaderActor a router to spawn a set
> of RequestHandlerActors to handle potentially large load?
>

Moving from simple ActorRef to router is just a configuration change. So
you can start small and then change to Cluster Router
<http://doc.akka.io/docs/akka/2.3.6/scala/cluster-usage.html#Cluster_Aware_Routers>
if your benchmarks say that you need to.

2b) Creates a ResponseAggregatorActor to wait with timeout and
> correlate sub-responses from external system
>
> 3) SubResponseReaderActor: a JMS client to consume sub-responses from
> external system
>Question: similar to 1), do I need 4 of this, one per node?
>Question: on receiving sub-response, how do I tell this actor to
> forward the sub-response to the matching (by request ID)
> ResponseAggregatorActor?
>

If there is no actor handling a particular request ID, you can just create
one with request ID in its name and then use ActorSelection to send
sub-responses there.


> 4) What is the cost of creating actors on the fly? In general, when should
> I prefer dynamic actors vs pre-created ones?
>

Actor creation is very cheap. When in doubt - create a new actor, which
should only do one thing, and do it well.


> Thanks in advance for your comments, which certainly guide me to a better
> design.
>
> Khoa
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Bind exception with multiple Akka cluster nodes on same machine

2014-10-07 Thread Martynas Mickevičius
> failed] [
> akka.remote.RemoteTransportException: Startup failed
> at
> akka.remote.Remoting.akka$remote$Remoting$$notifyError(Remoting.scala:136)
> at akka.remote.Remoting.start(Remoting.scala:201)
> at
> akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:184)
> at
> akka.cluster.ClusterActorRefProvider.init(ClusterActorRefProvider.scala:58)
> at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:618)
> at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:615)
> at akka.actor.ActorSystemImpl._start(ActorSystem.scala:615)
> at akka.actor.ActorSystemImpl.start(ActorSystem.scala:632)
> at akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
> at akka.actor.ActorSystem$.apply(ActorSystem.scala:118)
> at akka.actor.ActorSystem$.create(ActorSystem.scala:66)
> at akka.actor.ActorSystem.create(ActorSystem.scala)
> at
> org.ambitious.actorexps.clusterexps.ClusterBootStrap1.startup(ClusterBootStrap1.java:43)
> at
> org.ambitious.actorexps.clusterexps.ClusterBootStrap1.main(ClusterBootStrap1.java:25)
> Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /
> 127.0.0.1:1551 (Same exception observed for 1552 and 1553 nodes during
> startup)
> at
> org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
> at
> akka.remote.transport.netty.NettyTransport$$anonfun$listen$1.apply(NettyTransport.scala:393)
> at
> akka.remote.transport.netty.NettyTransport$$anonfun$listen$1.apply(NettyTransport.scala:389)
> at scala.util.Success$$anonfun$map$1.apply(Try.scala:206)
> at scala.util.Try$.apply(Try.scala:161)
> at scala.util.Success.map(Try.scala:206)
> at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
> at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
> at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
> at
> akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67)
> at
> akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82)
> at
> akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
> at
> akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
> at
> scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
> at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
> at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
> at
> akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
> at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
> at
> scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
> at
> scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
> at
> scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
> Caused by: java.net.BindException: Address already in use: bind
> at sun.nio.ch.Net.bind0(Native Method)
> at sun.nio.ch.Net.bind(Net.java:444)
> at sun.nio.ch.Net.bind(Net.java:436)
> at
> sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
> at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
> at
> org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
> at
> org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:372)
> at
> org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:296)
> at
> org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
>
> Regards
> Muthu
>
> --
> >>>>>>>>>> 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 

Re: [akka-user] Akka design patterns for high read/write environments (multiplayer games)

2014-10-07 Thread Martynas Mickevičius
Hi Chris,

On Sun, Oct 5, 2014 at 1:52 AM,  wrote:

> I have a multiplayer game framework that is written on top of akka, and
> there is a recurring problem that to this day I haven't really found a
> 'best' solution for.
>
> I'm going to keep this simple and leave out a lot of the details for now.
> The core issue is you have up to several thousand clients sending in
> messages at a rate of around every 60ms each, that can result in data
> transformations to itself, or other clients.
> The result of these transformations have to be immediately visible to all
> other clients.  When a data structure is updated, the delta that changed is
> sent to a subset of the clients.  The subset is normally all effected
> clients plus all clients in a specific range.  It can be up to the complete
> set, let's say at least several hundred.
>
>
> So the approach I have been leaning towards, is to use actors to transform
> the data, but to keep a global (per server) cache of that data that other
> actors can read.  Mostly through using ConcurrentHashMap.A specific map
> has one and only one actor that can mutate it, other actors treat it as
> immutable.  To scale this locally, I would use consistent hashing to
> distribute the map out over several maps (with each node having it's own
> actor).
>

Just an observation. Do you need to use ConcurrentHashMap if it is mutated
by only one Actor?


>
> Persistence is not an issue here as that is already handled by the actors
> responsible for mutating the maps, which send an async update to the
> persistence layer which is designed to handle high write volumes.
>

Have you considered using Akka Persistence
<http://doc.akka.io/docs/akka/2.3.6/scala/persistence.html>? You could use
a PersistentActor for the write part of your application and PersistentView
for the read side to cut the distributed map layer.


>
> I've used this approach already to some extent, but before I really
> formalize it more, I want to get some feedback.
>
> Chris
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Akka Multi Node Testing

2014-10-07 Thread Martynas Mickevičius
Hi Jen,

when this bug is closed it will have a milestone corresponding to the Akka
version it has been fixed.

On Sun, Oct 5, 2014 at 9:41 AM, jen  wrote:

> Many thanks for the useful comments! Definitely I will learn Scala :)
> Could you tell me what is the expected due date of the 2.3.x milestone and
> how can I know which akka version has it corrected?
>
> 2014. szeptember 22., hétfő 6:28:01 UTC+2 időpontban jen a következőt írta:
>
>> I tried  translate to Java of the existing Scala codes:
>>
>> public class ClusterTest {
>>
>> protected RoleName first;
>>
>> @Test
>> public void SimpleClusterListenerClusterJoinTest() throws Exception {
>> new MultiNodeSpec(new MultiNodeConfig() {{
>> first = this.role("first");
>> second = this.role("second");
>> third = this.role("third");
>> this.commonConfig(ConfigFactory.parseString(
>> "akka.crdt.convergent.leveldb.destroy-on-shutdown = on\n" +
>> "akka.actor.provider = 
>> akka.cluster.ClusterActorRefProvider\n" +
>> "akka.cluster.auto-join = off\n" +
>> "akka.cluster.auto-down = on\n" +
>> "akka.loggers = [\"akka.testkit.TestEventListener\"]\n" +
>> "akka.loglevel = INFO\n" +
>> "akka.remote.log-remote-lifecycle-events = off")); }}) {
>> {
>> Address firstAddress = node(first).address();
>> @SuppressWarnings("serial")
>> ArrayList firstnode = new 
>> ArrayList() {{
>> add(first);
>> }};
>> Seq fisrtnodeseq = 
>> (Seq)JavaConversions.asScalaBuffer(firstnode).toList();
>> runOn(fisrtnodeseq, null);
>>
>> Cluster cluster = new Cluster((ExtendedActorSystem) 
>> system());
>> cluster.join(firstAddress);
>> // verify that single node becomes member
>> cluster.subscribe(testActor(), MemberEvent.class);
>> expectMsg(MemberUp.class);
>> }
>>
>> @Override
>> public int initialParticipants() {
>> return roles().size();
>> }};
>>
>> }
>>
>> }
>>
>> HOWEVER During the run with the arguments: -Dmultinode.max-nodes=4
>> -Dmultinode.host=127.0.0.1 etc. according to Multi Node Testing
>> <http://doc.akka.io/docs/akka/snapshot/dev/multi-node-testing.html> I
>> will get the following error:
>>
>> java.lang.IllegalArgumentException: invalid ActorSystem name 
>> [ClusterTest_2], must contain only word characters (i.e. [a-zA-Z0-9] plus 
>> non-leading '-')
>> at akka.actor.ActorSystemImpl.(ActorSystem.scala:497)
>> at akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
>> at akka.actor.ActorSystem$.apply(ActorSystem.scala:118)
>> at akka.remote.testkit.MultiNodeSpec.(MultiNodeSpec.scala:252)
>> at com.akkamint.demo.ClusterTest$2.(ClusterTest.java:51)
>>
>> is the internally generated ActorSystem name wrong?
>>
>> Besides this I have two questions:
>> 1. How can access the gossips from Java as in the Scala code,
>>
>> awaitCond(Cluster(system).latestGossip.members.exists(m ⇒ m.address == 
>> firstAddress && m.status == Up))
>>
>> as I have not found any way to implement the same in Java. My workaround
>> is to subscribe to member events (see above), otherwise I do not know, is
>> if this effectively the same or not?
>> 2. Thunk function (the second argument of runOn method)? What is that?
>> How can use it?
>>
>> I appreciate your help.
>>
>>
>>  --
> >>>>>>>>>> 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 t

Re: [akka-user] Akka scheduleOnce question for sending emails - beginner

2014-10-07 Thread Martynas Mickevičius
Hello Jay,

have you tried adding a debug statement in the sendMail method, to see if
it is not called repeatedly? If you see it being called more than needed
print out stack trace and see from where it is initiated.

I would presume that MailJob class extends Runnable, right? Check if you
are not sending emails from the constructor of that class.

On Sun, Oct 5, 2014 at 11:08 PM, 'Jay Blanton' via Akka User List <
akka-user@googlegroups.com> wrote:

> I am a newbie to Akka and I am using it via a plugin through my Play
> Application.
>
> The code that is being used in Akka sends emails out to customers:
>
> public Cancellable sendMail(final Mail email) {
> email.setFrom(sender);
> return Akka
> .system()
> .scheduler()
> .scheduleOnce(delay, new MailJob(email),
> Akka.system().dispatcher());
> }
>
>
> I am trying to troubleshoot an issue where people are receiving  multiple
> emails a day for a month, but this method is only invoked when someone
> presses a button on the web page.  We are utilizing AWS SES with Rackspace.
>
> My question is, would there be anything within this Akka call that would
> cause this to be scheduled multiple times a day for an infinite amount of
> time (even after application redeployments to a new folder that I start my
> application from and multiple application restarts)?
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Critical:Multiple Views For One PersistentActor

2014-10-07 Thread Martynas Mickevičius
Hello Prakhyat,

yes, you can have multiple PersistentViews for one persistenceId.

PersistentViews will have a bit of a rethink in the near future as
noted in this
thread <https://groups.google.com/forum/#!topic/akka-user/MNDc9cVG1To>.

On Mon, Oct 6, 2014 at 9:40 AM, Prakhyat Mallikarjun 
wrote:

> Team,
>
> Will akka persistence support multiple views for one PersistentActor?
>
> If yes, is it recommended to use multiple views for one PersistentActor?
> Are there any drawbacks of multiple views for one persistent actor?Also can
> any future enhancement in akka persistence impact this behavior?
>
> -Prakhyat M M
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] When is a persistent view done recovering

2014-10-08 Thread Martynas Mickevičius
Hello Dan,

a PersistentActor is told to be in recovery when it is receiving messages
from the journal. When message replay from the journal is completed and
PersistenActor starts processing messages from the live system - recovery
is finished.

On the contrary, PersistentView is always getting messages from the
journal. It is constantly in recovery state.

It is true that PersistentView can get other messages from the system while
also getting messages from the journal. To check if the message is from the
journal or not, you can call isPersistent in ProcessorView
<http://doc.akka.io/api/akka/2.3.6/?_ga=1.98725278.1605653757.1411556235#akka.persistence.PersistentView>
while
handling a message.

Hope this helps.

On Wed, Oct 8, 2014 at 1:43 AM, Dan Hopkins  wrote:

> Hello all,
>
> In akka 2.3.6 persistence the docs seem to suggest that a persistent view
> has these methods:
>
>
>1. def recoveryRunning: Boolean
>2. def recoveryFinished: Boolean
>
>
> But these methods are on a PersistentActor, not a PersistentView.
>
> How does a view check to see if the messages it's getting are recoveries?
> I don't see any public methods that would help and it doesn't seem to get a
> recovery complete.
>
> Thanks,
> Dan
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Multiple Akka Cluster with distributed journal

2014-10-08 Thread Martynas Mickevičius
Hello Ratika,

if both of these clusters are running simultaneously and with the same
Actor System name, then you should not replicate their data, because the
sate of these clusters will be different, and replicating it would make it
corrupt.

However if only one cluster is being run at a time you could replicate
cluster data among data centers. Then if first data center would fail, you
could start a cluster in the second data center on the latest data.

That being said, entries in cluster shards are being persistent
<https://github.com/akka/akka/issues/15496> only in the current development
branch of Akka 2.4. Until then you will not get much advantage when
replicating cluster sharding data.

On Tue, Oct 7, 2014 at 10:31 PM, ratika prasad  wrote:

> Hi,
>
> We have two Akka Clusters(using sharding extension as well) each of two
> nodes in two data centers which takes distinct traffic, Data Center 1 had
> Akka cluster 1 of two nodes and Data Center 2 has Akka cluster 2 with two
> nodes again. We have distributed journal ( Cassandra ) configured for both
> the clusters in their respective data centers. However due to some fall
> over mechanism the data is replicated from the journal /snapshots tables
> configured for these two separate clusters on two different data center
> from one data center to another. Is this correct should we we doing this at
> all ?
>
> As per my understanding these two clusters are independent from each other
> and thus the data ( ShardCordinator details  + shard to server mapping etc)
> should not be replicated across these data centers as these impact the two
> akka clusters on these two data centers running independent of each other.
>
> Kindly suggest
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 stream compression / decompression

2014-10-08 Thread Martynas Mickevičius
Hello Nicolas,

is this the code you are running or is the the simplified example?

I am asking, because you do not need to use FlowGraph in a linear use case
like this. Broadcast junction that you create and use only once is meant to
split the stream into two or more legs.

Another issue in this code on the publisher side is that you are grouping
and mapping on iterator and not on the Flow. I think you should move these
operation to the flow.

The producer side with FlowGraph creation removed and combinator operations
moved to the Flow then would look like:

// warning, not compiled
IteratorSource(byteStream).grouped(chunkSize).map(StreamOps.toByteString)
.produceTo(outputStream)

On Tue, Oct 7, 2014 at 11:53 PM, Nicolas Jozwiak 
wrote:

> Hello,
>
>I’m currently using akka stream to stream some big files and it works
> quit well :)
>
>But in the FlowGraph stream I want to add some compression and
> decompression steps.
>
>Compression seems working correctly, but I’ve got some offset errors
> when the decompression is executed.
>
> To help, here is the code :
>
> On the Producer :
>
>   // ByteIterator implements Iterable[Byte] and reads the file byte by
> byte
>
>  val byteStream = new ByteIterator(buffStream)
>
>  FlowGraph { implicit builder =>
>
> val broadcast = Broadcast[ByteString]
>
> val in =
> IteratorSource(byteStream.grouped(chunkSize).map(StreamOps.toByteString))
>
> val compress = FlowFrom[ByteString].map(StreamOps.compress)
>
> val out = SubscriberSink(outputStream)
>
> in ~> broadcast ~> compress ~> out
>
>   }.run()
>
>
>   val toByteString = { bytes: Seq[Byte] =>
>
> val b = new ByteStringBuilder
>
> b.sizeHint(bytes.length)
>
> b ++= bytes
>
> b.result()
>
>   }
>
>
> On the Subscriber :
>
>  val writeToFile = ForeachSink {
>
> data: ByteString =>
>
>   channel.write(data.asByteBuffer)
>
>   }
>
>   val in = PublisherSource(publisher)
>
>   FlowGraph { implicit builder =>
>
> val decompress = FlowFrom[ByteString].map(StreamOps.decompress)
>
> val broadcast = Broadcast[ByteString]
>
> in ~> decompress ~> broadcast ~> writeToFile
>
>   }.run()
>
> Compression, decompression are based on LZ4 Api :
>
> def compress(inputBuff: Array[Byte]): Array[Byte] = {
>
> val inputSize = inputBuff.length
>
> val lz4 = lz4factory.fastCompressor
>
> val maxOutputSize = lz4.maxCompressedLength(inputSize)
>
> val outputBuff = new Array[Byte](maxOutputSize + 4)
>
> val outputSize = lz4.compress(inputBuff, 0, inputSize, outputBuff, 4,
> maxOutputSize)
>
>
> outputBuff(0) = (inputSize & 0xff).toByte
>
> outputBuff(1) = (inputSize >> 8 & 0xff).toByte
>
> outputBuff(2) = (inputSize >> 16 & 0xff).toByte
>
> outputBuff(3) = (inputSize >> 24 & 0xff).toByte
>
> outputBuff.take(outputSize + 4)
>
>   }
>
>
>   def decompress(inputBuff: Array[Byte]): Array[Byte] = {
>
> val size: Int = (inputBuff(0).asInstanceOf[Int] & 0xff) |
>
>   (inputBuff(1).asInstanceOf[Int] & 0xff) << 8 |
>
>   (inputBuff(2).asInstanceOf[Int] & 0xff) << 16 |
>
>   (inputBuff(3).asInstanceOf[Int] & 0xff) << 24
>
> val lz4 = lz4factory.fastDecompressor()
>
> val outputBuff = new Array[Byte](size)
>
> lz4.decompress(inputBuff, 4, outputBuff, 0, size)
>
> outputBuff
>
>   }
>
> In my mind, the decompression process is executed with a byte array which
> has not the same size than the one compress…
>
> Do you have any clues on that ?
>
> Thanks for your help.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Critical:Multiple Views For One PersistentActor

2014-10-08 Thread Martynas Mickevičius
On Tue, Oct 7, 2014 at 1:33 PM, Prakhyat Mallikarjun 
wrote:

> Hi Martynas,
>
> Thanks. Still I have open questions.
>
> We are working on POC using akka persistence. Want to use views, but
> looking clarity on below,
>
> Are there any drawbacks of multiple views for one persistent actor?
>

No drawbacks. Just another actor getting messages from the journal.

I have updated myself from this thread
> <https://groups.google.com/forum/#!topic/akka-user/MNDc9cVG1To>. Consider
> we start using multiple views, any future enhancement in akka persistence
> views impact code/implementation?
>

The PersistentView API will surely change, because it will become more
powerfull on the query side.

-Prakhyat M M
>
>
>
> On Tuesday, 7 October 2014 14:46:06 UTC+5:30, Martynas Mickevičius wrote:
>>
>> Hello Prakhyat,
>>
>> yes, you can have multiple PersistentViews for one persistenceId.
>>
>> PersistentViews will have a bit of a rethink in the near future as noted
>> in this thread
>> <https://groups.google.com/forum/#!topic/akka-user/MNDc9cVG1To>.
>>
>> On Mon, Oct 6, 2014 at 9:40 AM, Prakhyat Mallikarjun 
>> wrote:
>>
>>> Team,
>>>
>>> Will akka persistence support multiple views for one PersistentActor?
>>>
>>> If yes, is it recommended to use multiple views for one
>>> PersistentActor? Are there any drawbacks of multiple views for one
>>> persistent actor?Also can any future enhancement in akka persistence impact
>>> this behavior?
>>>
>>> -Prakhyat M M
>>>
>>> --
>>> >>>>>>>>>> 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.
>>>
>>
>>
>>
>> --
>> Martynas Mickevičius
>> Typesafe <http://typesafe.com/> – Reactive
>> <http://www.reactivemanifesto.org/> Apps on the JVM
>>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 stream compression / decompression

2014-10-08 Thread Martynas Mickevičius
Okay. That makes sense then.

What kind of errors are you getting? Are the ByteStrings received in a
different order?

Have you tested compress/decompress method implementation?

On Wed, Oct 8, 2014 at 12:08 PM, Nicolas Jozwiak 
wrote:

> Hi Martynas,
>
>Yes it's a simplified example, because we use another branch to do some
> some digester process.
> Here the complete code  :
>
> FlowGraph { implicit builder =>
>   val broadcast = Broadcast[ByteString]
>
>   // streamDigester is an extends to Subscriber and update a
> MessageDigest object
>   val digester = SubscriberSink(streamDigester)
>
>   val in =
> IteratorSource(byteStream.grouped(chunkSize).map(StreamOps.toByteString))
>
>   val compress = FlowFrom[ByteString].map(StreamOps.compress)
>   val out = SubscriberSink(outputStream)
>
>   in ~> broadcast ~> compress ~> out
>   broadcast ~> digester
>
>     }.run()
>
> Nicolas.
> Le mercredi 8 octobre 2014 10:34:17 UTC+2, Martynas Mickevičius a écrit :
>>
>> Hello Nicolas,
>>
>> is this the code you are running or is the the simplified example?
>>
>> I am asking, because you do not need to use FlowGraph in a linear use
>> case like this. Broadcast junction that you create and use only once is
>> meant to split the stream into two or more legs.
>>
>> Another issue in this code on the publisher side is that you are grouping
>> and mapping on iterator and not on the Flow. I think you should move these
>> operation to the flow.
>>
>> The producer side with FlowGraph creation removed and combinator
>> operations moved to the Flow then would look like:
>>
>> // warning, not compiled
>> IteratorSource(byteStream).grouped(chunkSize).map(StreamOps.toByteString)
>> .produceTo(outputStream)
>>
>> On Tue, Oct 7, 2014 at 11:53 PM, Nicolas Jozwiak 
>> wrote:
>>
>>> Hello,
>>>
>>>I’m currently using akka stream to stream some big files and it works
>>> quit well :)
>>>
>>>But in the FlowGraph stream I want to add some compression and
>>> decompression steps.
>>>
>>>Compression seems working correctly, but I’ve got some offset errors
>>> when the decompression is executed.
>>>
>>> To help, here is the code :
>>>
>>> On the Producer :
>>>
>>>   // ByteIterator implements Iterable[Byte] and reads the file byte by
>>> byte
>>>
>>>  val byteStream = new ByteIterator(buffStream)
>>>
>>>  FlowGraph { implicit builder =>
>>>
>>> val broadcast = Broadcast[ByteString]
>>>
>>> val in = IteratorSource(byteStream.grouped(chunkSize).map(
>>> StreamOps.toByteString))
>>>
>>> val compress = FlowFrom[ByteString].map(StreamOps.compress)
>>>
>>> val out = SubscriberSink(outputStream)
>>>
>>> in ~> broadcast ~> compress ~> out
>>>
>>>   }.run()
>>>
>>>
>>>   val toByteString = { bytes: Seq[Byte] =>
>>>
>>> val b = new ByteStringBuilder
>>>
>>> b.sizeHint(bytes.length)
>>>
>>> b ++= bytes
>>>
>>> b.result()
>>>
>>>   }
>>>
>>>
>>> On the Subscriber :
>>>
>>>  val writeToFile = ForeachSink {
>>>
>>> data: ByteString =>
>>>
>>>   channel.write(data.asByteBuffer)
>>>
>>>   }
>>>
>>>   val in = PublisherSource(publisher)
>>>
>>>   FlowGraph { implicit builder =>
>>>
>>> val decompress = FlowFrom[ByteString].map(StreamOps.decompress)
>>>
>>> val broadcast = Broadcast[ByteString]
>>>
>>> in ~> decompress ~> broadcast ~> writeToFile
>>>
>>>   }.run()
>>>
>>> Compression, decompression are based on LZ4 Api :
>>>
>>> def compress(inputBuff: Array[Byte]): Array[Byte] = {
>>>
>>> val inputSize = inputBuff.length
>>>
>>> val lz4 = lz4factory.fastCompressor
>>>
>>> val maxOutputSize = lz4.maxCompressedLength(inputSize)
>>>
>>> val outputBuff = new Array[Byte](maxOutputSize + 4)
>>>
>>> val outputSize = lz4.compress(inputBuff, 0, inputSize, outputBuff,
>>> 4, maxOutputSize)
>>>
>>>
>>> outputBuff(0) = (inputSize & 0xff).toByte
>>>
>>> outputBuff(1) = (inp

Re: [akka-user] BatchingExecutor reentrancy

2014-10-08 Thread Martynas Mickevičius
ar:na]
>   at akka.pattern.PromiseActorRef.$bang(AskSupport.scala:269)
> ~[akka-actor_2.10-2.2.4.jar:2.2.4]
>   at akka.actor.ActorRef.tell(ActorRef.scala:125)
> ~[akka-actor_2.10-2.2.4.jar:2.2.4]
>
> Thanks,
> Duarte
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 stream compression / decompression

2014-10-08 Thread Martynas Mickevičius
Have you tried it with smaller chunk sized?

On Wed, Oct 8, 2014 at 12:34 PM, Nicolas Jozwiak 
wrote:

> The compress / decompress implementation works well (tested with a simple
> example without stream).
>
> The ByteString I receive are not the same size from the compression. For
> example a chunk size of 2, it will be 19065 after compression. From the
> decompression I will receive 19070 to decompress...
>
> Here the stack error :
>
> net.jpountz.lz4.LZ4Exception: Error decoding offset 10 of input buffer
> at
> net.jpountz.lz4.LZ4JNIFastDecompressor.decompress(LZ4JNIFastDecompressor.java:33)
> ~[lz4-1.2.0.jar:na]
>
> Nicolas.
>
> Le mercredi 8 octobre 2014 11:14:53 UTC+2, Martynas Mickevičius a écrit :
>>
>> Okay. That makes sense then.
>>
>> What kind of errors are you getting? Are the ByteStrings received in a
>> different order?
>>
>> Have you tested compress/decompress method implementation?
>>
>> On Wed, Oct 8, 2014 at 12:08 PM, Nicolas Jozwiak 
>> wrote:
>>
>>> Hi Martynas,
>>>
>>>Yes it's a simplified example, because we use another branch to do
>>> some some digester process.
>>> Here the complete code  :
>>>
>>> FlowGraph { implicit builder =>
>>>   val broadcast = Broadcast[ByteString]
>>>
>>>   // streamDigester is an extends to Subscriber and update a
>>> MessageDigest object
>>>   val digester = SubscriberSink(streamDigester)
>>>
>>>   val in = IteratorSource(byteStream.grouped(chunkSize).map(
>>> StreamOps.toByteString))
>>>
>>>   val compress = FlowFrom[ByteString].map(StreamOps.compress)
>>>   val out = SubscriberSink(outputStream)
>>>
>>>   in ~> broadcast ~> compress ~> out
>>>   broadcast ~> digester
>>>
>>> }.run()
>>>
>>> Nicolas.
>>> Le mercredi 8 octobre 2014 10:34:17 UTC+2, Martynas Mickevičius a écrit :
>>>>
>>>> Hello Nicolas,
>>>>
>>>> is this the code you are running or is the the simplified example?
>>>>
>>>> I am asking, because you do not need to use FlowGraph in a linear use
>>>> case like this. Broadcast junction that you create and use only once is
>>>> meant to split the stream into two or more legs.
>>>>
>>>> Another issue in this code on the publisher side is that you are
>>>> grouping and mapping on iterator and not on the Flow. I think you should
>>>> move these operation to the flow.
>>>>
>>>> The producer side with FlowGraph creation removed and combinator
>>>> operations moved to the Flow then would look like:
>>>>
>>>> // warning, not compiled
>>>> IteratorSource(byteStream).grouped(chunkSize).map(StreamOps.
>>>> toByteString).produceTo(outputStream)
>>>>
>>>> On Tue, Oct 7, 2014 at 11:53 PM, Nicolas Jozwiak 
>>>> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>>I’m currently using akka stream to stream some big files and it
>>>>> works quit well :)
>>>>>
>>>>>But in the FlowGraph stream I want to add some compression and
>>>>> decompression steps.
>>>>>
>>>>>Compression seems working correctly, but I’ve got some offset
>>>>> errors when the decompression is executed.
>>>>>
>>>>> To help, here is the code :
>>>>>
>>>>> On the Producer :
>>>>>
>>>>>   // ByteIterator implements Iterable[Byte] and reads the file byte
>>>>> by byte
>>>>>
>>>>>  val byteStream = new ByteIterator(buffStream)
>>>>>
>>>>>  FlowGraph { implicit builder =>
>>>>>
>>>>> val broadcast = Broadcast[ByteString]
>>>>>
>>>>> val in = IteratorSource(byteStream.grouped(chunkSize).map(
>>>>> StreamOps.toByteString))
>>>>>
>>>>> val compress = FlowFrom[ByteString].map(StreamOps.compress)
>>>>>
>>>>> val out = SubscriberSink(outputStream)
>>>>>
>>>>> in ~> broadcast ~> compress ~> out
>>>>>
>>>>>   }.run()
>>>>>
>>>>>
>>>>>   val toByteString = { bytes: Seq[Byte] =>
>>>>>
>>>>> val b = new ByteStringBu

Re: [akka-user] Before and after receive

2014-10-08 Thread Martynas Mickevičius
Hello Kasper,

I think that having only one entry point for messages exposed in the Actor
trait (the receive method) is very flexible. It allows users to build
various use case specific implementations. Adding aroundReceive would help
to some of the use cases, but it would also add complexity. What if someone
would come up with a use case for aroundAroundReceive?

This is use case specific and IMHO should not be generalized.

On Mon, Oct 6, 2014 at 4:57 PM,  wrote:

> Hi
>
> I have been looking at the implementation of akka persistence and would
> like to implement some of our functionality in a similar way (batching some
> messages for our storage created during the receive method and send them in
> one batch after receive, and executing a handler when storage has been
> confirmed).
>
> Our problem is that the aroundReceive method in Actor is protected[akka].
> I think it might be of value to provide an trait to be able to do some
> stuff before and after the receive method is called.
>
> We can of course implement the trait our self but think it might be of
> value to others. Furthermore it would be good to know that we can continue
> rely on the before and after methods and not worry that the internal api in
> Akka changes.
>
> The trait could be something like this:
>
>
> trait BeforeAndAfterReceive extends Actor{
>   override protected[akka] def aroundReceive(receive: Receive, msg: Any) =
> {
> if(beforeReceive(receive, msg)) {
>   super.aroundReceive(receive, msg)
>   afterReceive(receive, msg)
> }
>
>
>   }
>   def beforeReceive(receive: Receive, msg: Any):Boolean
>   def afterReceive(receive: Receive, msg: Any):Unit
> }
>
> Are there any pitfalls using this approach or other suggestions to
> implement the batching .
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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-cluster-sharding: question about ShardResolver return values

2014-10-08 Thread Martynas Mickevičius
Hi Andrzej,

your understanding is correct. If you use aggregateRootId for resolving
shards, every shard in your system will have only one entry (actor) because
extracted entry and shard identifiers would match for every message. I do
not see it as a problem. In fact in this configuration rebalancing process
would affect only one aggregateRootId per moved shard.

As for using only a part of UUID there is one catch particular to the way
UUIDs are generated. There are several different versions of UUID and it is
not guaranteed that if a UUID in its entirety is unique, a part of it is
unique too. So I would suggest hashing it and then taking first N needed
symbols from the hash itself.

On Mon, Oct 6, 2014 at 3:00 PM, Andrzej Dębski 
wrote:

> Hello
>
> I wanted to integrate akka-cluster-sharding with my akka-persistence
> application. I read the documentation and browsed through the code in
> activator but one thing is still a bit of a mystery to me.
>
> Currently in my application each PersistentActor is identified by UUID
> value. All messages that those actors receive inherit custom trait 
> DomainCommand
> which has method aggregateRootId: UUID. Based on this and on
> documentation my IdExtractor looks like this:
>
> val domainCommandIdExtractor: ShardRegion.IdExtractor = {
> case command: DomainCommand => (command.aggregateRootId.toString,
> command)
>   }
>
> Now what about ShardResolver. According to the documentation it says that:
>
> Try to produce a uniform distribution, i.e. same amount of entries in each
>> shard. As a rule of thumb, the number of shards should be a factor ten
>> greater than the planned maximum number of cluster nodes.
>
>
> And in the example there is (id % 12).toString.
>
> I am wondering if it would be wrong to just return string representation
> of UUID - that way I will have unique number of entries per shard because 
> ShardResolver
> should return unique strings per PersistentActor.
>
> If I understand the documentation correctly it would result in 1 actor per
> shard grouping (and if number of shards > number of nodes I will have
> multiple shards on one node) - the drawback (I think) is that using this
> scheme the large number of shards may cause problems during
> rebalancing/adding new actor when the number of shards is large.
>
> If the scheme of just returning UUID value is not very good idea (be it
> because of the reason I mentioned or the other one) should I use some
> number of first characters from UUID so it will result in grouping of many
> actors per shard? This way I will have 16, 256, ... possible return values
> from ShardResolver
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Separate ports for Cluster Mgmt messages and Application Messages

2014-10-08 Thread Martynas Mickevičius
Hi,

currently all communication between remote actor systems is done on the
same network channel. However heartbeat messages have priority over other
messages.

On Mon, Oct 6, 2014 at 12:19 PM, Muthukumaran Kothandaraman <
muthu.kmk2...@gmail.com> wrote:

> Hi,
>
> Is it possible to isolate the cluster management messages (such as Member
> messages and other system-level messages) could be configured to use a
> separate port for application messages (messages defined by user-apps)
> through configuration ?
>
> In-banding and out-of-band system messaging have their own advantages and
> disadvantages. Just trying to understand if there is a provision to isolate
> these via different communication channels in a cluster
>
> Regards
> Muthu
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Problem with Akka-streams and IllegalStateExceptions

2014-10-08 Thread Martynas Mickevičius
Hello Carl,

I have tried your example with the latest streams code (which is constantly
in flux) and I was able to reproduce the same error. I think it deserves a
registered issue, since it has creeped from the last released version and
still is in the latest code.

On Tue, Oct 7, 2014 at 10:59 AM,  wrote:

> The following code fails to run with the exception 
> *java.lang.IllegalStateException:
> FanoutOutputs only supports one subscriber (which is allowed, see
> reactive-streams specification, rule 1.12)*:
>   val bcast = Broadcast[String]
>   val merge = Merge[String]
>   val in1 = IterableSource(List("a"))
>   val in2 = IterableSource(List("b"))
>   val out1 = PublisherSink[String]
>   val out2 = PublisherSink[String]
>
>   val graph = FlowGraph { implicit b ⇒
> import FlowGraphImplicits._
>
> in1 ~> FlowFrom[String] ~> merge
> in2 ~> FlowFrom[String] ~> merge
> merge ~> FlowFrom[String] ~> bcast
> bcast ~> FlowFrom[String] ~> out1
> bcast ~> FlowFrom[String] ~> out2
>   }.run()
>
>   val out1Probe = StreamTestKit.SubscriberProbe[String]()
>   val out2Probe = StreamTestKit.SubscriberProbe[String]()
>
>   FlowFrom(out1.publisher(graph))
> .publishTo(out1Probe)
>
>   FlowFrom(out2.publisher(graph))
> .publishTo(out2Probe)
>
> A similar result can be obtained by using the *build wikipedia
> Topological_sorting* in FlowGraphCompileSpec.scala and wiring up at least
> two out nodes to subscribers (except that the exception pertains to
> SimpleOutputs).
>
> Any help in understanding this issue further or how one should debug such
> issues would be greatly appreciated.
>
> Many thanks,
>
> Carl.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Using Tell or Ask with Akka Persistence and REST

2014-10-09 Thread Martynas Mickevičius
Ahh, Richard beat me to it. :)

On Thu, Oct 9, 2014 at 5:33 PM, Martynas Mickevičius <
martynas.mickevic...@typesafe.com> wrote:

> Hello Prakhyat,
>
> have you seen this article
> <http://techblog.net-a-porter.com/2013/12/ask-tell-and-per-request-actors/>
> which discusses ask vs tell patterns?
>
> I assume from the other thread, that you are using Java. To sum up the
> mentioned article, if you use Play framework for handling REST calls, you
> could return a Future from the controller. That future would be fulfilled
> by the promise in the per-request actor.
>
> On Thu, Oct 9, 2014 at 9:57 AM, Prakhyat Mallikarjun <
> prakhyat...@gmail.com> wrote:
>
>> Team,
>>
>> We are working on a simple POC. The POC is developed on the approach
>> event sourcing/DDD/CQRS.
>>
>> The PersistentActors are shaded. PersistentViews are created to push
>> events from write side towards query side.
>>
>> The business logic resides in PersistentActors. The rest API's are
>> written to invoke PersistentActors. The rest layer invokes PersistentActor
>> and waits for response. This looks like synchronous, we are using Ask
>> pattern. The rest layer has to wait till the PersistentActor is done
>> with business logic and returns.
>>
>> The ask pattern comes with a cost i.e. to specify timeout while making a
>> call to other actor. If the response is not received within timeout
>> specified, exception will be raised.
>>
>> Tell in other perspective is asynchronous. The actor making a "tell" call
>> need not wait for response.
>>
>> What are your recommendations/insights on using tell vs ask?
>>
>> -Prakhyat M M
>>
>>
>>
>>  --
>> >>>>>>>>>> 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.
>>
>
>
>
> --
> Martynas Mickevičius
> Typesafe <http://typesafe.com/> – Reactive
> <http://www.reactivemanifesto.org/> Apps on the JVM
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Using Tell or Ask with Akka Persistence and REST

2014-10-09 Thread Martynas Mickevičius
Hello Prakhyat,

have you seen this article
<http://techblog.net-a-porter.com/2013/12/ask-tell-and-per-request-actors/>
which discusses ask vs tell patterns?

I assume from the other thread, that you are using Java. To sum up the
mentioned article, if you use Play framework for handling REST calls, you
could return a Future from the controller. That future would be fulfilled
by the promise in the per-request actor.

On Thu, Oct 9, 2014 at 9:57 AM, Prakhyat Mallikarjun 
wrote:

> Team,
>
> We are working on a simple POC. The POC is developed on the approach event
> sourcing/DDD/CQRS.
>
> The PersistentActors are shaded. PersistentViews are created to push
> events from write side towards query side.
>
> The business logic resides in PersistentActors. The rest API's are
> written to invoke PersistentActors. The rest layer invokes PersistentActor
> and waits for response. This looks like synchronous, we are using Ask
> pattern. The rest layer has to wait till the PersistentActor is done with
> business logic and returns.
>
> The ask pattern comes with a cost i.e. to specify timeout while making a
> call to other actor. If the response is not received within timeout
> specified, exception will be raised.
>
> Tell in other perspective is asynchronous. The actor making a "tell" call
> need not wait for response.
>
> What are your recommendations/insights on using tell vs ask?
>
> -Prakhyat M M
>
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Sharding and Persistent Views

2014-10-09 Thread Martynas Mickevičius
Hi,

if you want to have PersistentViews ceated on the same node as
corresponding PersistentActors - use Cluster Sharding for PersistentViews
as well. Just make sure that ShardResolver function resolves to the same
Shard ID for messages meant for the corresponding PersistentActors and
PersistentViews.

On Thu, Oct 9, 2014 at 9:46 AM, Prakhyat Mallikarjun 
wrote:

> Team,
>
> We are taking approach of DDD with event sourcing(akka persistence).
> PersistentActors representing aggregate roots will be sharded by UUID. Also
> for query side we are planning to use views.
>
> One view will be implemented per PersistentActor.
>
> The persistent actor will be sharded based on UUID of aggregate roots and
> will be distributed across multiple nodes. The behavior is run time
> PersistentActors can be created in any clustered node.
>
> But what about the behavior of PersistentView? Will PersistentView's be
> created in same JVM as PersistentActor? Want to understand how 
> PersistentView's
> will be created in distributed nodes when PersistentActor's are shaded?
>
> -Prakhyat M M
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Spark Streaming Akka Cloudera 5.1.3

2014-10-09 Thread Martynas Mickevičius
Hello Ankur,

it looks like a network problem. Do you have required ports open between
Cloudera nodes?

Also make sure to refer to your nodes with the same address that you have
provided in the corresponding node *akka.remote.netty.tcp.hostname*
configuration.

On Thu, Oct 9, 2014 at 9:32 AM, Ankur Jain  wrote:

> Hi Team,
> We had created a simulator (akka based) that is sending 400-500 msg/sec.
> Same is consumed by subscriber using Spark Streaming and write to HDFS
>
> *Environment details:*
> 1) Akka: 2.2.3
> 2) Spark: 1.0.0-cdh5.1.3
> 3) Scala: 2.10.4
>
> *Cloudera Details 5.1.3:*
> 1) Master Node: INHYDBILXHDP01
> 2) Worker node: INHYDBILXHDP02
> All nodes are free from firewall and have access to each-other
>
> *Prog runs well when we run it with below command :*
> spark-submit --class com.deere.springxd.domaineventstream.source.StartApp
> --master *local[2] *domain-event-stream-source-cdh5.1.3-Ankur.jar
>
> *Same Prog fails when we run it with below command*
> spark-submit --class com.deere.springxd.domaineventstream.source.StartApp
> --master *spark://INHYDBILXHDP01:7077*
> domain-event-stream-source-cdh5.1.3-Ankur.jar
>
> *Errors *
> 1. *Cloudera worker log file* AssociationError
> [akka.tcp://sparkWorker@INHYDBILXHDP02:7078] ->
> [akka.tcp://sparkExecutor@INHYDBILXHDP02:55625]: Error [Association
> failed with [akka.tcp://sparkExecutor@INHYDBILXHDP02:55625]] [
> akka.remote.EndpointAssociationException: Association failed with
> [akka.tcp://sparkExecutor@INHYDBILXHDP02:55625]
>
> 2. *Spark Worker log *java.lang.ClassNotFoundException:
> com.deere.fieldstreams.commons.serviceapi.EquipmentEvent at
> java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
> java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
> java.security.AccessController.doPrivileged(Native Method) at
> java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>
> 3. *Simulator:* [WARN] [10/01/2014 13:54:21.243]
> [EventDispatcherSimulator-akka.remote.default-remote-dispatcher-7]
> [akka.tcp://EventDispatcherSimulator@YI1000965LT.Y
> ash.com:2552/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fspark%40INHYDBILXHDP02%3A46504-0]
> Association with remote system [akka.tcp ://spark@INHYDBILXHDP02:46504]
> has failed, address is now gated for [5000] ms. Reason is: [Disassociated].
>
>
>
> *Error Logs: (Attached)*
>
>
>
> Please guide us as to what needs to be done to get this fixed. Also if
> anything else is required than plz do let me know.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] When is a persistent view done recovering

2014-10-09 Thread Martynas Mickevičius
Hi Michael,

yes, that makes sense. However PersistentView does not know when the
original recovery has finished and when the new messages since the creation
of PersistentView are being replayed. Lets think of some solutions to this
use case.

One solution I can see to this would be to do frequent snapshoting of the
PersistentView state. Then it would be possible to know that the recovery
is SnapshotOffer and other messages are replay from the journal.

Another solution would be asking for last persisted sequence number when
creating PersistentView. Then recovering PersistentView could track
incoming messages and determine when recovery is finished and when replay
starts.

On Wed, Oct 8, 2014 at 2:26 PM, delasoul  wrote:

> Hello,
>
> depending on how PersistentViews are used, it can be "valuable"
> information.
> If I use the PersistentView as Read model and  the PersistentView is
> started and replayed only on request (so not in memory all the time),
> probably
> I need to do smthg after replay has finished and before I answer the
> request.
>
> michael
>
>
> On Wednesday, 8 October 2014 10:10:55 UTC+2, Martynas Mickevičius wrote:
>>
>> Hello Dan,
>>
>> a PersistentActor is told to be in recovery when it is receiving messages
>> from the journal. When message replay from the journal is completed and
>> PersistenActor starts processing messages from the live system - recovery
>> is finished.
>>
>> On the contrary, PersistentView is always getting messages from the
>> journal. It is constantly in recovery state.
>>
>> It is true that PersistentView can get other messages from the system
>> while also getting messages from the journal. To check if the message is
>> from the journal or not, you can call isPersistent in ProcessorView
>> <http://doc.akka.io/api/akka/2.3.6/?_ga=1.98725278.1605653757.1411556235#akka.persistence.PersistentView>
>>  while
>> handling a message.
>>
>> Hope this helps.
>>
>> On Wed, Oct 8, 2014 at 1:43 AM, Dan Hopkins  wrote:
>>
>>> Hello all,
>>>
>>> In akka 2.3.6 persistence the docs seem to suggest that a persistent
>>> view has these methods:
>>>
>>>
>>>1. def recoveryRunning: Boolean
>>>2. def recoveryFinished: Boolean
>>>
>>>
>>> But these methods are on a PersistentActor, not a PersistentView.
>>>
>>> How does a view check to see if the messages it's getting are
>>> recoveries? I don't see any public methods that would help and it doesn't
>>> seem to get a recovery complete.
>>>
>>> Thanks,
>>> Dan
>>>
>>> --
>>> >>>>>>>>>> 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.
>>>
>>
>>
>>
>> --
>> Martynas Mickevičius
>> Typesafe <http://typesafe.com/> – Reactive
>> <http://www.reactivemanifesto.org/> Apps on the JVM
>>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Problem with Akka-streams and IllegalStateExceptions

2014-10-13 Thread Martynas Mickevičius
Hello Carl,

you are right. It is still an issue and I closed your reported ticket with
the wrong resolution. I have opened a new issue here
<https://github.com/akka/akka/issues/16085>. Using FanoutPublisher is still
a viable workaround.

As to your second problem, it has been fixed
<https://github.com/akka/akka/issues/15900> in 0.9.

On Sat, Oct 11, 2014 at 7:12 PM,  wrote:

> Hi Martynas,
>
>   looking at the resolution of issue #16058, I see that it is suggested to
> use toFanoutPublisher rather than toPublisher (which produceTo calls).
>
> My first problem is that I’m having difficulty seeing why more than one
> subscribe call is being made here when I materialise a producer? Any help
> or pointers here would be appreciated.
>
> My next problem is that when I replace calls to produceTo (for out1 and
> out2) with:
>
>
> FlowFrom(out1.publisher(graph)).toFanoutPublisher(x,y).subscribe(out1Probe)
>
> as I have 2 (or more) calls to toFanoutPublisher, I now get a:
>
>   akka.actor.InvalidActorNameException: actor name [fanout] is not unique!
>
> Again, any help here appreciated.
>
> Many thanks,
>
>   Carl.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Pub/Sub performance for app-level wildcard filering

2014-10-13 Thread Martynas Mickevičius
Hi Behrad,

On Sat, Oct 11, 2014 at 10:12 PM, Behrad Zari  wrote:

> I want to dispatch messages to wildcard registered (can be remote)
> subscribers. I see two possibilities:
>
> 1) Can I use remote actors as akka-camel endpoints? + routes using .when
> with regex on messages would gimme wildcard pushing at the sender
>

you can't specify an actor as a camel endpoint.

You can use ActorSelection to select multiple actors (even remote ones)
with a wildcard. However a wildcard in ActorSelection can only select all
actors at the specified depth.


> 2) Distributed Pub/Sub but unfortunately it doesn't support wildcard
> subscribers. So can I accept the overhead to subscribe all subscribers to a
> single topic, and let them filter messages by their own regex? Would this
> send-to-all semantic become a bottleneck in 1000 msg/sec deployment?
>

This needs a benchmark to see if it would be a bottleneck or not. However
Akka Distributed PubSub uses optimization and sends a message over the wire
only once per node (if that node has a matching topic).

Another approach could be using a EventBus with custom classification
rules. However EvenBus is local ActorSystem only. You would need to
subscribe remote actors to the EventBus explicitly to carry messages from
one node to another.

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



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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-stream] Understanding conflate and zip

2014-10-15 Thread Martynas Mickevičius
Hi Vladimir,

you have hit on the interesting issue. Your understanding is correct but
the output of your example is not what you expect, because every stage in
the stream works in batches. The size of the batch is the size of the input
buffer which can be set in *akka.stream.materializer.{initial,
max}-input-buffer-size.*

So when zip asks upstream for more elements it asks for more than one
element. That request can be fulfilled by the faster source with an element
every 100 milliseconds which it does and conflate does not have time to
kick in. That is why you see lots of 1s printed out.

>From time to time buffers align and zip's request for more elements is
fulfilled first by accumulated value by the conflate and then again by 1s
every 100 milliseconds.

A quick fix is setting input buffer size to 1 for a whole stream. However
that makes the whole stream slower.

val set = MaterializerSettings(system).withInputBuffer(1, 1)
implicit val fm = FlowMaterializer(set)

A more proper fix would be to provide "synchronize" element which would be
the same zip under the hood but with the buffer size of one. Could you
create an issue in Akka issue tracker for that?

On Tue, Oct 14, 2014 at 11:07 PM, Vladimir Koshelev <
vr.koshe...@googlemail.com> wrote:

> Hi,
>
> I'm trying to use akka-stream and struggling to understand how conflate
> works. Here a snippet of code I'm using:
>
> object ConflateDemo extends App {
>
>   import scala.concurrent.duration._
>
>   implicit val system = ActorSystem("demo")
>
>   implicit val fm = FlowMaterializer()
>
>   case object Tick
>
>   val fast = FlowFrom(Duration.Zero, 100.millis, () =>
> Tick).conflate[Int](_ => 1, (acc,_) => acc + 1)
>
>   val slow = FlowFrom(Duration.Zero, 1.second, () => Tick)
>
>   import akka.stream.scaladsl2.FlowGraphImplicits._
>
>   val g = FlowGraph { implicit b =>
>
> val zip = Zip[Int, Tick.type]
>
> slow ~> zip.right
>
> fast ~> zip.left
>
> zip.out ~> FlowFrom[(Int, Tick.type)].map(_._1) ~> ForeachSink[Int](
> v =>  print(" " + v))
>
>   }.run
>
> }
>
> }
>
> My intention is to create two streams, first produces events 10 times
> faster than the second one. Conflate on the fast stream should count
> events. Then I zip those streams and print results of conflate out.
>
> My understanding of how it should work:
>
>
>- conflate consumes events produced by fast stream as fast as they can
>be produced, so there is always demand and all ticks are emitted and
>counted.
>- As soon as an event from the slow flow arrives to the zip, zip
>demands an element from conflate and sends them into sink.
>
> So, I have expected output looking like: 10 10 10 10 10 ...
> What I get:  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 55 1 1 1 1 1 1 1 73 1 1 1 1 1
> 1 1 73 1 1 1 1 1 1 1 73 1 1 1 1 1 1 1 73 1 1 1 1 1 1 1 72 1 1 1 1 1 1 1 74
> 1 1 1 1 1 1 1 72 1 1 ...
>
> What am i missing? Is there some mistake in the code or do I misunderstand
> how conflate and zip are working?
>
>
> Vladimir
>
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Setting custom jms message header with Akka Camel

2014-11-07 Thread Martynas Mickevičius
Hello Henry,

I think that the solution you came up with is very decent. I have
registered an issue <https://github.com/akka/akka/issues/16249> for the
referenced method which is not there anymore.

On Fri, Nov 7, 2014 at 2:42 PM, Henry Coles 
wrote:

>
> On Thursday, 6 November 2014 14:21:52 UTC, Henry Coles wrote:
>
>>
>> According to the docs for 1.3.1 this sort of thing can be done by
>> overriding the receiveBeforeProduce method. Although this method is still
>> referred to in the scala doc in 2.3.6, it no longer seems to exist.
>>
>> How should custom headers now be added in a Producer?
>>
>>
> Simple solution I came up with for this was to create an actor that
> receives my internal message type and constructs a CamelMessage with
> headers etc before forwarding it to the Producer actor. Would be interested
> if there is a better way.
>
> Thanks
>
> Henry
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Setting custom jms message header with Akka Camel

2014-11-07 Thread Martynas Mickevičius
Have you seen transformOutgoingMessage
<https://github.com/akka/akka/blob/cb05725c1ec8a09e9bfd57dd093911dd41c7b288/akka-camel/src/main/scala/akka/camel/Producer.scala#L89>
which
I have just noticed?

On Fri, Nov 7, 2014 at 5:32 PM, Martynas Mickevičius <
martynas.mickevic...@typesafe.com> wrote:

> Hello Henry,
>
> I think that the solution you came up with is very decent. I have
> registered an issue <https://github.com/akka/akka/issues/16249> for the
> referenced method which is not there anymore.
>
> On Fri, Nov 7, 2014 at 2:42 PM, Henry Coles 
> wrote:
>
>>
>> On Thursday, 6 November 2014 14:21:52 UTC, Henry Coles wrote:
>>
>>>
>>> According to the docs for 1.3.1 this sort of thing can be done by
>>> overriding the receiveBeforeProduce method. Although this method is still
>>> referred to in the scala doc in 2.3.6, it no longer seems to exist.
>>>
>>> How should custom headers now be added in a Producer?
>>>
>>>
>> Simple solution I came up with for this was to create an actor that
>> receives my internal message type and constructs a CamelMessage with
>> headers etc before forwarding it to the Producer actor. Would be interested
>> if there is a better way.
>>
>> Thanks
>>
>> Henry
>>
>> --
>> >>>>>>>>>> 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.
>>
>
>
>
> --
> Martynas Mickevičius
> Typesafe <http://typesafe.com/> – Reactive
> <http://www.reactivemanifesto.org/> Apps on the JVM
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] SSL Support of akka-http(0.9)

2014-11-07 Thread Martynas Mickevičius
Hello Zirou,

I am afraid this is still not possible also with the just released 0.10.

You can follow progress on SSL in these
<https://github.com/akka/akka/issues/16167> tickets
<https://github.com/akka/akka/issues/16106>.

On Fri, Nov 7, 2014 at 6:50 AM,  wrote:

> I tried to get contents of SSL encrypted page by
> using akka.http.HTTP.Connect, but i couldn't.(version is 0.9)
> According to the code, coming api will support ssl connection
> by SetupHostConnector's flag, but i could not find how to do it by using
> current API.
> How do i get contents of SSL encrypted page by using current akka-http's
> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Unrecoverable "gated" state in remote system

2014-11-07 Thread Martynas Mickevičius
 automatically
>> transitions to Active" (as you describe in http://doc.akka.io/docs/akka/
>> snapshot/java/remoting.html)
>>
>> this can be verified since I can see the logs on node1 that it tries to
>> connect at this point in time after the restart: 13:10:10.861 (and the
>> connection becomes active on node3; managing node3 -> node1; at time
>> 13:10:10.987 as you can see above)
>>
>> so, everything cool here and the system restarts fine!
>>
>>
>>
>> *Scenario 2 - easy load on the system: Restart fails due to Unrecoverable
>> "gated" state*
>>
>> Similar to Scenario 1 above, I can observe the "gated" messages for
>> links  node3 -> node1 and node3 -> node2.
>>
>> However, I never see that the links become active again! and the restart
>> never recovers and I need to manually stop my nodes and start up again.
>>
>> This is surprising since I clearly see that node1 and node2 (after they
>> restarted) send message to node3. and node3 successfully logs the reception
>> of these messages.
>>
>> So, why does in this scenario the connection not become active again?? It
>> is a successful inbound connection that should make the link active again
>> as you describe on your site?
>>
>>
>>
>> Any help on this is greatly appreciated. otherwise we need to roll back
>> to Scala 2.10 (or 2.9) and an older version of Akka.
>>
>> Thanks,
>> Robert
>>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 with Java 8 lambda support - MDC

2014-11-07 Thread Martynas Mickevičius
Hi,

there is Logging.apply(logSource: Actor)
<https://github.com/akka/akka/blob/fe1718c88f19c95785f479ffa186959146cbca04/akka-actor/src/main/scala/akka/event/Logging.scala#L526-L530>
which
you can use with AbstractActor.

On Thu, Nov 6, 2014 at 10:40 PM,  wrote:

> I'm testing the experimental Java 8 lambda support with akka and
> AbstractActor, but I cannot seem to find a way to use the MDC feature this
> way. With an untyped actor, I can do Logging.getLogger(this) and get a
> DiagnosticLoggingAdapter with MDC support. However, since AbstractActor
> does not extend UntypedActor, I can only get a regular LoggingAdapter, with
> no way to set the MDC. Am I missing something? Is it possible with
> AbstractActor, or do I need to switch back to using UntypedActor?
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 cluster and scheduled tasks

2014-11-07 Thread Martynas Mickevičius
Hi Brian.

what about scheduling a task on a master (cluster singleton) and then
delegating the work to workers using Cluster Aware
<http://doc.akka.io/docs/akka/2.3.6/scala/cluster-usage.html#Cluster_Aware_Routers>
Round Robin Router?

On Thu, Nov 6, 2014 at 7:58 PM, Brian Wawok  wrote:

> So let's say I have an akka cluster of 5 nodes. 4 are "worker nodes" and 1
> is the "master" node, the master implemented via an akka singleton (
> http://doc.akka.io/docs/akka/snapshot/contrib/cluster-singleton.html ).
>
> Then I use a worker registration type pattern to have the workers tell the
> master when they are free and hand out work(ala
> http://letitcrash.com/post/29044669086/balancing-workload-across-nodes-with-akka-2
> ).
>
> This all works good. If the master node dies, a new master is elected.
> Cool!
>
> Now what I need to fit on top of this, is scheduled tasks. I want the
> master to schedule a unit of work every 30 seconds, and give it to one of
> his workers. How do I do this?
>
> On a single machine you just do a scheduled task.. but if I do that on all
> nodes of the cluster, I would get the task happening 5 times. Possible
> ideas:
>
> a) Schedule task on every machine. If your machine does not have the
> master node running on it, skip it. So it only runs once. (would need to
> see if I can figure out which node a singleton proxy points to, for the
> implementation of this)
> b) Schedule task on every machine. When the schedule hits, send a message
> to master to say HEY DO THE TASK NOW... master would need to keep track of
> when he last did it, and if he already did it in the last 30 seconds skip
> it (so say he gets 5 messages to do work for task A, he would do the first
> task and delete the next 4).
> c) ?
>
> Part of the trick is as nodes crash and the master singleton moves around,
> the tasks need to keep happening. I am ok with a task being skipped once in
> a while (like during a master switch), but would want to generally prevent
> them from being run multiple times.
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Unrecoverable "gated" state in remote system

2014-11-07 Thread Martynas Mickevičius
I think these messages are fine. After node{1,2} comes back on node3 should
associate with new nodes.

>From the logs I see that there is quite a lot of custom code running (such
as diva.core.engine.PaxosDistributedKeyManager) which is listening for
Association/Disassociation Events. Have you tried the restart scenario with
some load with simplest actors possible and see if you can reproduce the
issue?

On Fri, Nov 7, 2014 at 7:37 PM, Robert Preissl 
wrote:

> Hello Martynas,
>
> Well, I think I can rule this option out because:
> - without any load on the system (my scenario 1 in my orig. post) a
> restart works fine.
> - also, most of the time node3 can send back messages to node2. but node3
> does not send to node1. (however, sometimes both nodes, node1 and node2 do
> not hear back from node3)
> - and we also tried with ActorSelection and it did not work.
>
> is it suspicious to see Disassociated messages? or is this just a symptom?
>
> Thanks,
> Robert
>
> On Friday, November 7, 2014 9:15:42 AM UTC-8, Martynas Mickevičius wrote:
>>
>> Hi Robert,
>>
>> as you mentioned and from the logs you provided its seems that messages
>> are flowing from node{1,2} to node3 after restart, but not to the other
>> direction.
>>
>> Would it be possible that your application tries to send messages from
>> node3 to node{1,2} using ActorRefs which were resolved before the restart
>> of node{1,2}? ActorRef includes actor UID which changes after Actor is
>> stopped and started again, which happens upon node restart. Here is
>> <https://github.com/2m/sandbox-akka-remote/blob/fd61036875bcb622e6a5657c16d879bcc7b6b21b/src/main/scala/NodeRestart.scala>
>> a quick example code that illustrates that situation.
>>
>> If so, you should send messages using ActorSelection or re-resolve
>> ActorRefs after node restart or periodically.
>>
>> On Fri, Nov 7, 2014 at 3:58 AM, Robert Preissl 
>> wrote:
>>
>>> Hello Endre,
>>>
>>> First of all, thanks for replying so quickly!
>>>
>>> Second, I need to mention that we use Akka remoting. and not Akka
>>> clustering (yet). not sure if this makes a difference.
>>>
>>> What I mean that in our restart scenario (where first node1 and node2
>>> are simultaneously restarted. and then node3) when node1 and node2 are
>>> coming back up, it seems that the connection node1 -> node3 works fine. but
>>> the connection node3 -> node1 does not.
>>>
>>> So, to answer your question, yes, it seems we loose messages from node3.
>>>
>>> I attached more detail logs below. (and please excuse the many log
>>> lines; i tried to clean it up as much as possible)
>>>
>>> what is interesting to see is this line:
>>> *processing Event(Disassociated [akka.tcp://DivaPCluster@10.57.0.43:8900
>>> <http://DivaPCluster@10.57.0.43:8900>] ->
>>> [akka.tcp://DivaPCluster@10.57.0.41:8900
>>> <http://DivaPCluster@10.57.0.41:8900>]*
>>>
>>> 10.57.0.43 is node3. and 10.57.0.41 is node1, by the way.
>>>
>>> so, the connection between node3 and node1 is Disassociated; which
>>> explains maybe why node1 never hears back from node3 when it tries to sync
>>> up.
>>>
>>> We looked a bit in the akka source code and found that stopping an
>>> EndpointWriter (I think) triggers a "Disassociated" to be fired, right? and
>>> we can see this stop in a few log lines above:
>>>
>>> *[akka://DivaPCluster/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FDivaPCluster%4010.57.0.41%3A8900-0/endpointWriter]
>>> akka.remote.EndpointWriter - stopping*
>>>
>>> so, why is it stopping? is this our problem here?
>>>
>>> the logs from node3 are attached as a file.
>>>
>>> Thank you!
>>>
>>> Robert
>>>
>>>
>>>
>>> On Wednesday, November 5, 2014 12:55:04 PM UTC-8, Robert Preissl wrote:
>>>>
>>>> hello!
>>>>
>>>> I am having a problem in my remote Akka production system, which
>>>> consists of 3 nodes running with the latest version of Akka (2.3.6.):
>>>>
>>>> In more details, I am experiencing errors with "*rolling restarts*" of
>>>> the cluster (for deployment, etc.  we cannot afford any downtime), where a
>>>> restart happens in the following sequence
>>>> 1.) restart node1 and node2.
>>>> 2.) once 1. completed, restart node3.
>>>>
>>>> *but we only observe f

Re: [akka-user] Right Place To Instantiate Persistence View

2014-11-10 Thread Martynas Mickevičius
Hi,

a good idea is to use postStop to clean up everything that was created in
preStart. For example scheduled tasks or PersistentView actors, etc.

On Wed, Nov 5, 2014 at 9:19 AM, Prakhyat Mallikarjun 
wrote:

> Hi Björn,
>
> Thanks for your inputs.
>
> Sorry its not "postStartup" method, we are currently creating view
> instance from preStart() method of PersisentActor.
>
> I understand your inputs.
>
> The problem I could think when instantiating view from pre start of
> persistent actor is as explained below,
> 1. The persistent actor is created using sharding. We are using single
> writer to handle our domain.
> 2. The persistent actors are sharded by domain's id.
> 3. The persistent actor has "persistenceId" as id of domain object.
> 4. We are creating view from preStart of persistent actor.
> 5. While starting view, persistent id of persistence actor is passed as
> constructor input.
>
> When the persistent actor is created for first time, creating view from
> preStart looks good place and it works.
>
> But consider a case, persistent actor goes down, and view still running.
> When the persistent actor comes up, pre start will be invoked again, and as
> per the code view will be instantiated again. We don't have mechanism to
> check view is up and running, if such mechanism would have exist, we could
> have used to validate whether view can be created again or not.
>
> The view and persistence actor are tightly coupled together. How to get
> rid of this tight coupling? View for persistent actor should run
> independently? How to create views, when persistent actor is sharded?How to
> separate persistent actor from view?
>
> Is there a possibility to shard views? If yes how to created them from
> perspective of single writer approach?
>
> -Prakhyat M M
>
> On Wednesday, 5 November 2014 03:24:17 UTC+5:30, Björn Antonsson wrote:
>>
>> Hi Prakhyat,
>>
>> Where to start your persistent view should be based on what you try to
>> achieve with it, and how tightly coupled its life cycle should be to the
>> persistent actor. You might want to separate them for scalability and
>> performance reasons (the views and actors can have very different
>> peformance characteristics).
>>
>> When you say postStartup method, which method do you mean exactly? I
>> can't find any postStartup method in akka 2.3.6.
>>
>> B/
>>
>> On 31 October 2014 at 13:58:33, Prakhyat Mallikarjun (prakh...@gmail.com)
>> wrote:
>>
>> Team,
>>
>> We are currently instantiating Persistence View's from postStartup method
>> of persistent actor. Is this the right place?
>>
>> What are the recommendations for instantiating Persistence View's? and
>> from where?
>>
>> -Prakhyat M M
>>  --
>> >>>>>>>>>> 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.
>>
>>
>> --
>> Björn Antonsson
>> Typesafe <http://typesafe.com/> – Reactive Apps on the JVM
>> twitter: @bantonsson <http://twitter.com/#!/bantonsson>
>>
>>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] synchronous lookups within an actor receive

2014-11-10 Thread Martynas Mickevičius
Hi Brian,

If everything needed to continue processing the request will be in the
answer to the ID lookup, then you can pipe
<http://doc.akka.io/docs/akka/2.3.6/scala/futures.html#Use_With_Actors> the
future which you'll get while calling Reactive Couchbase APIs to the same
actor and continue request processing as a normal actor message.

Now if you need to merge the request data with the data from the database
before you can continue processing the request, you can either zip the
initial request with contents of the before mentioned future, or you can
use per-request actor
<http://techblog.net-a-porter.com/2013/12/ask-tell-and-per-request-actors/>
pattern to
handle the per-request state.

On Mon, Nov 10, 2014 at 9:39 AM, Brian Silberbauer <
brian.silberba...@gmail.com> wrote:

> Hi all
>
> I need help in designing an actor whose request needs to call a lookup on
> an ID before it can continue its request 'flow'. I was thinking the lookup
> could be done via another actor (against couchbase so it can be reactive),
> but I'm unsure how that call can be neatly returned into the original
> request 'flow'.  I could block and wait for the lookup to complete, or
> leave out the actor and make it a synchronous call or somehow weave it all
> together, but at this stage I don;t have the experience in akka to make
> that call.
>
> Any guidance would be helpful, thanks.
>
> Brian
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Passing large files as akka streams in actor messages?

2014-11-11 Thread Martynas Mickevičius
Hi Allan,

currently akka-stream can only be materialized to actors on one
ActorSystem. Materialization to remote actors or cluster will come
eventually, but not soon.

However you can still use ActorPublisher and ActorSubscriber with remote
actors. Having said that, you need to keep in mind that sending very big
messages via remoting may make actor system less responsive, because
various system messages would possibly not get through in time.

Better approach for sending very large messages over the network would be
to write custom message serving and retrieval using akka-io.

On Thu, Nov 6, 2014 at 4:25 PM, Allan Brighton  wrote:

> Hi,
>
> An actor needs to receive messages containing the binary contents of files
> that can be around 35mb in size.
> Rather than sending an actor message containing an Array[Byte] would it
> make sense to send a message containing an Akka Stream
> (for example, a Source[Byte])? Would this also work with remote actors?
>
> Would it be better for performance to break the data up into chunks (using
> source.grouped(chunkSize)) on the sending side?
> (The receiving actor needs to save the file to disk.)
>
> Thanks,
> Allan
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: Unrecoverable "gated" state in remote system

2014-11-11 Thread Martynas Mickevičius
Hi all,

Robert, you mentioned that you have already tried to change
"heartbeat-interval" setting. Did you change that on
"watch-failure-detector" or on "transport-failure-detector"? Could you try
changing that on "transport-failure-detector"?

If you can still reproduce it can you provide either a reproducible code
sample or logs from both of the systems when messages can only propagate to
one direction?

I have tried various situations while restarting one akka node with some
decent load and I can't reproduce it.

On Fri, Nov 7, 2014 at 10:00 PM, Dragisa Krsmanovic 
wrote:

>  Martynas & Robert,
>
> To me, the most suspicious thing is that, in this case, connection only
> works one way. A can talk to B but B can’t reply back to A.
>
> There is not that much custom code in that class. It’s not subscribed to
> Association/Disassociation or any other Akka system event.
>
> Actor one node is sending message to actor (ActorRef/ActorSelection) on
> another node. Receiver clearly receives the messages and replies with
> "sender ! msg”. We can see that from our logs.
>
> But the sender does not receive the message because the link in that
> direction is disassociated.
>
> This is just plain akka-remote. Not clustering.
>
> It seems like connection health checks that you added in 2.2 are causing
> us trouble with false negatives.
>
> What are configuration options that we can try ? Can we assign a different
> dispatcher to heartbeat failure detector to rule out thread starvation ?
>
> Dragisa Krsmanovic
> Ticketfly
>
> —
> Sent from Mailbox <https://www.dropbox.com/mailbox>
>
> On Friday, Nov 7, 2014 at 9:47 AM, Martynas Mickevičius <
> martynas.mickevic...@typesafe.com>, wrote:
>
>> Hello Martynas,
>>
>> This test is already the simplest scenario we can come up with. It comes
>> from a cluster simulation test framework we have developed to simulate our
>> business needs.
>>
>> If we find the time we can write a simple ping-pong test. but not sure if
>> this is possible. is there any more logging we can try? or changing
>> parameters? (however, i already tried changing the "heartbeat-interval",
>> etc.)
>>
>> Are there any plans to make this more robust in Akka 2.3.7? i fear we
>> need to revert back to older Akka versions.
>>
>> and, can it be that we experience similar issues as reported in this
>> ticket?
>> https://github.com/akka/akka/issues/13860
>>
>> Thanks,
>> Robert
>>
>> On Friday, November 7, 2014 9:47:42 AM UTC-8, Martynas Mickevičius wrote:
>>>
>>> I think these messages are fine. After node{1,2} comes back on node3
>>> should associate with new nodes.
>>>
>>> From the logs I see that there is quite a lot of custom code running
>>> (such as diva.core.engine.PaxosDistributedKeyManager) which is listening
>>> for Association/Disassociation Events. Have you tried the restart scenario
>>> with some load with simplest actors possible and see if you can reproduce
>>> the issue?
>>>
>>> On Fri, Nov 7, 2014 at 7:37 PM, Robert Preissl 
>>> wrote:
>>>
>>>> Hello Martynas,
>>>>
>>>> Well, I think I can rule this option out because:
>>>> - without any load on the system (my scenario 1 in my orig. post) a
>>>> restart works fine.
>>>> - also, most of the time node3 can send back messages to node2. but
>>>> node3 does not send to node1. (however, sometimes both nodes, node1 and
>>>> node2 do not hear back from node3)
>>>> - and we also tried with ActorSelection and it did not work.
>>>>
>>>> is it suspicious to see Disassociated messages? or is this just a
>>>> symptom?
>>>>
>>>> Thanks,
>>>> Robert
>>>>
>>>> On Friday, November 7, 2014 9:15:42 AM UTC-8, Martynas Mickevičius
>>>> wrote:
>>>>>
>>>>> Hi Robert,
>>>>>
>>>>> as you mentioned and from the logs you provided its seems that
>>>>> messages are flowing from node{1,2} to node3 after restart, but not to the
>>>>> other direction.
>>>>>
>>>>> Would it be possible that your application tries to send messages from
>>>>> node3 to node{1,2} using ActorRefs which were resolved before the restart
>>>>> of node{1,2}? ActorRef includes actor UID which changes after Actor is
>>>>> stopped and started again, which happens upon node restart. Here is
>>>>> <https:/

Re: [akka-user] Akka, Camel & ActiveMQ oneway

2014-11-11 Thread Martynas Mickevičius
Hi Jeroen,

I think there is no other reason for that if statement apart from not
sending responses when producer is configured to be one way.

What is the type of the ack that is being sent on a successful message
delivery to the queue? Maybe acks could be handled specially in the
routeResponse method? If after the change no tests are complaining then
there surely was no other reason for that if statement. :)

On Fri, Nov 7, 2014 at 11:39 PM, Jeroen Gordijn 
wrote:

> Hi all,
>
> I want to place a message on a JMS Queue with Akka-Camel. This works just
> fine, however I want to be sure that the message was really placed on the
> queue. The queue is oneway, so I do not expect any response from another
> consumer. However, when I configure this in my code as oneway, the actor
> sending to the producer does not get any notification that the message was
> really delivered on the queue.
>
> ProducerSupport in Akka-Camel has the following code:
>   protected def routeResponse(msg: Any): Unit = if (!oneway) sender()
> ! transformResponse(msg)
>
> This means that I do not get any response when oneway is configured. But
> the endpoint does give feedback whether the message was delivered and this
> is now lost. I solved it by putting the following code in my own producer:
>
>   override protected def routeResponse(msg: Any): Unit = sender() !
> transformResponse(msg)
>
> Is there any reason for the if statement? Can anything go wrong when the
> if statement is dropped in the akka-camel codebase?
>
> Thanks,
> Jeroen
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] ClusterAwareEventBus/EventStream

2014-11-11 Thread Martynas Mickevičius
Hi,

do you have any particular functionality in mind that is not in the current
DistributedPubSubExtension?

On Sun, Nov 9, 2014 at 7:45 AM, 何品  wrote:

> Currently we could implement this via DistributedPubSubExtension,and do
> you guys think this is useful?
> I think this is something like the vertx + vertx's eventbus.when using it
> with the  Distributed Event Bus
> <http://vertx.io/core_manual_java.html#event-bus>
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 2.3.7 Released!

2014-11-12 Thread Martynas Mickevičius
*Dear hAkkers,*

We—the Akka committers—are pleased to be able to announce the availability
of Akka 2.3.7 <http://akka.io/news/2014/11/12/akka-2.3.7-released.html>.
This is the seventh maintenance release of the 2.3 branch. Among other
fixes and improvements this release contains:

   - A fix <https://github.com/akka/akka/issues/16199> for a missing
   predicate parameter in the FSM contributed by litomSegal
   <https://github.com/litomSegal>.
   - A fix <https://github.com/akka/akka/issues/16198> in the FSM docs
   contributed by kosii <https://github.com/kosii>.
   - A fix <https://github.com/akka/akka/issues/15991> for a race between
   sending out acks and UpdatePendingWrite in akka-io. Contributed by
   jrudolph <https://github.com/jrudolph>.
   - An optimization <https://github.com/akka/akka/issues/16286> for
   Mailbox bringing Actor performance improvements.
   - A fix <https://github.com/akka/akka/issues/15766> for akka-io which
   adds a workaround for Windows to detect connection reset events.
   - A fix <https://github.com/akka/akka/issues/16009> for akka-persistance
   where there was no default serializer provided for SnapshotHeader.

The complete list of closed tickets can be found in the 2.3.7 github issues
milestone
<https://github.com/akka/akka/issues?q=milestone%3A2.3.7+is%3Aclosed>.

Akka 2.3.7 is released for Scala 2.10.4 and 2.11.4. This release is
backwards binary compatible with version 2.3.6 which means that the new
JARs are a drop-in replacement for the old one (but not the other way
around) as long as your build does not enable the inliner (Scala-only
restriction). Always make sure to use at least the latest version required
by any of your project’s dependencies.
Migrating from Older Relases

When migrating an existing project from Akka 2.2.x please have a look at
the migration guide
<http://doc.akka.io/docs/akka/2.3.7/project/migration-guide-2.2.x-2.3.x.html>
.
Credits

commits added removed
6 205 332 Martynas Mickevičius
5  90  38 Patrik Nordwall
3  43  12 Björn Antonsson
3  15  20 Konrad 'ktoso' Malawski
1   1   1 xuwei-k
1  35  15 Max Cai
1 446   0 Marcus Ljungblad
1   1   1 litomSegal
1 178  22 Viktor Klang
1 197 121 rasummer
1  16   9 Johannes Rudolph
1  12   7 Roland Kuhn
1 157   6 Endre Sándor Varga
1  30  19 Josh Suereth
1   6   7 Balázs Kossovics

*Happy hAkking!*

-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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: StackOverFlow when using trait

2014-11-12 Thread Martynas Mickevičius
Hi,

this illustrates how traits and self types work in Scala. I do not have
deep knowledge of inner workings of Scala, but you can workaround your
issue by introducing another trait
<https://github.com/2m/akka-actor-sandbox/blob/0974a0cda77f54fef8c565f4f02fa503ed529444/src/main/scala/LifecycleTrait.scala>
.

On Sun, Nov 9, 2014 at 9:35 AM, 何品  wrote:

> The trait seems can't override the actor's lifecycle hook,cause the
> override will cause the lifecycle hook come to be apart of the trait,which
> will cause probleam,when we mixin trait to some other actor witch need the
> hook too.
> I think the best practice maybe ,1 no override the actor's lifecycle
> hook,2 provide some trait level lifecycle hook for the user to call.
>
>
>
> 在 2014年11月9日星期日UTC+8下午3时15分30秒,何品写道:
>
>> Hi,the code blow cause the StackOverFlow error,but if I want to do
>> something useful in an trait and let the actor who want to use mixin it,and
>> that trait need to do some initialize witch need to hook the actor's
>> lifecycle ,then what the best practice?
>> The problem of the code blow is that it will cause the
>> StackOverFlow,that's really definite wrong.
>>
>>
>> trait UsefulTrait {actor:Actor =>
>>   @throws[Exception](classOf[Exception])
>>   override def preStart(): Unit = {
>> //do some thing here
>> actor.preStart()
>>   }
>>
>> }
>>
>> class UsefulActor extends Actor with UsefulTrait{
>>   override def receive: Receive = {
>> case msg => //handle it
>>   }
>>
>>   @throws[Exception](classOf[Exception]) override
>>   def preStart(): Unit = {
>> //do some thing here too
>> super.preStart()
>>   }
>> }
>>
>>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Does akka.io module support SOCKS5?

2014-11-12 Thread Martynas Mickevičius
Hi,

akka-io does not have support of SOCKS proxies. And I have not heard of any
third party extensions that do.

On Sun, Nov 9, 2014 at 5:55 PM, dong  wrote:

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



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Simplest possible setup wich allows system restart of individual nodes

2014-11-13 Thread Martynas Mickevičius
Hi Anders,

it seems that cluster sharding fits the bill here. Especially when in your
current setup you send messages to children based on an ID of the event
which is exactly what sharding by entity ID does.

Now say you have a cluster of nodes and use cluster sharding. If you remove
one node from the cluster the coordinator will rebalance the sharded
entities to the remaining nodes. Same happens when new node joins the
cluster. A predicate upon which fulfillment rebalance is started is defined
in the shard allocation strategy.

You can also use PersistentActors If you want to recover state when sharded
entities are moved to different nodes.

On Mon, Nov 10, 2014 at 12:48 PM, Anders Båtstrand 
wrote:

> Dear group
>
> In a project where performance is not an issue (yet, and possibly never),
> I am thinking about the following cold-standy solution to enable us to
> restart nodes without loosing state:
>
> One node is running with Persistent Actors saving to a database. When that
> node goes down, the other node is started manually, and reading all events
> from the database it gets in the same state.
>
> The problem with this is that we have to do something manually (start the
> new server), and that we are unavailable in the meantime (for instance for
> a GUI).
>
> What is the next step, to have both nodes running at the same time, and
> not appear down to the clients? Is it to have two (or more) nodes running
> in a cluster, with all actors created as singletons?
>
> We use a pattern where events we receive (over SOAP)  are sent to a parent
> actor, which forwards to children based on an ID in the event. If the ID is
> unkown, the parent actor creates a new child.
> The children builds up state based on the events, and publishes other
> events based on this state. As I imagine it, the parent actor would be a
> singleton, creating all the children on the same node... That way, starting
> up the parent actor on an already running Akka instance would be pretty
> fast, and reading from the same database it would get in the same state. 
> ClusterSingletonProxy
> stashes away messages during this process, so we don't loose requests.
>
> The doc, however, warns against the singleton pattern ("Using a singleton
> should not be the first design choice"), and I am wondering what the
> alternative is for my scenario.
>
> Best regards,
>
> Anders Båtstrand
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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 clusterclient Association Error / ClassNotFoundException when serialising response

2014-11-13 Thread Martynas Mickevičius
>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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-stream-experimental 0.10] FlowGraphBuilder.connect

2014-11-13 Thread Martynas Mickevičius
Hi Stu,

it seems that FlowGraphbuilder.connect needs to be refactored to two
parameter lists so Scala is able to infer both type parameters before using
them.

I have experimented with that a bit here
<https://github.com/2m/scala-sandbox/blob/296410007df8eb1bfa78e026a8295ab46401c307/src/test/scala/TypeParameterInference.scala>
which
addresses both of your concerns. Could you register an issue on akka issue
tracker?

On Tue, Nov 11, 2014 at 12:08 AM,  wrote:

> Hi,
>
> I've been experimenting with merging multiple PartialFlowGraphs into a
> single FlowGraph, but have run into some difficulty.
>
> In the short example attached, I attempt to join two compatible graphs,
> where graphA.OUT is an UndefinedSink[Int], and graphB.IN is an
> UndefinedSource[Int].
>
> I thought that an appropriate way to join these two is with a NoOp Flow:
>
> FlowGraphBuilder.connect(sink, Flow.apply, source)
>
> However, it seems as though this is not type-safe. I can insert an
> arbitrary flow, or mix the types of sink and source, and the compiler does
> not complain (although the graph does fail with a ClassCastException at
> runtime).
>
> The compiler does complain if I explicitly state the types when calling
> *connect*.
>
> FlowGraphbuilder.connect(outA, Flow.apply, inB) // compiles, runs
> FlowGraphbuilder.connect[Int, Int](outA, Flow.apply, inB) //compiles, runs
>
> FlowGraphbuilder.connect(outA, Flow.apply[Double].map(x=>x*2), inB) 
> //compiles,
> does not run
> FlowGraphbuilder.connect[Int, Int](outA, Flow.apply[Double].map(x=>x*2),
> inB) //does not compile
>
> In my larger real-world example, I actually changed the type of graphB.IN,
> and it didn't fail until runtime.
>
> I like the idea of being able to compose a larger graph from compatible
> chunks, but I wonder if I have chosen the wrong way to go about it?
>
> Thanks in advance,
>
> Stu
>
>
>
>
>
>
>
>
>
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Anticipating Akka Persistence

2014-11-13 Thread Martynas Mickevičius
Hi Richard,

I think you have already noticed but your second proposal would not block
(stashing is not blocking, but it has same semantics in a sense that no
useful work can be done by an actor that is stashing) while persisting
state to DB.

Akka-persistence handles failure by sending PersistenceFailure message
which if unhandled
<https://github.com/akka/akka/blob/45449d7975792af6118959cb7e8a4c49b930a920/akka-persistence/src/main/scala/akka/persistence/Processor.scala#L322-L327>
would throw an exception and stop the actor (assuming default supervision
strategy).

On Tue, Nov 11, 2014 at 2:46 AM, Richard Rodseth  wrote:

> It must be frustrating for the Akka team to field questions when the
> solutions will be so much more elegant with Akka Persistence and Reactive
> Streams :)
>
> I have an aggregate which needs to respond to events by updating its own
> persistent state (using Slick) and firing a domain event.
>
> I believe that I should only fire the domain event after the state saving
> has succeeded. But this means that I must either
>
> 1) become(saving), tell a DbActor to save (with a replyTo and in the
> message), handle the success or failure response, become(ready) again
> or perhaps
> 2) use a per-request actor to do the saving and publishing of the domain
> event
> or
> 3) ?
>
> Does this seem reasonable? And how does Akka persistence handle the case
> when the event fails to persist?
>
> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Passing large files as akka streams in actor messages?

2014-11-13 Thread Martynas Mickevičius
Where is the stream that you want to handle with akka-stream coming from?

Before materialization you can pass around Sources and Sinks in actor
messages. After materialization you can pass Publishers and Subscribers in
actor messages as well.

On Tue, Nov 11, 2014 at 8:15 PM, Allan Brighton  wrote:

> Hi Martynas,
>
> Thanks for your answer.  What about the case of local actors in the same
> ActorSystem?
> It seems that it would be more flexible to pass a stream of bytes (or
> ByteStrings) than to pass a File object in an actor message.
> I have seen examples of reactive streams used to read/write files, but so
> far only text files (character based).
> How would you pass a binary stream of bytes between local actors?
>
> Thanks,
> Allan
>
>
> On Tuesday, November 11, 2014 2:14:25 PM UTC+1, Martynas Mickevičius wrote:
>>
>> Hi Allan,
>>
>> currently akka-stream can only be materialized to actors on one
>> ActorSystem. Materialization to remote actors or cluster will come
>> eventually, but not soon.
>>
>> However you can still use ActorPublisher and ActorSubscriber with remote
>> actors. Having said that, you need to keep in mind that sending very big
>> messages via remoting may make actor system less responsive, because
>> various system messages would possibly not get through in time.
>>
>> Better approach for sending very large messages over the network would be
>> to write custom message serving and retrieval using akka-io.
>>
>> On Thu, Nov 6, 2014 at 4:25 PM, Allan Brighton  wrote:
>>
>>> Hi,
>>>
>>> An actor needs to receive messages containing the binary contents of
>>> files that can be around 35mb in size.
>>> Rather than sending an actor message containing an Array[Byte] would it
>>> make sense to send a message containing an Akka Stream
>>> (for example, a Source[Byte])? Would this also work with remote actors?
>>>
>>> Would it be better for performance to break the data up into chunks
>>> (using source.grouped(chunkSize)) on the sending side?
>>> (The receiving actor needs to save the file to disk.)
>>>
>>> Thanks,
>>> Allan
>>>
>>>  --
>>> >>>>>>>>>> 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.
>>>
>>
>>
>>
>> --
>> Martynas Mickevičius
>> Typesafe <http://typesafe.com/> – Reactive
>> <http://www.reactivemanifesto.org/> Apps on the JVM
>>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Using the Actor uid

2014-11-13 Thread Martynas Mickevičius
Hi Nils,

actor UID does not change if that actor is restarted by the Supervision
Strategy of its parent.

Maybe in your situation child's parent was restarted because of child's
parent's parent supervision strategy? In that case child UID would have
been changed, because child would not have been restarted but rather
stopped (and started again, if that is in the child's parent preStart or
constructor code).

The above is quite speculative because I am not sure about actor hierarchy
in your program. If that does not make sense please provide more
information about your use case.

On Wed, Nov 12, 2014 at 10:04 AM,  wrote:

> It's not quite clear to me at which point an ActorRef changes it's uid.
> The doc says:
>
> "An actor incarnation is identified by the path and a UID. A restart only
> swaps the Actor instance defined by the Props but the incarnation and hence
> the UID remains the same."
>
> I have a child actor that is restarted by a parent (due to an exception
> and the supervisor strategy), and when it is restarted, the uid also
> changes, which is not how I read the above statement? I was planning to use
> the uid in a Future that is spawned by the actor, to make sure that the
> actor instance is the same when the future completes, as the actor could
> have been restarted while the future is running. Would it be considered to
> be an anti pattern to use and rely on the uid this way, or is it a valid
> approach?
>
> Nils-H
>
>
>  --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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] Confusion about durable mailboxes superseded by akka-persistence?

2014-11-13 Thread Martynas Mickevičius
Hi Karthik,

akka-persistence does not replace but supersede durable mailboxes. That
means if one wants to have an Actor that does not loose messages upon being
killed then sender must use AtLeastOnce delivery trait (or some other means
of durability with akka-persistence or not) to deliver messages to that
Actor.

Let me know if that helped.

On Wed, Nov 12, 2014 at 2:03 PM, Karthik Chandraraj 
wrote:

> Consider there are 100 messages in the mailbox and the actor is processing
> the first.
> If the process is killed, what happens to the 99 messages?
>
> When I was searching about this, I came across durable mailboxes, but the
> doc says 'durable mailboxes superseded by akka-persistence'.
> When I went though akka persistence, it said the actor state can be
> persisted, it doesn't talk about mailboxes? using akka-persistence, actors
> state can be stored, but what about messages that are in the mailbox and
> not received?
>
> can someone please explain?
>
> --
> >>>>>>>>>> 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.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>  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   3   4   >