by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 00:03
    Aaronontheweb commented #4434
  • May 27 23:41
    Zetanova commented #4434
  • May 27 22:57
    Zetanova commented #4434
  • May 27 22:34
    Aaronontheweb commented #4419
  • May 27 15:54
    Ralf1108 commented #4432
  • May 27 14:42
    Ralf1108 commented #4419
  • May 27 09:41
    Zetanova commented #4434
  • May 27 06:38
    dependabot-preview[bot] labeled #141
  • May 27 06:38
    dependabot-preview[bot] opened #141
  • May 27 06:38

    dependabot-preview[bot] on nuget

    Bump AkkaVersion from 1.4.6 to … (compare)

  • May 27 06:33

    dependabot-preview[bot] on nuget

    (compare)

  • May 27 06:33
    dependabot-preview[bot] closed #156
  • May 27 06:33
    dependabot-preview[bot] commented #156
  • May 27 06:33
    dependabot-preview[bot] labeled #157
  • May 27 06:33
    dependabot-preview[bot] opened #157
  • May 27 06:33

    dependabot-preview[bot] on nuget

    Bump AkkaVersion from 1.4.5 to … (compare)

  • May 27 01:23

    Aaronontheweb on dev

    added v1.4.8 placeholder for ni… (compare)

  • May 27 01:23

    Aaronontheweb on 1.4.7

    (compare)

  • May 27 01:21

    Aaronontheweb on master

    Added v1.4.7 placeholder for ni… fix: improve doc for persistenc… Bump Microsoft.Extensions.Depen… and 18 more (compare)

  • May 27 01:21
    Aaronontheweb closed #4444
Bartosz Sypytkowski
@Horusiath
@object @bobanco it looks like op-rabbit on akka JVM has a streams support
Boban
@bobanco

@Horusiath yes it does, but like i have said before i haven't used the streams addon, as i remeber at that time when i was porting the library to .net, there was no way to use the recovery strategy with the stream, also there is a blog post from the author The Need for Acknowledgement in Streams and he has mentioned the following restrictions:

The provided Akka Stream Broadcast component is incompatible with message acknowledgement; combining an AckedSource with this component would be an error.
Combining an AckedSource to an Akka Flow or Sink is also an error.
In an Akka FlowGraph, when you combine a Source with a Flow, you get a FlowGraph.Implicits
PortOps. PortOps implements FlowOps and provides stream manipulation operations that are incompatible with an acknowledged Flow; using them is error-prone.

