.net core used Bumblebee set up micro gateway service

Bumblebee is to develop models based on open source http .net core services gateway, after the most recent version of the perfect functional enough to meet the needs of a micro-services gateway. In the micro-services gateway functions it provides an application service load, failover, security control, monitor, track and log processing; only that it is a powerful plug-in extensions, may be different from actual relevant plug-in application development to meet for real business situations It needs.

Project Address: https://github.com/IKende/Bumblebee

 

The main function

  • Service management, may be add the appropriate service application management for business needs
  • Dynamic routing management, you can develop different solutions for different load request path; load adjustment programs have the ability to have more heat, do not need to reboot to complete the related adjustments.
  • Load diversity strategy can be developed in different ways for different load paths and services, including: moving too consistency, weight and load request restrictions.
  • Automatic load fault recovery and migration, the availability of components and services will be a reliable management, dynamic load adjustment strategy based on service availability.
  • Perfect plug-in extension mechanism, can develop such as management, monitoring, logging, and security access and more.
  • Support httpscan develop applications more secure communications services
  • Support windows, linuxand other multi-platform

Use deployment

After a new console application reference component

BeetleX.Bumblebee

Then write the following code

        private static Gateway g;
        static void Main(string[] args)
        {
            g = new Gateway();
            g.HttpOptions(h =>
            {
                h.Port = 80;
            });
            g.SetServer("http://192.168.2.25:9090").AddUrl("*", 0, 0);
            g.SetServer("http://192.168.2.26:9090").AddUrl("*", 0, 0);
            g.Open();
            Console.Read();
        }

The above code is the native 80port to deploy a gateway service, and the request to load http://192.168.2.25:9090and http://192.168.2.26:9090such use is too much trouble, if you want to develop their own special requirements only need to do this.

Citation Manager plug-in

Components Many functions can be introduced into the plug-in extension mode, the following is introduced into a plug-in management, a visual operation performed by the gateway on the plug.

BeetleX.Bumblebee.Configuration

This is a visual gateway management plug-in, as long as you can by references to the plug-in provides management interface to configure the gateway

    class Program
    {
        static Gateway gateway;
        static void Main(string[] args)
        {
            gateway = new Gateway();
            gateway.HttpOptions(o =>
            {
                o.Port = 80;
                o.LogToConsole = true;
                o.LogLevel = BeetleX.EventArgs.LogType.Error;
            });
            gateway.Open();
            gateway.LoadPlugin(typeof(Bumblebee.Configuration.Management).Assembly);
            Console.Read();
        }
    }

Or directly download the compiled version https://github.com/IKende/Bumblebee/blob/master/bin/Bumblebee1.0.2.zip executiondotnet GatewayServer.dll 

After running through the following address to access the management interfacehttp://localhost/__system/bumblebee/ 

 The default username and password adminand 123456, after landing recommended to modify the login password on the configuration page. After entering the landing page basis to monitor gateway 

 

When the service is good and routing configuration, it is possible through the operation of this page to view gateway; includes basic information resources, services, application status and different gateway Urlrequests circumstances. Because of this plug-in is still so perfect functionality provided is not sufficient, but the general configuration and monitoring.

Service Configuration Introduction

 

Service configuration is relatively simple, just need to add in to the service address; Maxrefers to the maximum number of connections a gateway connection to the service, you can configure the maximum number of concurrent connections depending on the application situation; even in the concurrent completion of the maximum number of connections is not occupied cause service abnormal component further assigned a queue for each service, only when the situation after the connection number is assigned and the queue is full will be rejected request.

Routing Configuration Profile

 

According to different Urldifferent loading strategy, policy adjustment will take effect immediately after saving the service does not need to restart the program developed.

Plugin Manager

Is a core plug, the relevant functional components can be accomplished by a secondary expansion plug, comprising the existing management interface is loaded to come through plug (base component does not have a visual management functionality).

Mainly used for plug-in management gateway, to enable, disable, or configure the plug-in information

 

Log Viewer

This is the main gateway to view the log processing, forwarding requests larger than this because the log management plug-in to take over temporarily not achieved, the user can write plug-ins to record detailed logs related API forwarding. 

Performance comparison test (Bumblebee vs Ocelot)

Testing service configuration E3 1230v2 16G windows 2008 Network: 10Gb

Ab testing tools and bombardier

Test code  https://github.com/IKende/Bumblebee/tree/master/BumblebeeVSOcelot

Test content respectively 500, 1000 and 2000 enable the connection request concurrent test

ab test results

bombardier test results

 

Guess you like

Origin www.cnblogs.com/smark/p/11627668.html