Re: [akka-user] [akka-persistence] Hihgest sequence number and deleteMessages in third-party journal.

2015-10-12 Thread Evgeny Shepelyuk
Thank you for the answer.
Will it be possible to contribute to TCK if I be able to write proper test 
cases ?

понеділок, 12 жовтня 2015 р. 15:47:37 UTC+3 користувач Patrik Nordwall 
написав:
>
> It should keep track of the highest used sequence number, also after 
> delete of all events. That is not documented yet. We intend to do so and 
> also enforce it with the TCK. https://github.com/akka/akka/issues/18559
>
> /Patrik
>
> On Sat, Oct 10, 2015 at 11:43 AM, Evgeny Shepelyuk <eshep...@gmail.com 
> > wrote:
>
>> Hello,
>>
>> Is it true that third-party journal implementation should keep the 
>> highest sequence number for persistenceId even if deleteMessages caused 
>> complete journal cleanup ?
>> This is how LevelDB implementation is working, but I can't 
>> find explicit statement mentioning this in AKKA docs.
>>
>> --
>> 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+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
>
>

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


[akka-user] [akka-persistence] Design question, account with transactions

2016-08-16 Thread Evgeny Shepelyuk
I am trying to design a system where an AKKA actor represents smth similar 
to simple banking account or counter
Each account has a list of transactions that are events generated by 
incoming commands change its state (basically add/remove funds).
One of my requirement is that system should track if incoming transaction 
was already processed by certain account.

It that case account actor 
1. should not change state again
2. should warn some external system about duplicated transaction.

We expect fairly large number of transactions per account. e.g 1 per 
day.

My first intention was to use akka-persistence to implement event sourcing 
pattern

On incoming command 
 - check if command was already processed, (by querying journal or checking 
in memory list)
 - if command was not processed - creating transaction and store it to 
account journal
 - additional put transaction into in-memory list
 - if command with such ID was already processed, then do not generate new 
transaction, and notify someone

But after reading about journals and possible backends (kafka or cassandra, 
since we need it distributed) I consider that maybe akka-persistence is not 
applicable at all for my goals.
One of assumption is to use event-sourcing only for balance update and 
create snapshots from time to time and use direct DB access outside 
akka-persistence to check for duplicated transactions.

What do you 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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Akka FSM, persistence and timeouts

2016-09-26 Thread Evgeny Shepelyuk
Hello

We're trying to implement something similar (i.e. when Actor recovered, we 
want side-effects to not happen again).
During recovery, events are not applied immediately to internal state, but 
we're waiting until recovery is completed and then decide what to do next, 
based on latest replied event.

In fact, it's identical to cleaning journal upto latest event after each 
successful event storage.


