ASP. NET Core

Source: Internet
Author: User
Tags install brew redis desktop manager install redis brew cask

Hangfire official support for MSSQL and Redis two kinds of, of course, can also use third-party to support Mysql,postgresql,mongo, etc.
Installing Redis
sudo apt-get install Software-properties-common
sudo add-apt-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install Redis-server
PS aux | grep Redis
sudo service redis-server restart
sudo apt-get remove Redis-server
Redis-cli








Redis Desktop Manager installed under MAC (official Mac version only supports source recompilation)
#install Brew Cask
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null
# Install Redis Desktop Manager
brew cask install rdm

ASP. NET Core Integrated Hangfire
Hangfire.pro is an extension of hangfire, using its own Nuget source, Hangfire.Pro.Redis is one of the extensions; I'm here to use the Hangfire.Redis.StackExchange to basically meet the needs.
Add package<packagereference include= "Hangfire.aspnetcore" version= "1.6.12"/><packagereference Include= " Hangfire.Redis.StackExchange.StrongName "version=" 1.7.0 "/><packagereference include=" StackExchange.Redis.StrongName "version=" 1.2.3 "/> Configuration Hangfire Service
  Public classStartup { PublicIconfigurationroot Configuration {Get; }  Public StaticConnectionmultiplexer Redis;  PublicStartup (ihostingenvironment env) {varBuilder =NewConfigurationbuilder (). Setbasepath (env. Contentrootpath). Addjsonfile ("Appsettings.json", Optional:false, Reloadonchange:true)                            . Addjsonfile ($"appsettings. {env. Environmentname}.json", Optional:true)                            .            Addenvironmentvariables (); Configuration=Builder.            Build (); Redis= Connectionmultiplexer.connect (Configuration.getconnectionstring ("Redis")); }        //This method gets called by the runtime. Use this method to add services to the container.         Public voidconfigureservices (iservicecollection services) {services.            AddOptions (); //CustomConfigurationServices. Configure<dbsetting> (Configuration.getsection ("ConnectionStrings")); //return capitalization issuesServices. Addmvc (). Addjsonoptions (OP= = Op. Serializersettings.contractresolver =NewNewtonsoft.Json.Serialization.DefaultContractResolver ()); //Inject Hangfire serviceServices. Addhangfire (config =CONFIG.          Useredisstorage (Redis)); }        //This method gets called by the runtime. Use this method to configure the HTTP request pipeline.         Public voidConfigure (Iapplicationbuilder app, Ihostingenvironment env, iloggerfactory loggerfactory) {Loggerf Actory. Addconsole (Configuration.getsection ("Logging"));            Loggerfactory.adddebug (); if(env. Isdevelopment ()) {app.                Usedeveloperexceptionpage (); App.            Usebrowserlink (); }            Else{app. Useexceptionhandler ("/home/error"); } app.                        Usestaticfiles (); App.            Usehangfireserver (); App.            Usehangfiredashboard (); App. USEMVC (Routes={routes. MapRoute (Name:"default", Template:"{controller=hq}/{action=index}/{id?}");        }); }    }

Https://github.com/marcoCasamento/Hangfire.Redis.StackExchange
Http://docs.hangfire.io/en/latest/configuration/using-redis.html

ASP. NET Core

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.