Orbit - Virtual actor framework for building distributed systems

Overview
Comments
  • Replace Guava with Caffeine.

    Replace Guava with Caffeine.

    Caffeine vs Guava (old benchmarks below, see commit for updated benchmarks)

    Caffeine

    Benchmark Mode Cnt Score Error Units SingleNodeBenchmark.requestThroughput thrpt 100 3013608.693 ± 29675.239 ops/s SingleNodeBenchmark.avgRequestTime_batched avgt 100 1.242 ± 0.007 us/op SingleNodeBenchmark.avgRequestTime_singleThread avgt 100 4.279 ± 0.060 us/op

    Benchmark Mode Cnt Score Error Units SingleNodeBenchmark.requestThroughput thrpt 100 3085224.027 ± 36085.998 ops/s SingleNodeBenchmark.avgRequestTime_batched avgt 100 1.269 ± 0.006 us/op SingleNodeBenchmark.avgRequestTime_singleThread avgt 100 4.142 ± 0.074 us/op

    Guava

    Benchmark Mode Cnt Score Error Units SingleNodeBenchmark.requestThroughput thrpt 100 3152836.327 ± 35103.067 ops/s SingleNodeBenchmark.avgRequestTime_batched avgt 100 1.239 ± 0.010 us/op SingleNodeBenchmark.avgRequestTime_singleThread avgt 100 4.081 ± 0.078 us/op

    opened by johnou 77
  • Query about Orbit rpc performance

    Query about Orbit rpc performance

    Hello, I wanted to check the RPC call performance of Orbit. I saw that for things like a hello world, it takes 1 MS to make a request-reply. However other Actor frameworks does it in significantly less.

    I want to know is it possible to configure Orbit to use things like Netty? Also Lets say I am in JVM 1 (in a 2 JVM cluster) and I am trying to find teh actor "hello", so if I make multiple calls to "hello", can I request somethings like Co-location. I think a RPC call in this scenario will be wasteful, may be local calls will suffice.

    I am sure with time this optimizations will be done in Orbit, I myself was thinking of storing the orbit actor states in Infinsipan grid. It will be nice if you can clarify on these.

    opened by amit2103 28
  • Orbit Metrics

    Orbit Metrics

    A metrics layer based on dropwizard's metrics library. It is still pretty simple and only exposes Gauge functionality and not any of the more interesting features of Dropwizard Metrics like histograms.

    Currently, objects need to be manually registered with the MetricsManager (see Stage.java for an example). Eventually I'd like to see this change in some fashion. Any fields or methods tagged with @ExportMetrics will be registered for with the Metrics system.

    Current Implementation supports SL4J, Graphite, and Ganglia reporting and multiple reporters can be active at once.

    Configuration takes place in orbit.yaml like so:

    orbit.metrics.reporters:
      - !!com.ea.orbit.actors.metrics.config.reporters.Slf4jReporterConfig
        period: 1
        periodUnit: 'MINUTES'
      - !!com.ea.orbit.actors.metrics.config.reporters.GraphiteReporterConfig
        period: 1
        periodUnit: 'MINUTES'
        host: 127.0.0.1
        port: 2003
    

    Feedback is appreciated! :)

    opened by FieldFlux 21
  • Default parallelism too high

    Default parallelism too high

    By default Messaging and Execution will create their own ForkJoinPool with parallelism set to 1000, meaning that on a 64bit JRE (default thread stack size is 1 meg?) the JVM may use up to 2G of heap.

    opened by johnou 15
  • Unrecognized Windows Sockets error

    Unrecognized Windows Sockets error

    Since the author of issue #257 deleted his account and I'm with the same issue. I created other issue and the previous issue should be closed.

    Note that all code is the same of this wiki

    Setup:

    PS C:\Users\petit> gradle -v
    ------------------------------------------------------------
    Gradle 4.0
    ------------------------------------------------------------
    
    Build time:   2017-06-14 15:11:08 UTC
    Revision:     316546a5fcb4e2dfe1d6aa0b73a4e09e8cecb5a5
    
    Groovy:       2.4.11
    Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
    JVM:          1.8.0_131 (Oracle Corporation 25.131-b11)
    OS:           Windows 10 10.0 amd64
    

    build.gradle:

    apply plugin: 'java'
    apply plugin: 'application'
    
    repositories {
        jcenter()
    }
    
    dependencies {
        compile "cloud.orbit:orbit-runtime:1.1.0"
    }
    
    mainClassName = "Main"
    

    Output:

    PS C:\Users\petit\Documents\Code\orbit-test> ./gradlew run
    
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    Jul 05, 2017 7:43:12 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport start
    INFO: ISPN000078: Starting JGroups channel orbit-helloworld-cluster
    Jul 05, 2017 7:43:12 PM org.jgroups.stack.DiagnosticsHandler bindToInterfaces
    **WARNING: failed to join /224.0.75.75:7500 on net0: java.net.SocketException: Unrecognized Windows Sockets error: 0: no I
    net4Address associated with interface**
    
    -------------------------------------------------------------------
    GMS: address=orbit-helloworld-cluster, cluster=orbit-helloworld-cluster, physical address=192.168.2.107:57133
    -------------------------------------------------------------------
    Jul 05, 2017 7:43:14 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport viewAccepted
    INFO: ISPN000094: Received new cluster view for channel orbit-helloworld-cluster: [orbit-helloworld-cluster|0] (1) [orbi
    t-helloworld-cluster]
    Jul 05, 2017 7:43:14 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport startJGroupsChannelIfNeeded
    INFO: ISPN000079: Channel orbit-helloworld-cluster local address is orbit-helloworld-cluster, physical addresses are [19
    2.168.2.107:57133]
    Jul 05, 2017 7:43:14 PM org.infinispan.factories.GlobalComponentRegistry start
    INFO: ISPN000128: Infinispan version: Infinispan 'Mahou' 8.1.4.Final
    Here: Welcome to orbit
    You said: 'Welcome to orbit', I say: Hello from 1705436675 !
    Jul 05, 2017 7:43:15 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport stop
    INFO: ISPN000080: Disconnecting JGroups channel orbit-helloworld-cluster
    Jul 05, 2017 7:43:15 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport stop
    INFO: ISPN000082: Stopping the RpcDispatcher for channel orbit-helloworld-cluster
    
    
    BUILD SUCCESSFUL in 5s
    2 actionable tasks: 1 executed, 1 up-to-date
    
    opened by ghost 10
  • Orbit Web

    Orbit Web

    Thanks for building a great framework. I was using the orbit -chat sample. Now the sample says that we can start only one server in one machine because of port limitations. Now if I start two servers in two machines will they auto discover each other? How does failover work? It will be nice if you can simply help me know how are things like HA configured.

    Lastly can we have a better doc for Orbit-Web stating its functionalities. The orbit doc for other components is fantastic, but a bit more of web will be better.

    opened by amit2103 8
  • task.cancel() has no effect on taks waiting in the queue.

    task.cancel() has no effect on taks waiting in the queue.

    Hi, i ve two actors Actor1 and Actor2. Actor2 m2 method is a long running method. Im calling Actor2.m2() multiple times from actor1 and adding response task to a list. Sometimes i need to cancel waiting tasks (actor2.m2()) and i call task.cancel() for all tasks i already added list. But actor2 executes tasks i ve cancelled before. Does it mean , an actor method once called there is nothing i can do to stop it?

    interface Actor1 extends Actor {
      public Task<Void> m1();
      public Task<Void> cancel();
    }
    
    interface Actor2 extends Actor{
    // this is long running task
     public Task<Void> m2(String prm);
    }
    
    class Actor1Impl extends AbstractActor implements Actor1 {
       private List<Task> taskCache = new ArrayList();   
       private Actor2 act2;
       public Task<Void> activateAsync(){
            act2 = Actor.getReference(Actor2.class);
       }
    
       public Task<Void>  m1(){
          taskCache.clear();
          for(int i=0;i<100;i++)
             taskCache.add(act1.m2());
          return Task.done();
       }
       public void cancel() {
           for(Task t:taskCache) {
            t.cancel();
           }
           taskCache.clear();
       }
    
    }
    
    

    Actor1 methods is being called by JavaFX thread (a start and a cancel button).

    Thanks.

    opened by mryvz 7
  • Ability to return delayed Task / CompletableFuture

    Ability to return delayed Task / CompletableFuture

    Could you tell, is there a more simple way to create and return a delayed Task? Without such a construction:

    CompletableFuture<String> future = new CompletableFuture<>();
    registerTimer(() -> {
        future.complete("bingo!");
        return Task.done();
    }, 1000, 0, TimeUnit.MILLISECONDS);
    return Task.fromFuture(future);
    

    Have I something missed? Thanks!

    opened by fixedorgo 7
  • StatelessWorker Exception

    StatelessWorker Exception

    As discussed in Gitter: see https://github.com/Fiurgeist/OrbitIssue

    There you can find a unit test which doesn't make a lot of sense as it is, because I streamlined it to focus on the issue. It's basically just a for loop which calls a StatelessWorker a 100 times and in that actor another StatelessWorker is called. And every 10th or so run of the test I get this exception:

    Jul 22, 2015 5:06:12 PM com.ea.orbit.concurrent.ExecutorUtils lambda$newScalingThreadPool$0
    Uncaught Exception
    java.lang.Error: Error loading class: null
        at com.ea.orbit.actors.runtime.Execution.classForName(Execution.java:776)
        at com.ea.orbit.actors.runtime.Execution.classForName(Execution.java:762)
        at com.ea.orbit.actors.runtime.Execution.access$300(Execution.java:93)
        at com.ea.orbit.actors.runtime.Execution$Activation.getOrCreateInstance(Execution.java:432)
        at com.ea.orbit.actors.runtime.Execution.executeMessage(Execution.java:989)
        at com.ea.orbit.actors.runtime.Execution.lambda$handleOnMessageReceived$24(Execution.java:912)
        at com.ea.orbit.actors.runtime.Execution$$Lambda$55/2071701248.get(Unknown Source)
        at com.ea.orbit.actors.runtime.ExecutionSerializer.lambda$offerJob$32(ExecutionSerializer.java:116)
        at com.ea.orbit.actors.runtime.ExecutionSerializer$$Lambda$56/619859981.run(Unknown Source)
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source)
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at com.ea.orbit.actors.runtime.Execution.classForName(Execution.java:770)
        ... 13 more
    
    opened by Fiurgeist 7
  • Orbit Metrics Round 2

    Orbit Metrics Round 2

    This PR provides a wrapper around Dropwizard's metrics library.

    Fields or Methods tagged with @ExportMetric can be registered to emit metrics to a variety of sources via Reporters. In this PR, wrappers are provided for emitting metrics to SL4J, JMX, Graphite, and Ganglia. Reporters can be configured via orbit.yaml like so:

    orbit.metrics.reporters:
      - !!com.ea.orbit.metrics.config.Slf4jReporterConfig
        period: 1
        periodUnit: 'MINUTES'
        prefix: 'chat.chat-backend'
      - !!com.ea.orbit.metrics.config.JmxReporterConfig {}
    

    Standard configuration management tools can be used to modify the prefix on a host-by-host manner when deploying by modifying this file.

    An Orbit Container Module is provided to setup metrics on the JVM if actors is not being used. The Actors Module will also attempt to setup metrics. If Container is not being used, MetricsManager can be provided a set of ReporterConfig objects using the initializeMetrics() method. This should be done before Stage startup if actors is being used.

    Metrics must be registered using the MetricsManager registerExportedMetrics method. A instanceId may be provided so that instance metrics can be setup.

    Metrics must be uniquely named. Currently, metrics are named using the name of the class they are defined in plus the name provided via the ExportMetric annotation. For example a metric in ca.fieldflux.awesomeapp.neatclass with a field annotated with

    @ExportMetric(name="coolmetric")
    

    would generate a metric named:

    ca.fieldflux.awesomeapp.neatclass.coolmetric
    

    Instance Metrics can be used where there may be more than one instance of a class and metrics must be tracked per-instance. To mark a metric as an instance metric use:

    @ExportMetric(name="coolmetric", isInstanceMetric=true)
    

    and provide an instanceId when registering the object instance. This will insert an instance identifier into the metric name hierarchy like so:

    ca.fieldflux.awesomeapp.neatclass.instanceId.coolmetric
    

    An Actors lifetime extension is also provided so that Actors can expose metrics and have them automatically registered and unregistered on actor activation and deactivation respectively.

    opened by FieldFlux 7
  • Exception when using JpaStorageProvider

    Exception when using JpaStorageProvider

    Hi, I switched my little test project to MySQL and get now the following exception

    com.ea.orbit.exception.UncheckedException: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Problem compiling [select s from State s where s.stateId=:stateId].
    

    coming from

    c.ea.orbit.actors.runtime.Execution - Error reading actor state for: com.ea.orbit.actors.runtime.ReminderControllerFactory$ReminderControllerReference
    

    because the ReminderController has a state as inner class (and no annotation), and that is not supported by the implementation of JpaStorageProvider according to your documentation. Not sure if there are other Orbit internal actors with state, but that's the one I found.

    opened by Fiurgeist 7
  • Observable/stream support?

    Observable/stream support?

    I'm sorry if it's not the right place to ask this question. Are there any plans to add Observable and/or Stream support like the old Orbit had? I would really love to use Orbit 2 for my app, but I rely on that kind of functionality.

    opened by malchmih 0
  • Documentation on the principles of virtual actors & comparison to Akka

    Documentation on the principles of virtual actors & comparison to Akka

    It seems that in https://github.com/orbit/orbit/issues/102 some explanation regarding the distinction between virtual actors and the actor model (as implemented by Akka) was added to the documentation at http://orbit.bioware.com/orbit-actor-overview.html ; however, that page is no longer available. The new documentation website at https://www.orbit.cloud/orbit/ doesn't have much in the way of explanation about virtual actors specifically, instead linking to Microsoft Orleans.

    Orbit is a framework to write distributed systems using virtual actors on the JVM. A virtual actor is an object that interacts with the world using asynchronous messages.

    This describes non-virtual actors as well.

    At any time an actor may be active or inactive. Usually the state of an inactive actor will reside in the database. When a message is sent to an inactive actor it will be activated somewhere in the pool of backend servers. During the activation process the actor’s state is read from the database.

    Based on this, it seems that the key difference is persistence, although again the text does not make explicit the distinction between actor and virtual actor.

    It is heavily inspired by the Microsoft Orleans project.

    Of course, one could go read the Orleans documentation to learn more about virtual actors - but since that is a .NET project and Orbit is merely "inspired" by it, one wouldn't be able to tell which parts are applicable here and which perhaps are not.

    On the whole, there isn't much information on the web regarding the differences between Akka and Orbit other than a couple old discussions on github (linked below). In the context of the JVM world, and this being the lesser known of the two projects, it would perhaps help to increase awareness of the Orbit project if the documentation included a more robust introduction, written with the experienced JVM developer in mind (who is likely already familiar with Akka).

    https://github.com/akkadotnet/akka.net/issues/756

    https://github.com/akka/akka-meta/pull/8

    opened by mertant 1
  • Orbit 2 - Improved diagnostics for silent actor routing failure

    Orbit 2 - Improved diagnostics for silent actor routing failure

    Previously we ran into a bug with Orbit 2 where the client gave no indication that issues were with a particular deployment of the service component in Kubernetes. The observed behavior was that calls would attempt to call the actor but never return and never log an error. The resolution was to delete the deployment of the Orbit 2 server and re-deploy it. This experience brought up the fact that there is insufficient information in logs and metrics to indicate a deployment is in a bad state, why the server is not instantiating an actor, the client isn’t returning, etc. I believe an improvement is needed here in order to greatly reduce the MTTR for these types of issues.

    feature 
    opened by mattdkerr 2