понеділок, 26 вересня 2016 р. 17:55:27 UTC+3 користувач Eugene Dzhurinsky 
написав:
>
> Tal, thanks for the response!
>
> As far as I know, when an actor is recovered through Akka Persistence - 
> the whole set of events is being re-send to the actor, so it can recover 
> the state. In my case, some states will have side-effects, like "send an 
> e-mail" or "update the database". Obviously I don't want those events to be 
> "replayed" by the new actor, I just need to
> - set the state data as it was seen when actor was "terminated"
> - set the timeouts (calculate the current time and recent state change 
> time to set the appropriate timeout)
> - set the state to start from.
>
> So I need not only record the state data and the current state, but also 
> the time when that state was changed.
>
> Do I need to write some custom persistence model for that or I still can 
> re-use Akka Persistence with some settings regarding the message replay 
> policy?
>
> As for the number of threads my concern is: I have 1 of actors, and 
> all of them have certain timeouts. Once they recover the state after the 
> actor system restart - there might be some bottleneck in processing of the 
> new incoming messages from the external system (e.g to start a new actor 
> that serves another workflow and init it's states) and process the timeout 
> events.
>
> 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.


[akka-user] Re: [akka-persistence] Design question, account with transactions

2016-08-17 Thread Evgeny Shepelyuk
Hi, thanks for info.

May you share some info about your system:
- how many actors do you have per JVM
- how many transactions are kept in memory per actor 
- what backend do you use for journal 

середа, 17 серпня 2016 р. 09:38:12 UTC+3 користувач Tal Pressman написав:
>
> Hi,
>
> We have something similar to the in one of our systems, and the way we did 
> it is to include the list of processed transactions (IDs) as part of the 
> actor state. In places where it isn't feasible to keep all transactions in 
> memory, you can use a bloom filter (if you don't require 100% accuracy), or 
> you will have to use some "external" method to keep track of the duplicates 
> (DB, some service to check for duplicates, etc.)
>
> HTH,
> Tal
>
>
> On Tuesday, August 16, 2016 at 4:06:06 PM UTC+3, Evgeny Shepelyuk wrote:
>>
>> I am trying to design a system where an AKKA actor represents smth 
>> similar to simple banking account or counter
>> Each account has a list of transactions that are events generated by 
>> incoming commands change its state (basically add/remove funds).
>> One of my requirement is that system should track if incoming transaction 
>> was already processed by certain account.
>>
>> It that case account actor 
>> 1. should not change state again
>> 2. should warn some external system about duplicated transaction.
>>
>> We expect fairly large number of transactions per account. e.g 1 per 
>> day.
>>
>> My first intention was to use akka-persistence to implement event 
>> sourcing pattern
>>
>> On incoming command 
>>  - check if command was already processed, (by querying journal or 
>> checking in memory list)
>>  - if command was not processed - creating transaction and store it to 
>> account journal
>>  - additional put transaction into in-memory list
>>  - if command with such ID was already processed, then do not generate 
>> new transaction, and notify someone
>>
>> But after reading about journals and possible backends (kafka or 
>> cassandra, since we need it distributed) I consider that maybe 
>> akka-persistence is not applicable at all for my goals.
>> One of assumption is to use event-sourcing only for balance update and 
>> create snapshots from time to time and use direct DB access outside 
>> akka-persistence to check for duplicated transactions.
>>
>> What do you 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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: [akka-persistence] Design question, account with transactions

2016-08-17 Thread Evgeny Shepelyuk

Thank you !

середа, 17 серпня 2016 р. 11:10:13 UTC+3 користувач Tal Pressman написав:
>
> Hi,
>
> Our system isn't in production yet, but the current design is:
>
>- The entire system will run on an Akka cluster (with sharding).
>- "Old" entities are passivated after a certain inactivity period. At 
>any given point we expect to have several million live entities.
>- The expected number of commands("transactions") per entity is small 
>- 90% will have just a handful of commands, but some can have hundreds.
>- Backend is Cassandra.
>
> Tal
>
>
> On Wednesday, August 17, 2016 at 9:55:30 AM UTC+3, Evgeny Shepelyuk wrote:
>>
>> Hi, thanks for info.
>>
>> May you share some info about your system:
>> - how many actors do you have per JVM
>> - how many transactions are kept in memory per actor 
>> - what backend do you use for journal 
>>
>> середа, 17 серпня 2016 р. 09:38:12 UTC+3 користувач Tal Pressman написав:
>>>
>>> Hi,
>>>
>>> We have something similar to the in one of our systems, and the way we 
>>> did it is to include the list of processed transactions (IDs) as part of 
>>> the actor state. In places where it isn't feasible to keep all transactions 
>>> in memory, you can use a bloom filter (if you don't require 100% accuracy), 
>>> or you will have to use some "external" method to keep track of the 
>>> duplicates (DB, some service to check for duplicates, etc.)
>>>
>>> HTH,
>>> Tal
>>>
>>>
>>> On Tuesday, August 16, 2016 at 4:06:06 PM UTC+3, Evgeny Shepelyuk wrote:
>>>>
>>>> I am trying to design a system where an AKKA actor represents smth 
>>>> similar to simple banking account or counter
>>>> Each account has a list of transactions that are events generated by 
>>>> incoming commands change its state (basically add/remove funds).
>>>> One of my requirement is that system should track if incoming 
>>>> transaction was already processed by certain account.
>>>>
>>>> It that case account actor 
>>>> 1. should not change state again
>>>> 2. should warn some external system about duplicated transaction.
>>>>
>>>> We expect fairly large number of transactions per account. e.g 1 
>>>> per day.
>>>>
>>>> My first intention was to use akka-persistence to implement event 
>>>> sourcing pattern
>>>>
>>>> On incoming command 
>>>>  - check if command was already processed, (by querying journal or 
>>>> checking in memory list)
>>>>  - if command was not processed - creating transaction and store it to 
>>>> account journal
>>>>  - additional put transaction into in-memory list
>>>>  - if command with such ID was already processed, then do not generate 
>>>> new transaction, and notify someone
>>>>
>>>> But after reading about journals and possible backends (kafka or 
>>>> cassandra, since we need it distributed) I consider that maybe 
>>>> akka-persistence is not applicable at all for my goals.
>>>> One of assumption is to use event-sourcing only for balance update and 
>>>> create snapshots from time to time and use direct DB access outside 
>>>> akka-persistence to check for duplicated transactions.
>>>>
>>>> What do you 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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Simple beginner questions: Accessing values in flows

2016-10-18 Thread Evgeny Shepelyuk
Hi, could you please spare final code ?

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


[akka-user] Re: [DesignProposal] AKKA cluster in Docker Swarm Environment

2016-12-29 Thread Evgeny Shepelyuk
Hello

Thanks for detailed explanation. I assume we will proceed to distributed 
lock as you've suggested.

One last question, do you think Zookeeper can play this role well ? Or we 
should consider only Consul / Etcd ?
We're using Kafka internally, so we already having Zookeeper in place. 

середа, 28 грудня 2016 р. 15:06:08 UTC+2 користувач Rafał Krzewski написав:
>
> W dniu środa, 28 grudnia 2016 13:30:23 UTC+1 użytkownik Evgeny Shepelyuk 
> napisał:
>>
>> Hello,
>>
>> In Docker Swarm when service is created, it's assigned to Virtual IP. 
>> I.e. when I create several instances of *wallet-seed *they will get an 
>> single IP (10.0.0.2, for example), while each of container will have own IP 
>> (10.0.0.5, 10.0.0.6, 10.0.0.7 and so on)
>> When *wallet-seed* address is resolved within Swarm cluster - it will 
>> initially resolves to service VIP (10.0.0.2) and then to the IP of 
>> particular container in round robin fashion.
>>
>> So if I put *wallet-seed * as a seed node address in my *wallet *service 
>> config, then 1st instance could resolve it to 10.0.0.5, second instance can 
>> resolve to 10.0.0.6 etc.
>>
>> As far as I understand this will lead to cluster partitioning, right ?
>>
>
> No, I meant something else. First of all, Akka cluster is implemented on 
> top of Akka remoting. And for Akka remoting to work, each node needs to 
> know it's self address, which is the IP the other nodes will use to connect 
> to it. The node address becomes the part of remote ActorRefs. Any incoming 
> message that contains different address than the node's self address is 
> dropped. This is a good thing, because you could have actors with the same 
> local paths on different node clusters and the results of delivering 
> message to a wrong instance could potentially be disastrous. Because of 
> this, even if you create *wallet-seed* service with virtual IP 10.0.0.2 
> you cannot use this IP as the address of the seed, because the containers 
> backing the service will expect to receive messages addressed to 10.0.0.5, 
> 10.0.0.6 and so on and will discard messages addressed to 10.0.0.2.
> You could use docker-swarm service in a different way: to advertise the 
> proper IP address of the cluster seed, but you cannot use Akka remoting 
> protocol for that, for reason given above. Suppose you implement it the 
> following way: define a HTTP endpoint, say at port 5000 that will respond 
> to GET /seeds with a text/plain message containing IP address of cluster 
> seed. Each node upon startup will do the following:
> - attempt a GET wallet-seed:5000/seed 
> - if it succeeds, join the cluster at received IP
> - if it fails, this node is the first one and it should:
>   - bootstrap the cluster by joining itself
>   - publish a HTTP service at port 5000 advertising it's own address
> The definition of wallet-seed service should include a health check 
> condition so that only containers publishing the HTTP at port 5000 would be 
> act as it's backend
> That would work, but has a glaring problem: there is a race condition 
> between the seed nodes. More than one container can "elect itself" as the 
> seed. Then the other nodes would access different seeds through 
> *wallet-seed* in round-robin fashion and join their respective clusters.
> Using a consistent store like consul or etcd provides a solution to the 
> race condition but also solves a second problem: it can be used to 
> advertise seed address without crafting a custom service.
>
> Cheers,
> Rafał
>

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


[akka-user] Re: [DesignProposal] AKKA cluster in Docker Swarm Environment

2016-12-30 Thread Evgeny Shepelyuk
Hello
Successfully implemented cluster joining using ConstructR, thanks !

четвер, 29 грудня 2016 р. 15:21:47 UTC+2 користувач Rafał Krzewski написав:
>
> Hi, 
> You are welcome! 
> You can use https://github.com/hseeberger/constructr together with 
> https://github.com/typesafehub/constructr-zookeeper to initialize Akka 
> cluster using Zookeeper. 
>
> Cheers, 
> Rafał

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


[akka-user] Re: [DesignProposal] AKKA cluster in Docker Swarm Environment

2016-12-30 Thread Evgeny Shepelyuk
Hello

I am playing with ConstructR / Zookeeper now and one thing I can figure out 
is - how should I manage joining to cluster ?

As far as I understand I have to leave this section empty in 
application.conf

akka {
  cluster {
seed-nodes = []
  }
}

>From what I can see in Coordination implementations code - there's no code 
responsible for joining the cluster.

Should I manually interact with my Zookeeper / Etcd service, then retrieve 
seed node and join there ?


четвер, 29 грудня 2016 р. 15:21:47 UTC+2 користувач Rafał Krzewski написав:
>
> Hi, 
> You are welcome! 
> You can use https://github.com/hseeberger/constructr together with 
> https://github.com/typesafehub/constructr-zookeeper to initialize Akka 
> cluster using Zookeeper. 
>
> Cheers, 
> Rafał

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


[akka-user] Re: [DesignProposal] AKKA cluster in Docker Swarm Environment

2016-12-28 Thread Evgeny Shepelyuk
Hello

Do you mean that in AKKA cluster there's only one seed node ? 
I thought AKKA cluster may have several seed node, so new instances can 
connect to any of them.
AKKA documentations show example with multiple seed nodes.

середа, 28 грудня 2016 р. 12:48:33 UTC+2 користувач Rafał Krzewski написав:
>
> Evgeny,
> The role of etcd / consul / zookeeper in the booting up an Akka cluster is 
> to provide a distributed lock rather than service discovery. When you boot 
> up a number of uniform nodes they need to decide among themselves which one 
> will act as a seed of Akka cluster. The other nodes then join the seed. An 
> external service that provides consistency guarantees prevents the cluster 
> from brain-splitting at the very outset. I'm not familiar with docker-swarm 
> feature set, but unless it provides a strongly consistent KV store or other 
> means of distributed coordination, this is not going to fly.
>
> Cheers,
> Rafał
>
>

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


[akka-user] Re: [DesignProposal] AKKA cluster in Docker Swarm Environment

2016-12-28 Thread Evgeny Shepelyuk
Hello,

In Docker Swarm when service is created, it's assigned to Virtual IP. I.e. 
when I create several instances of *wallet-seed *they will get an single IP 
(10.0.0.2, for example), while each of container will have own IP 
(10.0.0.5, 10.0.0.6, 10.0.0.7 and so on)
When *wallet-seed* address is resolved within Swarm cluster - it will 
initially resolves to service VIP (10.0.0.2) and then to the IP of 
particular container in round robin fashion.

So if I put *wallet-seed * as a seed node address in my *wallet *service 
config, then 1st instance could resolve it to 10.0.0.5, second instance can 
resolve to 10.0.0.6 etc.

As far as I understand this will lead to cluster partitioning, right ?

середа, 28 грудня 2016 р. 13:06:22 UTC+2 користувач Rafał Krzewski написав:
>
> If you can set the IPs of your seed node(s) upfront and put them into 
> configuration of every node all is fine and well. Unfortunately this is not 
> what happens in a dynamic environment, hence the need to elect the seed 
> node before Akka cluster boots up.
>
> Cheers,
> Rafał
>
> W dniu środa, 28 grudnia 2016 11:56:56 UTC+1 użytkownik Evgeny Shepelyuk 
> napisał:
>>
>> Hello
>>
>> Do you mean that in AKKA cluster there's only one seed node ? 
>> I thought AKKA cluster may have several seed node, so new instances can 
>> connect to any of them.
>> AKKA documentations show example with multiple seed nodes.
>>
>> середа, 28 грудня 2016 р. 12:48:33 UTC+2 користувач Rafał Krzewski 
>> написав:
>>>
>>> Evgeny,
>>> The role of etcd / consul / zookeeper in the booting up an Akka cluster 
>>> is to provide a distributed lock rather than service discovery. When you 
>>> boot up a number of uniform nodes they need to decide among themselves 
>>> which one will act as a seed of Akka cluster. The other nodes then join the 
>>> seed. An external service that provides consistency guarantees prevents the 
>>> cluster from brain-splitting at the very outset. I'm not familiar with 
>>> docker-swarm feature set, but unless it provides a strongly consistent KV 
>>> store or other means of distributed coordination, this is not going to fly.
>>>
>>> Cheers,
>>> Rafał
>>>
>>>

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

2016-12-28 Thread Evgeny Shepelyuk
Hello

Preface

Couple day ago I've asked a question here about possible design for setting 
AKKA cluster in Docker swarm environment.
The main open questions for us is how to discover seed nodes when new 
container is starting or service is scaled, because Docker assign random 
internal IPs for each container.
As far as I've seen from the reply and after skimming over similar Google 
results - current approach is to use some service registry like Consul / 
Etcd / Zookeeper and take seed nodes IP from there.

Since Docker Swarm provides own means for service discovery, we'd like to 
design approach that will not involve 3rd party service discovery like 
Consul.

After some thinking about it I'd like to share our vision and get some 
feedback on it.

A Docker Swarm background first. 

Cluster consists of *manager *and *workers *nodes, where managers maintain 
consistent internal state using raft implementation of the entire swarm and 
all the services running on it.
And workers are used for running container and workers nodes discover each 
other using gossip.

There also two types of *service*

   - *replicated *services - the swarm manager distributes a specific 
   number of replica tasks among the nodes based upon the scale you set in the 
   desired state.
   - *global *services -  the swarm runs one task for the service on every 
   available node in the cluster.

Docker Swarm uses service discovery / load balancing based on symbolic 
service name.

Design

   1. Let's assume we have a stateful AKKA service named *wallet* that is 
   going to be sharded, so we'd like to leverage AKKA cluster functionality.
   2. The service is run inside Docker container in Docker Swarm, AKKA 
   service is a Docker Swarm service, i.e can be scaled over multiple nodes, 
   service can be discovered within cluster by its name *wallet.*
   3. To make seed nodes discovery possible we propose to introduce new 
   dummy service *wallet-seed *and make this service *global*, i.e. docker 
   swarm will run instance of this service on each node.
   4. Additionally we can restrict deployment of wallet-seed only to 
   manager nodes.
   5. Doing as explained above allows us to ensure that *wallet-seed* is 
   strongly available and run on each of manager of Docker Swarm cluster.
   6. So when starting up, *wallet *service will use symbolic name 
   *wallet-seed* as a seed node address to join to.
   7. *wallet *may be launched on any Swarm node, either worker or manager.
   8. Due to Docker Swarm internal load balancing, *wallet-seed* will be 
   resolved to one of the available container instances.
   

Please keep in mind that this is a only initial proposal and the main goal 
is just to implement smth without using consul / etcd.
We will be appreciated for any feedback.

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


[akka-user] Re: Usage of Akka cluster in Docker Swarm cluster

2016-12-27 Thread Evgeny Shepelyuk

Hello,

Since Docker Swarm takes the burden of maintaining dedicated service 
discovery registry off our shoulders, 
we're interested in a some sort of solution for AKKA cluster that let us 
avoid adopting yet another software component consul / etcd).
At least we'd like smth to compare with consul/etc based solution.

понеділок, 26 грудня 2016 р. 16:01:37 UTC+2 користувач Rafał Krzewski 
написав:
>
> W dniu poniedziałek, 26 grudnia 2016 14:00:41 UTC+1 użytkownik Evgeny 
> Shepelyuk napisał:
>>
>> 1. Possible network overhead because swarm nodes and akka nodes are auto 
>> discovering each other using gossip.
>>
>
> I wouldn't worry about it too much, because it only happens when the 
> cluster is starting up. or is being scaled up/down. 
>  
>
>> 2. How to find seed nodes for AKKA cluster nodes, i.e. is it possible to 
>> not use third party services like consul for this and rely completely on 
>> Docker Swarm ?
>>
>
> I would recommend running a consistent KV store like Consul or etcd and 
> then using https://github.com/hseeberger/constructr 
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fhseeberger%2Fconstructr=D=1=AFQjCNGIh5wW1ale69oOat-SL97Zedt91A>
>  
> on top of that to manage Akka cluster seed nodes. This makes it easy to 
> migrate your application to Kubernetes or Mesos if you ever need to.
>  
>
>> 3. Is there any advice on cluster topology, i.e. is it better to join all 
>> nodes into single cluster, or create a cluster per service and use cluster 
>> client to access it ?
>>
>
> This depends on your actual use case. First and foremost you shouldn't run 
> Akka cluster at all unless you need one or more features it enables like 
> sharding, distributed data, singletons and so on. Many clustered 
> applications can be built as ensembles of standalone Akka nodes 
> communicating through HTTP endpoints. The latter approach fits very well 
> into Docker Swarm / Kubernetes services model. Or you might want to use 
> Akka cluster for one layer of your application and a "swarm" of independent 
> nodes communicating through HTTP or a message queue for another. It all 
> depends on what you want to build. 
>  
> cheers,
> Rafał
>

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

2016-12-26 Thread Evgeny Shepelyuk
Hello

Is there any information or real-life experience of using AKKA clustered 
services in Docker Swarm cluster ?
We're developing our AKKA based services and they are intended to be run in 
separate docker containers.
I.e. one service instance = 1 docker container.

The disturbing points are following

1. Possible network overhead because swarm nodes and akka nodes are auto 
discovering each other using gossip.
2. How to find seed nodes for AKKA cluster nodes, i.e. is it possible to 
not use third party services like consul for this and rely completely on 
Docker Swarm ?
3. Is there any advice on cluster topology, i.e. is it better to join all 
nodes into single cluster, or create a cluster per service and use cluster 
client to access it ?

We'd be very appreciated for any sort of information about the topic.

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


[akka-user] Re: [DesignProposal] AKKA cluster in Docker Swarm Environment

2017-03-05 Thread Evgeny Shepelyuk
Hello

Well, we stuck to using ConstructR + Zookeeper :)

неділя, 5 березня 2017 р. 11:53:32 UTC+2 користувач Ashley Aitken написав:
>
>
> Hi Evgeny,
>
> Could you briefly describe what you did (or is it exactly as described in 
> links)?  I am interested in doing this too and like you would (have) 
> like(d) to not use another service and zookeeper etc.
>
> I may have been thinking along the same lines as you as well, i.e. having 
> the seed nodes as static instances on the manager nodes, and then scaling 
> further on the worker nodes.
>
> Thanks,
> Ashley.
>
> On Friday, 30 December 2016 17:13:10 UTC+8, Evgeny Shepelyuk wrote:
>>
>> Hello
>> Successfully implemented cluster joining using ConstructR, thanks !
>>
>> четвер, 29 грудня 2016 р. 15:21:47 UTC+2 користувач Rafał Krzewski 
>> написав:
>>>
>>> Hi, 
>>> You are welcome! 
>>> You can use https://github.com/hseeberger/constructr together with 
>>> https://github.com/typesafehub/constructr-zookeeper to initialize Akka 
>>> cluster using Zookeeper. 
>>>
>>> Cheers, 
>>> Rafał
>>
>>

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


Re: [akka-user] Re: [DesignProposal] AKKA cluster in Docker Swarm Environment

2017-03-06 Thread Evgeny Shepelyuk
Hello,

1. Yes we're still using Docker Swarm
2. In fact we've postponed AKKA cluster implementation and now we run just 
a single instance of service, but our plans is 

- introduce ZooKeeper instance (ZooKeeper cluster)
- since ConstructR is a library not a service, it's embedded in the 
application itself
- so, as soon as we will start having multiple instances - AKKA cluster 
should work


неділя, 5 березня 2017 р. 18:27:03 UTC+2 користувач Ashley Aitken написав:
>
>
> So you run ConstructR and Zookeeper on all nodes, just manager nodes?
>
> You are still using Docker Swarm?
>
> On 5 Mar 2017, at 6:03 PM, Evgeny Shepelyuk <eshep...@gmail.com 
> > wrote:
>
> Hello
>
> Well, we stuck to using ConstructR + Zookeeper :)
>
> неділя, 5 березня 2017 р. 11:53:32 UTC+2 користувач Ashley Aitken написав:
>>
>>
>> Hi Evgeny,
>>
>> Could you briefly describe what you did (or is it exactly as described in 
>> links)?  I am interested in doing this too and like you would (have) 
>> like(d) to not use another service and zookeeper etc.
>>
>> I may have been thinking along the same lines as you as well, i.e. having 
>> the seed nodes as static instances on the manager nodes, and then scaling 
>> further on the worker nodes.
>>
>> Thanks,
>> Ashley.
>>
>> On Friday, 30 December 2016 17:13:10 UTC+8, Evgeny Shepelyuk wrote:
>>>
>>> Hello
>>> Successfully implemented cluster joining using ConstructR, thanks !
>>>
>>> четвер, 29 грудня 2016 р. 15:21:47 UTC+2 користувач Rafał Krzewski 
>>> написав:
>>>>
>>>> Hi, 
>>>> You are welcome! 
>>>> You can use https://github.com/hseeberger/constructr together with 
>>>> https://github.com/typesafehub/constructr-zookeeper to initialize Akka 
>>>> cluster using Zookeeper. 
>>>>
>>>> Cheers, 
>>>> Rafał
>>>
>>>
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: 
> http://doc.akka.io/docs/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/6lPAmCWjII4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> akka-user+...@googlegroups.com .
> To post to this group, send email to akka...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

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


