These are chat archives for akkadotnet/akka.net

2nd
Sep 2017
jameswilddev
@jameswilddev
Sep 02 2017 15:54 UTC

Secondly, is there a way to only create an actor when the shard region receives a specific message , there are other messages that will be sent subsequent to this first message, but they should only be handled if the actor has been created. Also, how does cluster sharding generate a unique path within each shard?

They'll be spun up automatically on the first message received. You can have them be in a dormant state (using Become, etc.) until the initializing message is received.

Finally, taking the customers example from the docs, how would you say query for all customers that have purchased a specific item using sharding? Should separate query actors be created?

AFAIK this can't be done without having an actor with knowledge of all other actors. You may need an external "index" such as a database table.

Boban
@bobanco
Sep 02 2017 18:58 UTC
Hi Guys, am getting this exception
[ERROR][02-Sep-17 18:50:21][Thread 0005][akka://system/system/akka.persistence.journal.sharding] Error while creating actor instance of type Akka.Persistence.MySql.Journal.MySqlJournal with 1 args: (  connection-string : "server=localhost;user id=root;password=@alienicsserv7;persistsecurityinfo=True;database=grains_db"
  auto-initialize : on
  plugin-dispatcher : akka.actor.default-dispatcher
  class : "Akka.Persistence.MySql.Journal.MySqlJournal, Akka.Persistence.MySql"
  connection-timeout : 30s
  table-name : ShardingJournal
  timestamp-provider : "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
  metadata-table-name : sharding_metadata
)
Cause: [akka://system/system/akka.persistence.journal.sharding#1210895305]: Akka.Actor.ActorInitializationException: Exception during creation ---> System.TypeLoadException: Error while creating actor instance of type Akka.Persistence.MySql.Journal.MySqlJournal with 1 args: (  connection-string : "server=localhost;user id=root;password=;persistsecurityinfo=True;database=grains_db"
  auto-initialize : on
  plugin-dispatcher : akka.actor.default-dispatcher
  class : "Akka.Persistence.MySql.Journal.MySqlJournal, Akka.Persistence.MySql"
  connection-timeout : 30s
  table-name : ShardingJournal
  timestamp-provider : "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
  metadata-table-name : sharding_metadata
) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void Akka.Persistence.Sql.Common.Journal.QueryConfiguration..ctor(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.TimeSpan)'.
   at Akka.Persistence.MySql.Journal.MySqlJournal..ctor(Config journalConfig)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Akka.Actor.Props.ActivatorProducer.Produce()
   at Akka.Actor.Props.NewActor()
   --- End of inner exception stack trace ---
   at Akka.Actor.Props.NewActor()
   at Akka.Actor.ActorCell.CreateNewActorInstance()
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<NewActor>b__0()
   at Akka.Actor.ActorCell.UseThreadContext(Action action)
   at Akka.Actor.ActorCell.NewActor()
   at Akka.Actor.ActorCell.Create(Exception failure)
   --- End of inner exception stack trace ---
   at Akka.Actor.ActorCell.Create(Exception failure)
   at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)
Aaron Stannard
@Aaronontheweb
Sep 02 2017 18:59 UTC
should log an issue with the versions of each module you're using
since we haven't upgraded any of the persistence plugins
and the SQL plugins will not work with Akka.Cluster.Sharding right now
1.3.1 is aimed at fixing that
Boban
@bobanco
Sep 02 2017 19:00 UTC
oh..so i guess thats the issue
cuz before upgrade to the latest version
the demo project was working correctly
let me revert back until all plugins are updated
Aaron Stannard
@Aaronontheweb
Sep 02 2017 19:01 UTC
yeah, don't upgrade anything that uses Akka.Persistence at all right now
wait until the plugins get their upgrades
Boban
@bobanco
Sep 02 2017 19:01 UTC
@Aaronontheweb thanks man
Aaron Stannard
@Aaronontheweb
Sep 02 2017 19:01 UTC
we RTM'd Akka.Persistence
and in the process, froze the internal APIs after making the last round of changes before marking them as stable
so there's a chance constructors et al are different across those versions
on some of the internal stuff
Boban
@bobanco
Sep 02 2017 19:02 UTC
good to know, thanks for the info
Aaron Stannard
@Aaronontheweb
Sep 02 2017 19:02 UTC
1.3.1 should be ready to go any time
I'm fixing DNS support in Akka.IO right now
that's the last thing that needs to ship
AFAIK
Boban
@bobanco
Sep 02 2017 19:05 UTC
should i wait for 1.3.1 or to revert back to the old version? i was building prototypes on akka sharding and microsoft orleans , akka.net has far better performance for persistence etc so i was thinking to go with it
Aaron Stannard
@Aaronontheweb
Sep 02 2017 19:05 UTC
IMHO, keep a branch with your 1.3.0 changes
and upgrade that to 1.3.1 when it comes out, which might be in the next ~48 hours or so
depends on if the Mono runtime still hates IPV6 or not
the persistence plugins are due for a round of upgrades when this comes out
turns out none of the SQL ones could handle serializers with manifests
which the cluster.sharding one happens to use
Boban
@bobanco
Sep 02 2017 19:07 UTC
great, thanks again for the quick reply
yesterday i have also updated the port of alpaka amqp connector to be in sync with the akka one, will update my repo probably tomorrow
also i have started a port of lagom framework to .net
but its still in early phase and alot of design decision has to be taken
i dont knwo if i have to keep the port to be more c# frendly or not
Boban
@bobanco
Sep 02 2017 19:13 UTC
@Aaronontheweb what do you think?
Aaron Stannard
@Aaronontheweb
Sep 02 2017 20:27 UTC
submit a work in progress PR
that's the way to go IMHO