Giter Site home page Giter Site logo

ijzfan / ray Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raytale/ray

0.0 1.0 0.0 40.87 MB

基于Actor模型构建的最终一致性分布式事件朔源高性能框架。欢迎使用Ray,感受不一样的.Net Core编程体验。

License: Apache License 2.0

C# 100.00%

ray's Introduction

Ray

这是一个集成Actor,Event Sourcing,Eventual consistency的高性能分布式框架(构建分布式集群请参阅:http://dotnet.github.io/orleans/)

案例启动步骤

案例里是一个简单的无事务转账功能

一、安装(mongodb or postgresql or mysql or sqlserver) and (rabbitmq or kafka)。

二、在Ray.Host项目的Program.cs中选择事件持久化方式和EventBus。

    var builder = new SiloHostBuilder()
        .UseConfiguration(config)
        .ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(Account).Assembly).WithReferences())
        .ConfigureServices((context, servicecollection) =>
        {
            //注册postgresql为事件存储库
            servicecollection.AddPostgreSQLStorage(config =>
            {
                config.ConnectionDict.Add("core_event", "Server=127.0.0.1;Port=5432;Database=Ray;User Id=postgres;Password=XXXX;Pooling=true;MaxPoolSize=20;");
            });
            //配置分布式事务管理器(非必须,需要分布式事务才需设置)
            servicecollection.AddPostgreSQLTxStorage(options =>
            {
                options.ConnectionKey = "core_event";
                options.TableName = "Transaction_TemporaryRecord";
            });
            servicecollection.PSQLConfigure();
        })
        .Configure<MongoConfig>(c => c.Connection = "mongodb://127.0.0.1:28888")
        .Configure<RabbitConfig>(c =>
        {
            c.UserName = "admin";
            c.Password = "XXXX";
            c.Hosts = new[] { "127.0.0.1:5672" };
            c.MaxPoolSize = 100;
            c.VirtualHost = "/";
        })
        .ConfigureLogging(logging => logging.AddConsole());

三、修改Ray.Client的配置信息.

    var config = ClientConfiguration.LocalhostSilo();
    var client = new ClientBuilder()
        .UseConfiguration(config)
        .ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(IAccount).Assembly).WithReferences())
        .ConfigureLogging(logging => logging.AddConsole())
        .Build();
    await client.Connect();

四、启动Ray.Host

五、启动Ray.Client

ray's People

Contributors

iericzheng avatar ijzfan avatar johnhao421 avatar lfzm avatar u-less avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.