GithubHelp home page GithubHelp logo

5280software / service-fabric-dotnet-getting-started Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/service-fabric-dotnet-getting-started

0.0 3.0 0.0 252 KB

Get started with Service Fabric with these simple introductory sample projects.

License: MIT License

C# 71.87% HTML 7.75% JavaScript 4.40% PowerShell 14.00% CSS 1.98%

service-fabric-dotnet-getting-started's Introduction

services platforms author
service-fabric
dotnet
seanmck

Service Fabric Getting Started Samples

This repository contains a set of simple sample projects to help you get started with Service Fabric. If you are looking for larger samples, please take a look at some of the other Service Fabric samples available in the Azure samples gallery.

How the samples are organized

The samples are divided by the category and Service Fabric programming model that they focus on: Reliable Actors, Reliable Services, custom application orchestration, and Service Fabric management tasks. Note that most real applications will include a mixture of the concepts and programming models so once you have reviewed these samples, you are encouraged to look at the more complex samples which combine the two frameworks.

Actor samples

VoicemailBox

VoicemailBox provides an example of a simple actor, representing a voicemail account. The actor interface defines methods for adding, deleting, and querying messages and for managing the account's greeting. The application includes a web UI accessible at http://<clusteraddress>:8081/voicemailbox/ and a set of web APIs that can be used to interact with the actor methods.

VisualObjects

The VisualObjects sample provides a visual representation of how actors provide full encapsulation of behavior and state.

It also provides a clear demonstration of how Service Fabric performs rolling upgrades as the behavior of the shapes can be seen to gradually change as the upgrade proceeds across the upgrade domains in the cluster. To see how to perform a rolling upgrade using the Visual Objects sample, see the application upgrade tutorial.

Important note: The VisualObjects web service depends on two JavaScript files that are not directly included in the sample due the licensing restrictions. Follow the instructions in the Readme to learn how to set up the sample.

Service Samples

Chatter

Chatter is a single-room chat application. It includes a web UI built in ASP.NET 5 and accessible at http://<clusteraddress>:8081/Chatter/. User messages are sent to a stateful service for persistence.

WordCount

WordCount provides an introduction to using reliable collections and to partitioning stateful services. A client-side JavaScript function generates random five-character strings, which are then sent to the application via an ASP.NET WebAPI to be counted. The stateless web service resolves the endpoint for the stateful service's partition based on the first character of the string. The stateful service maintains a backlog of words to count in a ReliableQueue and then keeps track of their count in a ReliableDictionary. The total count, plus a per-partition count, are shown in the web UI at http://<clusteraddress>:8081/WordCount/.

Custom Application Samples

SimpleApplication

The simple custom application sample shows how to take an arbitrary EXE that is not built on Actors, Services, or any Service Fabric APIs and deploy it to a Service Fabric cluster. The EXE it uses is SimpleWebServer.exe, which is a simple web server that listens on port 8080 and returns the machine name based on a query string parameter.

Management Samples

ClusterMonitor

ClusterMonitor shows how to use the REST APIs provided by Service Fabric to query the state of the cluster and its running applications. It is also useful as a tool for learning how concepts like partitioning and failover work. The application's web UI is accessible at http://<clusteraddress>:8081/ClusterMonitor/ and shows the cluster with all deployed replicas represented within the node that is currently hosting them.

To see how Service Fabric automatically rebalances replicas in the cluster when a node fails, do the following:

  1. Deploy an application to your cluster. This could be a sample application or one you have built.
  2. Deploy the ClusterMonitor sample.
  3. Launch Service Fabric Explorer by navigating to http://<clusteraddress>:19080/Explorer.
  4. Choose a node and click Actions > Deactivate (Restart).

Deploying the samples

With the exception of VisualObjects, which requires a small amount of setup, all of the samples can be loaded and deployed immediately using Visual Studio. To deploy on the local cluster, you can simply hit F5 to debug the sample. If you'd like to try publishing the sample to an Azure cluster:

  1. Right-click on the application project in Solution Explorer and choose Publish.
  2. Sign-in to the Microsoft account associated with your Azure subscription.
  3. Choose the cluster you'd like to deploy to.

More information

The Service Fabric documentation includes a rich set of tutorials and conceptual articles, which serve as a good complement to the samples.

service-fabric-dotnet-getting-started's People

Contributors

acomsmpbot avatar seanmck avatar vturecek avatar

Watchers

 avatar  avatar  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.