Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 08:20
    Zetanova synchronize #3916
  • 08:13
    Horusiath commented #3908
  • 08:12
    Horusiath commented #3908
  • 08:11
    Horusiath commented #3908
  • 07:58
    Horusiath commented #3284
  • 07:56
    Horusiath commented #3284
  • 07:32
    ismaelhamed commented #3284
  • 07:24
    Zetanova opened #3916
  • Sep 16 15:35
    Aaronontheweb commented #3284
  • Sep 16 07:55
    ismaelhamed commented #3284
  • Sep 13 16:35
    Aaronontheweb commented #3905
  • Sep 13 16:35
    Aaronontheweb labeled #3905
  • Sep 13 16:35
    Aaronontheweb labeled #3905
  • Sep 13 16:35
    Aaronontheweb labeled #3914
  • Sep 13 16:34
    Aaronontheweb commented #3914
  • Sep 13 01:50
    Aaronontheweb synchronize #3914
  • Sep 13 01:45
    Aaronontheweb commented #3914
  • Sep 12 14:10
    Aaronontheweb synchronize #3914
  • Sep 12 14:10

    Aaronontheweb on dev

    name AzureDevops artifacts per … (compare)

  • Sep 12 14:10
    Aaronontheweb closed #3915
Ryan Anthony
@ryandanthony_twitter
<PackageReference Include="Hyperion" Version="0.9.8" />
Aaron Stannard
@Aaronontheweb
Akka.Serialization.Hyperion
^^^
Ryan Anthony
@ryandanthony_twitter
ok
I didnt have a reference to it at all
Ryan Anthony
@ryandanthony_twitter
@Aaronontheweb ok nightly builds gave me much better results
thanks again for the help
one question, what triggers a rebalance?
Ryan Anthony
@ryandanthony_twitter
never mind, it looks like I just didnt have enough unique shardsIds in the dataset I was using.
nbparrell
@nbparrell
Can actor tell me its name inside of itself?
nbparrell
@nbparrell
Never mind I think I found what I need. Just to clarify I just need to use self.path.name to find the actors name.
Greatsamps
@Greatsamps
Hi guys
i am having an issue using UnboundedStash
below is a cut-down actor implementation that i am using
   public class ClassName : ReceiveActor, IWithUnboundedStash
   {
    public IStash Stash { get; set; }

    public ClassName()
    {
        ReceiveAny(_ => Stash.Stash());
    }

    void BecomeLoaded()
    {
        Stash.UnstashAll();
    }
    }
the problem i am having is that when BecomeLoaded() is called, i am getting a null pointer exception on Stash
i have not tried sending a message to it to see if one is also thrown on ReceiveAny
any thoughts on this? i can obviously do a null check before calling UnstashAll, but concerned that its not actually working
Bartosz Sypytkowski
@Horusiath
@Greatsamps where are you actually calling BecomeLoaded()?
Greatsamps
@Greatsamps
@Horusiath this is a cut-down implementation, in reality there is another method in the constructor under the ReceiveAny that does some work, then BecomesLoaded()
Ismael Hamed
@ismaelhamed
Upgrading to 1.3.5 from 1.2.3, and I'm starting to see some random serialization exceptions upon restarting some nodes:
Cannot find serializer with id [7]. The most probable reason is that the configuration entry 'akka.actor.serializers' is not in sync between the two systems.
which is weird because that's Akka's persistence serializer, which is loaded automatically
Havret
@Havret
How to disable logging for akka persistence query?
image.png
Bartosz Sypytkowski
@Horusiath
@Havret only by using higher log level
@ismaelhamed have you specified persistence config as fallback explicitly? If I remember correctly, after 1.3 there were some problems with loading configurations - because we started supporting .net standard - i.e. app.config were no longer used due to lack of ConfigurationManager API.
@Greatsamps stash can be null when reached from constructor, it's set automatically after constructor call.
Greatsamps
@Greatsamps
@Horusiath Ok great, so doing a null pointer check in this case is ok
thanks for your help
or thinking about this, becasue the constructer has not completed, would that put the stash functionality on hold? should i refactor this?
Bartosz Sypytkowski
@Horusiath
if you need initialized actor, you can always use PreStart method override
AndreSteenbergen
@AndreSteenbergen
I am trying to use the amqp stream in combination with RabbitMQ. I intend to open source the example, but I am still figuring out how the do communication with clients using rabbitMQ streams. I have the following code in the PortalCoordinator (which is going to act as the server to clien portal).
   public class AmqpPortalCoordinator : ReceiveActor
{
    private readonly IActorRef chatserver;
    private readonly ActorMaterializer mat;
    const string inboundQueue = "InboundWeChatServer";

    private readonly AmqpConnectionDetails connectionSettings;
    private Task incomingTask;

