Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 15:57
    Aaronontheweb closed #3877
  • 15:57
    Aaronontheweb commented #3877
  • 15:56

    Aaronontheweb on dev

    Persistence TestKit documentati… (compare)

  • 15:56
    Aaronontheweb closed #3889
  • 07:27
    dependabot-preview[bot] labeled #3999
  • 07:27

    dependabot-preview[bot] on nuget

    Bump FluentAssertions from 4.14… (compare)

  • 07:27
    dependabot-preview[bot] opened #3999
  • Oct 20 17:25
    valdisz synchronize #3889
  • Oct 20 17:17
    valdisz synchronize #3889
  • Oct 20 15:44
    valdisz synchronize #3889
  • Oct 20 09:22
    ismaelhamed commented #3863
  • Oct 19 23:39
    valdisz synchronize #3889
  • Oct 19 23:08
    edvinasz commented #2947
  • Oct 19 13:36
    Aaronontheweb commented #3973
  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3995
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump BenchmarkDotNet from 0.10.… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] edited #3995
  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3993
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump Google.Protobuf from 3.9.1… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3991
Daniel D'Agostino
@dandago2_twitter
akka {
    actor.provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
    remote {
        helios.tcp {
            port = 8081
            hostname = localhost
        }
    }
    cluster {
        seed-nodes = ["akka.tcp://ClusterSystem@127.0.0.1:8081"]
    }
}
This doesn't actually work
but if I change both host names to localhost, or both to 127.0.0.1, it works
it looks like Akka doesn't realise that they are actually the same thing
Daniel D'Agostino
@dandago2_twitter
Another thing: If I run a standalone node with itself configured as seed node, I see no errors. If I set up a non-seed node using the aforementioned node as seed node, I get the following error:
blob
Daniel D'Agostino
@dandago2_twitter
OK disregard the last error, had the wrong actorsystem name configured
Damian Reeves
@DamianReeves
For cluster sharding it would seem that I need to keep track of the ShardRegions I've created. If I call Start(...) or StarAsync(...) twice for the same type it throws and if I call ShardRegion(type) without previously starting a type it throws... am I missing something?
Bartosz Sypytkowski
@Horusiath
@DamianReeves shard region is singleton in actor system scope, if you're using one actor system for your application, you may set shard region as static property. Also there is other method ClusterSharding.ShardRegion(typeName) which will return shard region if it exists.
Damian Reeves
@DamianReeves
I get that, but lets say I have 2 AggregateRoots: Inventory and Customer it seems I'd have 2 regions and if I added Product it would be a third, is this the wrong approach?
I'm looking to do something like this:
        ReceiveAsync<AggregateCommandEnvelope>(async envelope =>
        {
            IActorRef shardRegion;
            var aggregateType = envelope.AggregateType;
            var aggregateTypeName = envelope.AggregateType.FullName; //TODO: May need to safe guard this in a different manner
            if(!_aggregateShardRegions.TryGetValue(aggregateTypeName, out shardRegion))
            {
                shardRegion =
                    await _sharding.StartAsync(
                        aggregateTypeName, 
                        Props.Create(aggregateType),
                        ClusterShardingSettings.Create(Context.System), 
                        new ShardingMessageExtractor(10)
                    );
            }
        });
Bartosz Sypytkowski
@Horusiath
yes
in general identifier of your entity (sharded actor) is something like (string typeName, string shardId, string entityId)
Damian Reeves
@DamianReeves
Ok, so in my example the typeName I pass to the sharding.Start is a broader concept like InventoryManagementSystem
Bartosz Sypytkowski
@Horusiath
ClusterSharding.ShardRegion(typeName) matches the ClusterSharding.Start(typeName: ...) parameter
Francis Paulin
@paulinfrancis

Hi all, I'm just getting into akka .net, and have a question I hope somebody can shed some light on. I've got an ASP .NET Core app, where I have wired SignalR and Akka together.

One of my actors parses some files, and tells my SignalR bridge to notify the clients with the resulting object.

I got an error:

The calling thread cannot access this object because a different thread owns

From json.net when it tried to serialize the object before SignalR sent it to the connected clients.

Without changing anything, the exception is no longer thrown, and everything works.

Am I experiencing issues with the dispatcher? If yes, what is the recommended configuration?

Thanks :)

Bartosz Sypytkowski
@Horusiath
@paulinfrancis how are you calling a signalr api?
Daniel D'Agostino
@dandago2_twitter
Where do I find the source for the Akka .NET documentation exactly?
Bartosz Sypytkowski
@Horusiath
@dandago2_twitter http://getakka.net/docs/ . You can also suplement it with docs for akka jvm in many situations
Daniel D'Agostino
@dandago2_twitter
I just want to edit it :)
Francis Paulin
@paulinfrancis

In my actor system init

public static void Create(IHubContext context, ISimulator simulator)
{
    _signalRSimulatorEventsPusher = new SignalRSimulatorEventsPusher(context);

    _actorSystem = ActorSystem.Create("SimulatorSystem");

    var signalRBridgeProps = Props.Create(() => new SignalRBridgeActor(_signalRSimulatorEventsPusher, ActorReferences.Simulator));
    ActorReferences.SignalRBridge = _actorSystem.ActorOf(signalRBridgeProps, "SignalRBridge");

    //Kosher?
    var simulatorProps = Props.Create(() => new SimulatorActor(simulator, ActorReferences.SignalRBridge));
    ActorReferences.Simulator = _actorSystem.ActorOf(simulatorProps, "Simulator");
}

In my SimulatorActor:

Receive<DiagramLoadedMessage>(message => signalRBridgeActor.Tell(message));

In SignalRBridgeActor. This is where it sometimes blows up.

Receive<DiagramLoadedMessage>(message =>
{
        _simulatorEventsPusher.NotifyLoadedDiagram(message.DiagramRootObject);
});
Daniel D'Agostino
@dandago2_twitter
@Horusiath what do you use to preview the markdown output when you edit the docs?
Bartosz Sypytkowski
@Horusiath
you've abstracted meat away ;) I was using signalr with actors by wrapping signalr hub/connection with an actor (like Props.Create(() => new SignalRActor(signalrHub)))
@dandago2_twitter vscode with markdown plugin
Francis Paulin
@paulinfrancis

I had a look here: http://getakka.net/docs/working-with-actors/Dispatchers, so I tried:

var signalRBridgeProps = Props.Create(() => new SignalRBridgeActor(_signalRSimulatorEventsPusher, ActorReferences.Simulator))
                                                                  .WithDispatcher("akka.actor.synchronized-dispatcher");

But it errors: "The current SynchronizationContext may not be used as a TaskScheduler."

Bartosz Sypytkowski
@Horusiath
SynchornizationContext binds actor to a foreground thread, but it's thread only, which means you cannot use stuff like async/await in actors dispatched by it
Arjen Smits
@Danthar
Most akka projects can be found under https://github.com/akkadotnet
Francis Paulin
@paulinfrancis
@Horusiath In your app that uses SignalR, did you configure the dispatcher, or did you go with the defaults?
Damian Reeves
@DamianReeves
Hey just double checking, but it is now safe for me to use async/await in my actor code?
Bartosz Sypytkowski
@Horusiath
@paulinfrancis afaik, I was using defaults. I've also written a blog post about using signalr for event logging: http://bartoszsypytkowski.com/log-your-akka-net-application-in-your-browser/
@DamianReeves if you're using ReceiveAsync with default dispatcher, there should be no problem with that
Francis Paulin
@paulinfrancis
@Horusiath I did some more digging, and the error does indeed only happen when the object is instantiated on another thread, so I'll need to figure out how to marshal to the correct thread somehow.
Daniel D'Agostino
@dandago2_twitter
I deleted the obsolete note in the clustering page, and it has been merged. I see the note is still on the webpage. How does it actually get updated?
Arjen Smits
@Danthar
The merge should trigger an website update
Damian Reeves
@DamianReeves
Just an FYI... the ClusterSharding.Node example throws an exception on running

What are the minimal settings I need to get cluster sharding working?

This does not seem to be enough:

      akka {
        # here we are configuring log levels
        log-config-on-start = off
        stdout-loglevel = DEBUG
        loglevel = DEBUG
        # this config section will be referenced as akka.actor
        actor {
          debug {
              receive = on
              autoreceive = on
              lifecycle = on
              event-stream = on
              unhandled = on
          }
          serializers {
            wire = "Akka.Serialization.WireSerializer, Akka.Serialization.Wire"
          }
          serialization-bindings {
            "System.Object" = wire
          }
        }
        remote {
          helios.tcp {
            public-hostname = "localhost"
            hostname = "localhost"
            port = 0
          }
        }
        cluster {
          auto-down-unreachable-after = 5s
          sharding {
            least-shard-allocation-strategy.rebalance-threshold = 3
          }
        }
        persistence {
          # publish-plugin-commands = on              
          journal {
              plugin = "akka.persistence.journal.sqlite"
              sqlite {
                  class = "Akka.Persistence.Sqlite.Journal.SqliteJournal, Akka.Persistence.Sqlite"
                  plugin-dispatcher = "akka.actor.default-dispatcher"
                  table-name = event_journal
                  metadata-table-name = journal_metadata
                  auto-initialize = on
                  connection-string-name = "SqliteDb"
              }
          }

          snapshot-store {
            plugin = "akka.persistence.snapshot-store.sqlite"
            sqlite {
                # Class name of the plugin.
                class = "Akka.Persistence.Sqlite.Snapshot.SqliteSnapshotStore, Akka.Persistence.Sqlite"

                # Dispatcher for the plugin actor.
                plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"

                # Dispatcher for streaming snapshot IO.
                stream-dispatcher = "akka.persistence.dispatchers.default-stream-dispatcher"

                table-name = snapshot
                auto-initialize = on
                connection-string-name = "SqliteDb"
            }
          }
        }
      }
Damian Reeves
@DamianReeves
Ahh, figured it out was missing:
provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
Maciek Misztal
@mmisztal1980
blob
Confirmed - I'm able to get lighthouse started on Mono :) with a minor burp inside TopShelf
@Aaronontheweb I'd like to take this a bit further and have some fun with Docker on Linux on the way, I'm curious about one thing though - how do I determine the addresses of seed nodes running as containers?
clausthalVK
@clausthalVK
Hi,
I need to use akka.net for a portable library
any help would be appreciated
Arjen Smits
@Danthar
@clausthalVK We currently don't have Akka as a PCL.
We are working on .net core support though.
Since .netstandard is the next generation of PCL, i recommend going with that... https://docs.microsoft.com/en-us/dotnet/articles/standard/library
clausthalVK
@clausthalVK
thank you
Daniel D'Agostino
@dandago2_twitter
@Danthar it seems the update did not trigger, because I still see the obsolete note :)
Arjen Smits
@Danthar
@dandago2_twitter Yes i know. Somehow the drone that updates the site is having a hissy-fit. We are looking into it.