[akka-user] [DesignProposal] AKKA cluster in Docker Swarm Environment

2017-03-07 Thread Evgeny Shepelyuk
Another example but for Kubernetes. Without using ConstructR.
https://medium.com/google-cloud/clustering-akka-in-kubernetes-with-statefulset-and-deployment-459c0e05f2ea#.vmm894fk1

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


[akka-user] Error in Docker container: Default journal plugin is not configured

2017-08-02 Thread Evgeny Shepelyuk
May I assume that you should use `application.conf` in your code, not 
`reference.conf` as you've mentioned in the post.

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


[akka-user] Re: Error in Docker container: Default journal plugin is not configured

2017-08-02 Thread Evgeny Shepelyuk
Wtf is this XMl snippet ?

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


Re: [akka-user] Re: Error in Docker container: Default journal plugin is not configured

2017-08-02 Thread Evgeny Shepelyuk
Ohh, maven. Unfortunately have no expirience how it works with akka and why
`.conf` transformation needed.

2 серп. 2017 23:52 "Jan-Terje Sørensen" <jtbsoren...@gmail.com> пише:

> That is the pom.xml file for transforming the config file.
>
> onsdag 2. august 2017 22.50.51 UTC+2 skrev Evgeny Shepelyuk følgende:
>>
>> Wtf is this XMl snippet ?
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/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/LzXwJv-nfcc/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.