Yin Zhang
@melcloud
Tip of the day, don't try to subscribe UnHandledMessage, and put a predicate on it...
 public class MessageLogger : ReceiveActor
    {
        private readonly ILoggingAdapter _logger;

        /// <summary>
        /// Construct a <see cref="MessageLogger"/>.
        /// </summary>
        /// <param name="loggerFactory">The logger factory.</param>
        public MessageLogger(Func<IActorContext, ILoggingAdapter> loggerFactory)
        {
            Condition.Requires(loggerFactory, nameof(loggerFactory)).IsNotNull();

            _logger = loggerFactory(Context);

            Receive();
        }

        /// <summary>
        /// Subscribe to the event stream for unhandled messages.
        /// </summary>
        protected override void PreStart()
        {
            Context.System.EventStream.Subscribe(this.Self, typeof(UnhandledMessage));

            base.PreStart();
        }

        /// <summary>
        /// Receive any <see cref="IAmMessage"/> and log it.
        /// </summary>
        private void Receive()
        {
          // So horribly wrong here 
            Receive<UnhandledMessage>(
                msg => _logger.Warning("Message from '{Sender}' to '{Recipient}' is not handled: {Message}", msg.Sender, msg.Recipient, msg.Message),
                msg => msg.Message is IAmMessage);
        }
Arsene
@Tochemey
                  var contentStream = response.Content.ReadAsStreamAsync();
                    try
                    {
                        contentStream.Wait(TimeSpan.FromSeconds(1));
                        return new ImageDownloadResult(image, response.StatusCode, contentStream.Result);
                    }
                    catch //timeout exceptions!
                    {
                        return new ImageDownloadResult(image, HttpStatusCode.PartialContent);
                    }
Can I do this await response.Content.ReadAsStreamAsync? I am asking this because it is recommended not to use async await in Actor receive.
Yin Zhang
@melcloud
You can do await, but await means suspend the mailbox, which may have a performance impact depends on your requirement
Arsene
@Tochemey
So what is the difference between the await and what was suggested on the github?
because We still suspend the mailbox in the code above. Maybe I am not getting it very well.
Yin Zhang
@melcloud
@Tochemey If you are not using await, I would suggest you to put the ImageDownloadResult into a continueWith of ReadAsStreamAsync() then pipeTo the destination actor (e.g. Self)
@Tochemey E.g.
var contentStream = response.Content.ReadAsStreamAsync().ContinueWith(t => 
{
    if (t.IsCancelled || t.IsFault)
    {
         return new ImageDownloadResult(image, HttpStatusCode.PartialContent);
    }

          return new ImageDownloadResult(image, response.StatusCode, t.Result);
});
Arsene
@Tochemey
good
This message was deleted
tx
Corneliu
@corneliutusnea
Guys, can Akka cluster nodes talk to each other VIA the lighthouse? e.g. If I have connectivity from C1>LH and C2>LH but not C1>C2 ?
Yin Zhang
@melcloud
@corneliutusnea I think you need to customise Lighthouse a little bit, as long as lighthouse can inform C2 where the ClusterReceipientEndpoint is. See akka cluster client doc, http://getakka.net/docs/clustering/cluster-client#akka-cluster-client and http://letitcrash.com/post/56134720289/22-spotlight-cluster-client
Corneliu
@corneliutusnea
@melcloud Docs say this Also don't use cluster client to communicate between actors inside the same cluster, as it's not a suitable tool for this job :( I want to use it to communicate between clients in the same cluster
Yin Zhang
@melcloud
@corneliutusnea Ah, sorry. Got you. You are talking about nodes in same cluster. Then your scenario is fine. LH will act as the seed node for this purpose.
which means C1 and C2 will form a cluster and gossip to each other
Corneliu
@corneliutusnea
but in my scenario C1 and C2 can't reach each other, I'd like them to ONLY talk via the LH
Yin Zhang
@melcloud
but if C1 and C2 cannot reach each other, how can they be the same cluster?
Corneliu
@corneliutusnea
well, a cluster is a logical entity
but there is a firewall in between them that I can't get rid of :(
Bartosz Sypytkowski
@Horusiath
@corneliutusnea cluster nodes can communicate directly with each other. Lighthouse is used only to form the cluster.
also don't use cluster client when you can just call actors or use distributed pub/sub - cluster client is basically distributed pub/sub with ability to reach the cluster from the outside
Corneliu
@corneliutusnea
@Horusiath I don't plan to use the cluster client but I don't have (atm) to make the cluster nodes talk to each other when they are deployed as Azure Web Site instances. They can happily talk to the LH which is in the same VNet but not in between them :( so I'm looking for alternatives to have the cluster still working without the nodes being able to talk to each other directly
Arjen Smits
@Danthar
@corneliutusnea Your putting yourself in a really difficult situation. The akka cluster is specifically designed and engineered to have p2p connection to each member in the cluster. All kind of things depend on that. So if you are going to deviate from that design you will run into all kinds of problems with mechanisms that detect if a node is down or unreachable.
I think, your best bet in this would be to remove your website from the cluster, and use a proxy node that is part of the cluster, that can talk to the cluster on behalf of the website.
the website could use remoting to communicate with the proxy, while the proxy uses the normal mechanisms
however your proxy would have to be specifically engineered to suit its role as a proxy for your website.
Bartosz Sypytkowski
@Horusiath
at least it's possible :P
Corneliu
@corneliutusnea
@Danthar I understand ... I just really wanted to use the power of the websites to run the cluster. If I have more nodes (e.g. cluster dedicated nodes != websites) = more resources = more $
If I move away from Web Service to Cloud Service = more management
I know ... I want to have my cake and eat it to .. two of them ... in a cluster ... for free .. :)
Arjen Smits
@Danthar
Well, building a proxy would still help you. Yes costs would be higher, but it would be linear and in a predictable way. It just slightly raises the costs if adding a new website node. But you could still run those proxies all on one VM if you want. That way the cost of adding a new website node, would go down the more website-nodes you have.
Corneliu
@corneliutusnea
yes, my plan was to write a proxy and run it on the LH .. or hope there is such a proxy already on the LH :D
Arjen Smits
@Danthar
No there is not.
The lighthouse is a baremetal actorsystem instance. The only thing it does is join a specified cluster
and run the basic cluster infrastructure that every cluster node does
So its role is to act as a seed node for bootstrapping your cluster
It does not do anything else
A proxy implementation would basically have to be the "cluster" version implementation of your website.
Where it knows how to act on messages received by your website, and knows that it, for example, needs to subscribe in some cluster-pubsub
and send any responses from that, back to the website
Thats what i meant with that your proxy would have to be specifically engineered to suit its role as a proxy for your website.
And thats why there is no generic cluster proxy thingy
Vlad Kosarev
@vladkosarev
Remoting doesn't work for azure websites right now anyway so you can't even do that
Arjen Smits
@Danthar
If remoting does not work, then clustering would not work either, since it uses the same infrastructure underneath
Vlad Kosarev
@vladkosarev
yes, clustering never worked, remoting broke in 1.1
remoting has been fixed in dev branch but hasn't been released yet
Arjen Smits
@Danthar
ah, yep
Mike Johnson
@softwaremike
Are you saying remoting doesn't work at all in 1.1 or just for azure websites? I just updated my 1.0 project to 1.1.1 a few minutes ago and we use remoting between several processes..