Releases(v2.0.0-alpha.108)
Owner
Orbit
Distributed systems framework for the JVM by @ElectronicArts.
Orbit
Netflix, Inc. 23.1k Jan 5, 2023
APM, (Application Performance Management) tool for large-scale distributed systems.

Visit our official web site for more information and Latest updates on Pinpoint. Latest Release (2020/01/21) We're happy to announce the release of Pi

null 12.5k Dec 29, 2022
Vert.x is a tool-kit for building reactive applications on the JVM

Vert.x Core This is the repository for Vert.x core. Vert.x core contains fairly low-level functionality, including support for HTTP, TCP, file system

Eclipse Vert.x 13.3k Jan 8, 2023
Build highly concurrent, distributed, and resilient message-driven applications on the JVM

Akka We believe that writing correct concurrent & distributed, resilient and elastic applications is too hard. Most of the time it's because we are us

Akka Project 12.6k Jan 3, 2023
Distributed Stream and Batch Processing

What is Jet Jet is an open-source, in-memory, distributed batch and stream processing engine. You can use it to process large volumes of real-time eve

hazelcast 1k Dec 31, 2022
Apache Mesos is a cluster manager that provides efficient resource isolation and sharing across distributed applications, or frameworks

Apache Mesos is a cluster manager that provides efficient resource isolation and sharing across distributed applications, or frameworks. It can run Hadoop, Jenkins, Spark, Aurora, and other frameworks on a dynamically shared pool of nodes.