[akka-user] Re: [akka-cluster] ClusterClient and ConstructR

2017-05-09 Thread Evgeny Shepelyuk
Thanks Rafał

Already figured it out :)

понеділок, 8 травня 2017 р. 17:58:51 UTC+3 користувач Rafał Krzewski 
написав:
>
> Hi Evgeny,
>
> In such situation I'd 
> use de.heikoseeberger.constructr.coordination.Coordination (it's subclass 
> specific for the data store you are using) on the nodes outside the cluster 
> that need to look up contact points.
> You can call Coordination.getNodes() and if None comes back, wait some 
> time and retry.
>
> Cheers,
> Rafał
>
>
> W dniu czwartek, 4 maja 2017 14:28:53 UTC+2 użytkownik Evgeny Shepelyuk 
> napisał:
>>
>> Hi All
>>
>> Is there any example of using ConstructR with ClusterClient.
>>
>> I am having AKKA cluster bootstrapped with ConstructR and Zookeeper, 
>> i.e. I have no predefined seed nodes to create ClusterClient.
>>
>> So, I should connect too Zookeeper and retrieve seed nodes set by 
>> ConstructR.
>>
>> What is the proper way of doing this except using low level Zookeeper API
>>
>> P.S. This is not Zookeeper specific question, it's the same for  ETCD / 
>> Consul.
>>
>

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


