[akka-user] Slow subscribers never get invoked after sometime

2017-10-29 Thread lahiru
Hi Team,

I recently noticed this behavior in Akka event-bus and there are different 
subscribers listening to events and one subscriber writes to Postgres. This 
subscriber retry if the write fails for 10 times with exponential back-off 
with max wait of 10 seconds.

Recently we had a postgres outage so I see large number of retry attempts 
and lots of slow subscribers but after sometime I see that subscriber 
wasn't invoked at all. But other subscribers for the same event 
(non-postgres) got invoked 
so there is not issue with publishing but something is going on with the 
dispatching messages to subscribers.

I can simulate this by adding a timeout in Postgres Subscriber onMessage 
method and publish bunch of messages to event-bus, all the other 
subscribers get invoke but Postgres subscriber.

Do you know an issue like this or is there a way to avoid this behavior ? 

Regards
Lahiru


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


[akka-user] Mixing shard regions and proxy to shards regions in the same actor system

2017-10-29 Thread Eduardo Fernandes
Hi all. I had this working with java version 2.3.13 and after moving to 
2.5.6 it stop working. Let me explain the topology.

In configuration I have

akka.cluster.sharding {
role = "backend"
}

Ok then. If in a process (frontend) I use startProxy and in other process 
(backend) I use start in ClusterSharding everything looks ok. My problems 
start with I have a more than one ShardRegion in the game:

1) client: starts two proxies for shards (A and B)
2) one server start A and get proxy for B
3) other server starts B and proxy to A

What I'm observing is that the client talks to A via proxy. The actor in 
server receives the request but when tries to send a copy to the other 
server using the corresponding proxy to B it never reaches the other server.

I'm observing this in the log:

[29/10/17 21:18:55:996 CET]  WARN sharding.ShardRegion: Trying to register 
to coordinator at 
[Some(ActorSelection[Anchor(akka://object-server-cluster/), 
Path(/system/sharding/processor-actor-1Coordinator/singleton/coordinator)])], 
but no acknowledgement. Total [475] buffered messages.

My code to create the shard regions:

if (isLocal) {
ClusterSharding.get(clusterSystem).start(shardingName, 
Props.create(ProcessorActor.class, this), settings, new MessageExtractor(),
allocationStrategy, 
PoisonPill.getInstance());
} else {
Optional role = Optional.of(CLUSTER_ROLE_BACKEND);
ClusterSharding.get(clusterSystem).startProxy(shardingName, 
role, new MessageExtractor());
}

and isLocal is true for region A in server 1 and for region B in server 2, 
and false of the other shard region in each server, as you can imagine. 

Maybe this kind of user case is not supported in 2.5.6 anymore? I'm pretty 
sure that is not the case but I can't find the right way to instance the 
shads.

Many thanks in advance for any help on this.

Regards.

/Eduardo

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

2017-10-29 Thread Christopher Hunt
Thanks Patrik. 

I imagine that most savings will come in the area of establishing a connection 
as this is completely bypassed with IPC of course. 

As an aside, perhaps a functional advantage to supporting IPC is security 
though as you can leverage OS permissions. 

Cheers 
C

> On 30 Oct 2017, at 06:38, Patrik Nordwall  wrote:
> 
> Hi Christopher,
> 
> Aeron IPC is currently not supported, but I found it interesting to see if it 
> works so I tried it. Had to change a few small things. Of course I was 
> curious about the performance. No difference for small messages (100 bytes), 
> but for 10kB messages it has higher throughput 1100 MB/s with ipc vs 320 MB/s 
> with upd on my laptop. This is with actor messages (MaxThroughputSpec), not 
> raw Aeron.
> 
> I would have to verify more before promising that we will support it.
> 
> Cheers,
> Patrik
> 
>> On Sat, Oct 28, 2017 at 2:38 AM, Christopher Hunt  wrote:
>> Hi there
>> 
>> I’m thinking of using Akka cluster in a single machine style scenario (low 
>> powered router), so that I can use distributed pub/sub across processes in 
>> particular. I see that Aeron supports IPC as a transport, but Akka’s Artery 
>> doesn’t appear to be able to utilise it - I could be misreading the 
>> reference config though.
>> 
>> Has any consideration been given to supporting the other non-UDP Aeron 
>> transports within Akka Artery?
>> 
>> Cheers
>> C
>> 
>> --
>> >>  Read the docs: http://akka.io/docs/
>> >>  Check the FAQ: 
>> >> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>  Search the archives: 
>> >> https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send 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.
> 
> 
> 
> -- 
> Patrik Nordwall
> Akka Tech Lead
> Lightbend -  Reactive apps on the JVM
> Twitter: @patriknw
> 
> -- 
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ: 
> >> http://doc.akka.io/docs/akka/current/additional/faq.html
> >> Search the archives: https://groups.google.com/group/akka-user
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Akka User List" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/akka-user/XimVIC_KvMA/unsubscribe.
> To unsubscribe from this group and all its topics, send 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] Artery and IPC