The Apache Software Foundation 5k Dec 31, 2022
A reactive dataflow engine, a data stream processing framework using Vert.x

?? NeonBee Core NeonBee is an open source reactive dataflow engine, a data stream processing framework using Vert.x. Description NeonBee abstracts mos

SAP 33 Jan 4, 2023
Operating Systems - Concepts of computer operating systems including concurrency, memory management, file systems, multitasking, performance analysis, and security. Offered spring only.

Nachos for Java README Welcome to Nachos for Java. We believe that working in Java rather than C++ will greatly simplify the development process by p

Sabir Kirpal 1 Nov 28, 2021
A reactive Java framework for building fault-tolerant distributed systems

Atomix Website | Javadoc | Slack | Google Group A reactive Java framework for building fault-tolerant distributed systems Please see the website for f

Atomix 2.3k Dec 29, 2022
Netflix, Inc. 23.1k Jan 5, 2023
A Java Virtual Machine - running on a Java Virtual Machine - running on a (jk).

Javaception A Java Virtual Machine - running on a Java Virtual Machine - running on a (jk). Goals JVMS compliant Java Virtual Machine Somewhat fast Re

null 33 Oct 10, 2022
BlackBox is a virtual engine, it can clone and run virtual application on Android

BlackBox is a virtual engine, it can clone and run virtual application on Android, users don't have to install APK file to run the application on devices. BlackBox control all virtual applications, so you can do anything you want by using BlackBox.