[akka-user] [akka-cluster] ShardRegion in proxy mode vs. access ShardRegion via ClusterClient

2017-05-09 Thread Evgeny Shepelyuk
Hello

We're implementing  microservice system consisting of several services 
representing completely different domains.
Let's consider that we have following 

   - wallet service representing customer balance, supporting deposit, 
   withdraw and get balance commands
   - wallet client service that interacts with a wallet

Because of Docker based infrastructure we have to use ConstructR for Akka 
Cluster,so setup is not quite trivial.
Our intentions were

   - join wallet service instance into akka cluster
   - do not join wallet client service into cluster
   - expose each ShardRegion via ClusterClientReceptionist
   - from wallet client service access wallets in shards via ClusterClient
   
But after digging into akka docs, I've found a possibility to use 
ShardRegion in proxy only mode, so another architecture idea appeared


   - join wallet and wallet client into the same Akka Cluster
   - on wallet service nodes start ShardRegion in normal mode
   - on wallet client nodes start ShardRegion in proxy only mode
   - access wallets from wallet client using local ShardRegion

Dear community, could you provide pros / cons of both solutions ?
What is more AKKA way of achieving the goal.

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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] [akka-cluster] Sharding, extractShardId and cluster resizing

2017-05-16 Thread Evgeny Shepelyuk
Wow, so comprehensive.
Thank you very much.