    public AmqpPortalCoordinator(IActorRef chatserver)
    {
        this.chatserver = chatserver;

        mat = ActorMaterializer.Create(Context);

        connectionSettings = AmqpConnectionDetails.Create("localhost", 5672)
                                    .WithAutomaticRecoveryEnabled(true)
                                    .WithNetworkRecoveryInterval(TimeSpan.FromSeconds(1));

        var queueDeclaration = QueueDeclaration
                                    .Create(inboundQueue)
                                    .WithDurable(true)
                                    .WithAutoDelete(false);

        var queueSource = NamedQueueSourceSettings.Create(connectionSettings, inboundQueue).WithDeclarations(queueDeclaration);
        var amqpSource = AmqpSource.CommittableSource(queueSource, 1000);

        var messageSource = amqpSource.Select(m =>
        {
            var bytes = m.Message.Bytes;
            m.Ack();

            return MessagePackSerializer.Typeless.Deserialize(bytes.ToArray());
        });

        incomingTask = messageSource.RunForeach(msg => chatserver.Tell(msg), mat);
    }
}
Or am I missing the point using amqp sources?
My biggest concern is actually how to dispose the source, when the server stops for some reason
AndreSteenbergen
@AndreSteenbergen
Oh wait ... KillSwitch, I think Marc told me last moth ...
AndreSteenbergen
@AndreSteenbergen
What do you guys think?
public class AmqpPortalCoordinator : ReceiveActor, IDisposable
{
    private readonly IActorRef chatserver;
    private readonly ActorMaterializer mat;
    const string inboundQueue = "InboundWeChatServer";

    private readonly AmqpConnectionDetails connectionSettings;
    private UniqueKillSwitch killswitch;
    private Task sourceTask;

    public AmqpPortalCoordinator(IActorRef chatserver)
    {
        this.chatserver = chatserver;

        mat = ActorMaterializer.Create(Context);

        connectionSettings = AmqpConnectionDetails.Create("localhost", 5672)
                                    .WithAutomaticRecoveryEnabled(true)
                                    .WithNetworkRecoveryInterval(TimeSpan.FromSeconds(1));

        var queueDeclaration = QueueDeclaration
                                    .Create(inboundQueue)
                                    .WithDurable(true)
                                    .WithAutoDelete(false);

        var queueSource = NamedQueueSourceSettings.Create(connectionSettings, inboundQueue).WithDeclarations(queueDeclaration);
        var amqpSource = AmqpSource.CommittableSource(queueSource, 50);

        var (killswitch, task) = amqpSource
                                    .ViaMaterialized(KillSwitches.Single<CommittableIncomingMessage>(), Keep.Right)
                                    .ToMaterialized(Sink.ForEach<CommittableIncomingMessage>((m) => {
                                        var bytes = m.Message.Bytes;
                                        m.Ack();
                                        chatserver.Tell(MessagePackSerializer.Typeless.Deserialize(bytes.ToArray()));
                                    }), Keep.Both).Run(mat);
        this.killswitch = killswitch;
        this.sourceTask = task;
    }

    public void Dispose()
    {
        killswitch.Shutdown();
        sourceTask.Wait();
    }
}
nathvi
@nathvi
Would it be a good idea to structure request/response message classes in the following way?
 public class RequestMessage
{
    public class Response
    {}
}
nathvi
@nathvi
That way it's easy to find the response message by using the syntax RequestMsg.Response
nathvi
@nathvi
If I'm building a message buffer to remove duplicates in an actor, is it a good idea to be able to change the eviction policy at runtime?
nathvi
@nathvi
I'm wondering how I can verify that if I send a certain actor 1000 messages with the same message id, it only responds back to the sender one message?
public class PutwallActorTests : TestKit
    {
        [Fact]
        public void RequestUpdateStateSentMultipleTimes_OnlyOneResponseBack()
        {
            var probe = CreateTestProbe();
            IActorRef putwallActor = Sys.ActorOf(PutwallActor.Props());
            var guidId = Guid.NewGuid();
            for (int i = 0; i < 100; i++)
            {
                putwallActor.Tell(new PutwallActor.CubbyMessage.RequestUpdateState(true, guidId), probe.Ref);
            }

            var cubbyStateResponse = probe.ExpectMsg<PutwallActor.CubbyMessage.RequestUpdateState.Response>();
            Assert.Equal(guidId, cubbyStateResponse.MessageId);
        }
    }
I know this ^^^ isn't right, but I'm not sure where to go from here.
Stijn Herreman
@stijnherreman
an actor can hold state (depending on your design), so keep a list of message IDs you already replied to
nathvi
@nathvi
I know that part, I'm just not sure on how I can test that in my unit tests :smile:

For example if I added two response message statements like:

var cubbyStateResponse = probe.ExpectMsg<PutwallActor.CubbyMessage.RequestUpdateState.Response>();
var cubbyStateResponse2 = probe.ExpectMsg<PutwallActor.CubbyMessage.RequestUpdateState.Response>();

The test would fail, but my functionality would be correct because the unit test times out on the second statement.

Stijn Herreman
@stijnherreman
oh, well it's not a 100% guarantee because it works with a timeout, but this should be good enough:
var cubbyStateResponse = probe.ExpectMsg<PutwallActor.CubbyMessage.RequestUpdateState.Response>();
probe.ExpectNoMsg()
nathvi
@nathvi
:sparkles: :clap:
Thanks!