null 1.6k Jan 3, 2023
The first Java Actor System supporting fibers from Project Loom

Fibry Fibry is an experimental Actor System built to be simple and flexible. Hopefully, it will also be fun to use. Fibry is the first Java Actor Syst

Luca Venturi 196 Dec 26, 2022
Movie,actor & director RESTful API. Sample app with jpa, flyway and testcontainers

spring-restful-jpa-flyway Movie,actor & director RESTful API. Sample app with jpa, flyway and testcontainers.

null 16 Dec 10, 2022
[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.

Avian - A lightweight Java Virtual Machine (JVM) PLEASE NOTE: This project is not currently being developed, maintained, or supported. Feel free to us

ReadyTalk 1.2k Dec 22, 2022
Kryptokrona Java SDK for building decentralized private communication and payment systems.

Kryptokrona Java SDK Kryptokrona is a decentralized blockchain from the Nordic based on CryptoNote, which forms the basis for Monero, among others. Cr

null 22 Oct 31, 2022
APM, (Application Performance Management) tool for large-scale distributed systems.

Visit our official web site for more information and Latest updates on Pinpoint. Latest Release (2020/01/21) We're happy to announce the release of Pi

null 12.6k Jan 4, 2023
APM, (Application Performance Management) tool for large-scale distributed systems.

Visit our official web site for more information and Latest updates on Pinpoint. Latest Release (2020/01/21) We're happy to announce the release of Pi

null 12.5k Dec 29, 2022
APM, (Application Performance Management) tool for large-scale distributed systems.

Visit our official web site for more information and Latest updates on Pinpoint. Latest Release (2020/01/21) We're happy to announce the release of Pi

null 12.6k Jan 6, 2023
Flights metasearch engine simulation using Java, GraphQL and React.js, developed for COMP30220 Distributed Systems.

Distributed Airways For the full project report, see ./report.pdf. A demonstration video is available here. Requirements Docker JDK 8 and Apache Maven

Rajit Banerjee 3 Dec 29, 2022