вівторок, 16 травня 2017 р. 18:46:10 UTC+3 користувач Justin du coeur 
написав:
>
> On Tue, May 16, 2017 at 11:38 AM, Evgeny Shepelyuk <eshep...@gmail.com 
> > wrote:
>
>> My current worrying question is about how to properly build extractShardId 
>> function.
>> According to the docs this function must depend on the number of nodes.
>>
>
> While this is true, you shouldn't over-interpret it.  The function isn't 
> based on the exact number of nodes at a given moment, it's based on the 
> number of nodes you *expect* is the *likely* maximum size of the cluster.  
> As you say, you don't want the entity-to-shard mapping to change in 
> mid-stream (which would lead to chaos), so the number needs to be pretty 
> static.
>
> So in practice, you take the expected size of the cluster, multiply that 
> by around 10, and use that for the number of shards.  Exactly where those 
> shards *live* will rearrange more or less automatically as the cluster 
> resizes and things rebalance.
>
> (All of the above is AFAIK; so far, my cluster size is small and 
> constant.  Members of the Akka Team should correct me if I am incorrect.)
>

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


[akka-user] Re: Common practice for akka cluster logging

2017-05-19 Thread Evgeny Shepelyuk
Hello,

We're using ELK for our Docker based services and currently it's quite 
useful for collecting and  analyzing logs.
There's another option https://www.graylog.org - it works very similar to 
how ELK does, but as for me - easier to setup.

