Giter VIP home page Giter VIP logo

durabletaskmicroservices's Introduction

DurableTaskMicroservices

Microservice Framework based on Durable Task Framework. A nuget package is available.

Introduction to DurableTaskFramework

The Durable Task Framework is an open source project originally started by Microsoft. It enables you to write orchestrations in pure C# using the .Net framework. By using of this framework, you can implement many kinds of integration projects without of need to use any Enterprise Service Bus product.

Here are the key features of the durable task framework:

  • Definition of code orchestrations in simple C# code
  • Automatic persistence and check-pointing of program state
  • Versioning of orchestrations and activities
  • Async timers, orchestration composition, user aided checkpoints

The framework itself is very light weight and only requires an Azure Service Bus namespace and optionally an Azure Storage account. Running instances of the orchestration and worker nodes are completely hosted by the user. The framework uses a scheduler on top of Azure Service Bus (hosted in Cloud or OnPrem) and it is completely transparent to developer. Developers is not ever required to have any Service Bus know-how.

Introduction to DurableTaskMicroservices

The DurableTaskMicroservices allows you to serialize/deserialize (save/load) orchestrations and tasks.

Why should I use DurableTaskMicroservices?

The idea of DurableTaskMicroservices is to split the host and orchestration/task code. The host loads the assemblies of the orchestrations/tasks and their configuration files. This allows to change running orchestrations without changing the host code, just by replacing the assemblies and the configuration.

  • host and orchestrations decoupling
  • client and host decoupling
  • dynamic loading of orchestrations (with configuration)

Hosts

This repository contains multiple hosts, you can decide which host fits best to your needs. You are free to implement your own host and contribute it via pull request. For more information about hosting, please take a look on this article

Microservice (Orchestrations) loading

This topic explains how the host loads the orchestration assemblies and the configuration.

  1. The WindowsServiceHost searches for all *.config.xml files in the working directory. These files must contain your XML serialized Microservice. For more information about configuration please see: Configuration

  2. Now WindowsServiceHost gets all Types which are used in the Microservices. To do this, the host gets all *.dlls in the working folder and check for the existence of IntegrationAssemblyAttribute.

  3. Then the host starts the TaskHubWorker and create an OrchestrationInstance (if none are running).

WindowsServiceHost

A simple windows service used to host the DurableTaskFramework.

How to Install the Service

The installation process is quite simple. First you should compile the WindowsServiceHost solution and copy the output into the deployment folder (you should create one).

To install the windows service, just run the installservice.ps1. The PowerShell script will guide you trough the install process.

How to Uninstall the service

To uninstall the windows service, just run the uninstallservice.ps1.

Daenet.DurableTaskMicroservices.Common

This library extends the Durable Task Framework with base classes for Orchestrations, Tasks. Furthermore it includes general reusable Tasks and Adapters for SQL and FileSystems.

A nuget package is available.

BaseClasses

There are several BaseClasses, they extend the DurableTask Framework.

OrchestrationBase

OrchestrationBase inherits TaskOrchestration and adds base Logging functionality to an Orchestration.

This includes:

  • Logging Scope with ActivityId
  • Logging Scope with OrchestrationInstanceId

TaskBase

TaskBase inherits TaskActivity and extends it with following features:

  • LogManager initialization (Logging Scopes)
  • Exception logging in case of Task execution throws an exception.

Adapters

Adapters are used to send/receive data from any source to a different source.

ReceiveAdapterBase

ReceiveAdapterBase makes writing adapters for receiving data easier.

Features:

  • build-in method executeValidationRules executes all given (implemented by user) ValidationRuleDescriptor

SendAdapterBase

ReceiveAdapterBase makes writing adapters for sending data easier. It is implemented as an abstract class with a SendData method the user has to implement.

Tasks

The Daenet.DurableTaskMicroservices.Common package includes several ready-to-use Tasks.

DelayTask

The DelayTask delays the execution by using Thread.Sleep.

LoggingTask

The LoggingTask allows you to Log a messages. LoggingTask uses LogManager internal.

durabletaskmicroservices's People

Contributors

hvetter-de avatar ddobric avatar

Stargazers

Roman avatar

Watchers

Moritz Frölich 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.