GithubHelp home page GithubHelp logo

persi12 / hangfire.mongo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gottscj/hangfire.mongo

0.0 1.0 1.0 5.31 MB

Mongo DB support for Hangfire

License: MIT License

Batchfile 0.03% PowerShell 2.52% C# 55.15% CSS 0.10% ASP 0.02% JavaScript 42.18%

hangfire.mongo's Introduction

Hangfire.Mongo

Build status Nuget version

MongoDB support for Hangfire library. By using this library you can store all jobs information in MongoDB.

Installation

To install Hangfire MongoDB Storage, run the following command in the Nuget Package Manager Console:

PM> Install-Package HangFire.Mongo

Usage

public void Configuration(IAppBuilder app)
{
    GlobalConfiguration.Configuration.UseMongoStorage("<connection string>", "<database name>");

    app.UseHangfireServer();
    app.UseHangfireDashboard();
}

For example:

public void Configuration(IAppBuilder app)
{
    GlobalConfiguration.Configuration.UseMongoStorage("mongodb://localhost", "ApplicationDatabase");

    app.UseHangfireServer();
    app.UseHangfireDashboard();
}

Custom collections prefix

To use custom prefix for collections names specify it on Hangfire setup:

public void Configuration(IAppBuilder app)
{
    GlobalConfiguration.Configuration.UseMongoStorage("<connection string>", "<database name>",
        new MongoStorageOptions { Prefix = "custom" } );

    app.UseHangfireServer();
    app.UseHangfireDashboard();
}

Custom Mongo DB settings

To use custom Mongo DB connection settings you can use MongoClientSettings object from Mongo DB driver package. In this case just use it instead of passing connection string when you configure your storage.

public void Configuration(IAppBuilder app)
{
    GlobalConfiguration.Configuration.UseMongoStorage(new MongoClientSettings()
            {
                // ...
                IPv6 = true
            }, "ApplicationDatabase");

    app.UseHangfireServer();
    app.UseHangfireDashboard();
}

Contrubutors

License

Hangfire.Mongo is released under the MIT License.

hangfire.mongo's People

Contributors

brantw avatar briangweber avatar gottscj avatar imperugo avatar kkolstad avatar marloe avatar mdymel avatar odinserj avatar persi12 avatar peterdamm avatar sergeyzwezdin avatar tristal avatar

Watchers

 avatar

Forkers

juneeighteen

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.