Also, you can try some of hosted solutions, 

- https://sentry.io/welcome/
- logz.io


середа, 17 травня 2017 р. 10:28:44 UTC+3 користувач Dai Yinhua написав:
>
> Hi team,
>
> I am using akka cluster sharding for an analytics application in 
> production. And we are using kubernetes to run all akka jvms in container.
> The thing I feel awkward is that how to collect all logs from all 
> containers.
>
> I know a popular solution for distributed application log is ELK, but it 
> probably will consume much resource.
> I am not sure if there are any other recommend solution for akka log, I 
> don't see any hint from akka document.
>

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


[akka-user] [akka-cluster] Sharding, extractShardId and cluster resizing

2017-05-16 Thread Evgeny Shepelyuk
Hello 

I'm implementing sharding solution on top of AKKA cluster running in Docker 
Swarm.
The requirement we'd like to achieve is to be able to scale our sharded 
services.
It's easily achieved with docker swarm, so we can have as many instances of 
services as we want.
Thanks to ConstructR project - we're able to maintain and rebuild AKKA 
cluster as well.

My current worrying question is about how to properly build extractShardId 
function.
According to the docs this function must depend on the number of nodes.

1. So should I build this function as a listener of cluster event and keep 
number of active nodes inside the function ?
2. What about existing entities, i.e when some entities exist in a shard 
and then number of shard regions increases, then extractShardId must take 
care of old entities and still route to old shard ?

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