2017-10-29 Thread Patrik Nordwall
Hi Christopher,

Aeron IPC is currently not supported, but I found it interesting to see if
it works so I tried it. Had to change a few small things. Of course I was
curious about the performance. No difference for small messages (100
bytes), but for 10kB messages it has higher throughput 1100 MB/s with ipc
vs 320 MB/s with upd on my laptop. This is with actor messages
(MaxThroughputSpec), not raw Aeron.

I would have to verify more before promising that we will support it.

Cheers,
Patrik

On Sat, Oct 28, 2017 at 2:38 AM, Christopher Hunt  wrote:

> Hi there
>
> I’m thinking of using Akka cluster in a single machine style scenario (low
> powered router), so that I can use distributed pub/sub across processes in
> particular. I see that Aeron supports IPC as a transport, but Akka’s Artery
> doesn’t appear to be able to utilise it - I could be misreading the
> reference config though.
>
> Has any consideration been given to supporting the other non-UDP Aeron
> transports within Akka Artery?
>
> Cheers
> C
>
> --
> >>  Read the docs: http://akka.io/docs/
> >>  Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>  Search the archives: https://groups.google.com/
> group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send 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.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend  -  Reactive apps on the JVM
Twitter: @patriknw

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


Re: [akka-user] Akka FSM, Persistence and multiple instances

2017-10-29 Thread Justin du coeur
I think you're misunderstanding how this all works.  The state lives *in*
the Actor, and is only available while the Actor is live; shutting the
Actors down and starting them so quickly is enormously inefficient.  The
database is just a backing store, recording the history of the Actor.

Normally, you would build something like this with Cluster Sharding
managing the Actors; the Actors live until they time out due to inactivity,
and when they are needed again they revive themselves from Persistence...

On Sat, Oct 28, 2017 at 11:43 AM, wapgui  wrote:

> It's the state for a shopping application bound to Kafka with values
> coming from a SAP system. So there could be some 100 Request per Minute
> asking to switch the state. In what time period does an FSM actor saves it
> state or makes an lookup on the persist store. Maybe it's not necessary the
> close the actor on the instances, because the state is up to date.
>
> Am Samstag, 28. Oktober 2017 15:25:27 UTC+2 schrieb Konrad Malawski:
>>
>> But if you can have concurrent writes, because requests to multiple nodes
>> and timing etc, you do run st the risk. Also, stopping actors a meter every
>> write is very weird and not what akka persistence was really designed for.
>> It’s not a key value store, it’s event sourcing for medium-long loved
>> entities.
>>
>> --
>> Konrad Malawski
>>
>> On October 28, 2017 at 17:44:08, wapgui (torsten...@wapgui.com) wrote:
>>
>>> I'm closing the actors after each request and recreate with the same
>>> uuid.
>>>
>>> Am Samstag, 28. Oktober 2017 10:41:28 UTC+2 schrieb Konrad Malawski:

 Are you creating many persistent actors with the same persistence I’d?
 That of course breaks things. Please read the persistence docs and use akka
 cluster with cluster sharding instead to handle the cluster creating the
 actors. This not only is easier but also is safe - the uniqueness will be
 guaranteed by sharding then.

 --
 Konrad Malawski

 On October 28, 2017 at 17:34:12, wapgui (torsten...@wapgui.com) wrote:

> Hi,
>
> I've built a FSM using Akka FSM and Persistence to a Percona cluster
> in near cloud.
> Running this environment in a single instance causes no problems at
> all. If I dockerize this single instance and running it at 2 instances
> causes sometimes problems with the state.
> E.g. making the first request with New creates the state object on an
> instance. From the second instance the next request calls to switch to the
> next state, but the FSM answers there is no object and a switch is not
> possible. The second request was 14s after the first one.
> My service creates an actor each time a request comes in with the
> reference to the uuid of the process. After handling the request, the 
> actor
> will be closed, until the next request comes in. Is this really necessary?
> I made this because of the multiple instances to be sure the state of the
> actor is the same on all instances. Maybe I've there a missunderstanding
> and I can leave the FSM actors on system, generating clones on other
> instances and the persistence handles the data exchange on all these
> instances.
>
> Could somebody explain me what is the right decision?
>
> Best regards
> Torsten
>
> --
> >> 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 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/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 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