[akka-user] [akka-cluster] ClusterClient and ConstructR

2017-05-04 Thread Evgeny Shepelyuk
Hi All

Is there any example of using ConstructR with ClusterClient.

I am having AKKA cluster bootstrapped with ConstructR and Zookeeper, i.e. I 
have no predefined seed nodes to create ClusterClient.

So, I should connect too Zookeeper and retrieve seed nodes set by 
ConstructR.

What is the proper way of doing this except using low level Zookeeper API

P.S. This is not Zookeeper specific question, it's the same for  ETCD / 
Consul.

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


[akka-user] [akka-cluster-sharding] Create shard entity actors based checking some condition.

2017-09-25 Thread Evgeny Shepelyuk
Hello

I'd like to implement cluster sharding enabled service with following 
scenario

# *Wallet *service manages users' wallets
# Each *wallet* is represented as persistent actors / shard entity
# Shard clients are sending deposit / withdraw commands to wallets
# Wallet creation is a dedicated business procedure and can't be just a 
creating new actor by *ShardRegion *actor
 
What we're trying to achieve is 

# before processing deposit / withdraw commands to check if some external 
DB contains record about *wallet *registration
# create shard entity only if *wallet *is registered before

Is this a valid scenario for akka cluster sharding and if yes - how can 
this be achieved ?

Unfortunately haven't find proper information in Internet., the only option 
I see now - is to check external DB in preStart method of shard entity.



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

2017-09-25 Thread Evgeny Shepelyuk
Thank you

понеділок, 25 вересня 2017 р. 21:36:08 UTC+3 користувач Justin du coeur 
написав:
>
> Sure, but I think you're thinking about it incorrectly.  Don't worry about 
> creating the Sharding entity itself, which has no lasting effect -- 
> instead, focus on not *persisting* anything unless the wallet is already 
> valid.  The preStart idea isn't bad, but probably expensive (assuming the 
> external DB is a bit expensive, which is typically true), so you don't want 
> to *always* check it, just when the wallet is new.
>
> Instead, I would send a message to the wallet, which causes the wallet 
> entity to be created and to "recover".  Recovery finds that there is no 
> history for the wallet, so post-recovery the actor checks the external DB.  
> If it finds that the wallet has been created, great -- it persists an event 
> that says so.  Otherwise it returns a message saying "this wallet doesn't 
> exist yet", and kills itself.
>
> On Mon, Sep 25, 2017 at 9:47 AM, Evgeny Shepelyuk <eshep...@gmail.com 
> > wrote:
>
>> Hello
>>
>> I'd like to implement cluster sharding enabled service with following 
>> scenario
>>
>> # *Wallet *service manages users' wallets
>> # Each *wallet* is represented as persistent actors / shard entity
>> # Shard clients are sending deposit / withdraw commands to wallets
>> # Wallet creation is a dedicated business procedure and can't be just a 
>> creating new actor by *ShardRegion *actor
>>  
>> What we're trying to achieve is 
>>
>> # before processing deposit / withdraw commands to check if some external 
>> DB contains record about *wallet *registration
>> # create shard entity only if *wallet *is registered before
>>
>> Is this a valid scenario for akka cluster sharding and if yes - how can 
>> this be achieved ?
>>
>> Unfortunately haven't find proper information in Internet., the only 
>> option I see now - is to check external DB in preStart method of shard 
>> entity.
>>
>>
>>
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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