service-fabric-stateful

Service Fabric .net core app not .net core

不问归期 提交于 2020-01-25 07:50:07
问题 We are in the process of building an service fabric application and have run into a bit of a issue, whenever you user Visual studio to create a new service fabric app and you specify to use a .Net core app, the app/api that is create is a .Net framework app and not .Net core. <TargetFramework>net452</TargetFramework> Instead of: <TargetFramework>netcoreapp2.0</TargetFramework> Does anyone know the reason for this, or is this intended behavior? Regards 回答1: You need to use the preview tools to

Service Resolver for Stateless Services in Service Fabric

家住魔仙堡 提交于 2020-01-13 06:28:10
问题 I seem to keep getting "Service Not Found" whenever I try to resolve an endpoint for a stateless service. I have tried using the service partition resolver and also the service proxy but they both yield same results. Is there a restriction on Service Fabric or am I misunderstanding how stateless services should be used? I could not find any documentation stating either way. To give more detail on what I am attempting to do. I am building an Api Gateway. The Api Gateway is comprised of

Access Azure Service Fabric stateful service state

拜拜、爱过 提交于 2020-01-04 02:09:07
问题 I have added WebAPI to my stateful serive and want to access StateManager from it (from outside of StatefulService class implementation). What is the best way to do it? Currently I am using a small class for this: internal static class InstanceAccessor { internal static StatefulService ActiveInstance { get; set; } } And put the value inside RunAsync method of the StatefulService : protected override async Task RunAsync(CancellationToken cancellationToken) { InstanceAccessor.ActiveInstance =

What do the EndPoints configure in the ServiceManifest of an Service Fabric Service?

依然范特西╮ 提交于 2020-01-01 19:12:11
问题 We have a Service Fabric Service project with multiple services: Actors, Stateful services and Stateless services combined into one ServiceManifest. Two stateful services did not work: the constructors were called, the communicationlisteners (through remoting) were created, but the RunAsync method was not called. After removing the endpoint listing from the ServiceManifest.xml the services started working again. But now we are left wondering why and how this works. Could someone explain? To

Create key via SQL and C# for partition key

╄→尐↘猪︶ㄣ 提交于 2019-12-25 02:16:43
问题 I have a set of data which has a hierarchy of 3 levels. Each level has a name. I am looking at combining all of these names into a single string then creating a numeric hash that can be used as a hash key for a service fabric stateful service. I have seen lots online about finding data with keys but I am not sure how to actually create them in an efficient way. Ideally I would like a hash that is quick and easy to generate in SQL Server 2017 and C#. Can anyone point me in the right direction,

Forward the cancellation to the right partition

谁说胖子不能爱 提交于 2019-12-24 11:27:16
问题 This question is continuation from previous thread. store cancellation tokens in service fabric services Opened a new thread because answering this question would not be trivial. To summarize what has been discussed regarding cancel a job / task running in particular service in some partition of service fabric: Cancellation Token limitation: Cancellation token works within the service partition and that is the limitation in partition-wise storing the instances, probably the reason why

Service Fabric process isolation for dynamically created services on the same node

走远了吗. 提交于 2019-12-13 18:07:25
问题 I have an SF application type consisting of two service types – stateless WebApi Gateway service type and stateless Worker service type. I am creating one application instance with default Gateway service instance. The Gateway service instance creates Worker service instances dynamically on demand by using code like this (the client variable is the System.Fabric.FabricClient instance): var serviceDescription = new StatefulServiceDescription() { ApplicationName = new Uri("fabric:/Gateway"),

Share queue with two or more stateful services within Service Fabric

核能气质少年 提交于 2019-12-13 08:36:58
问题 Is it possible to share a queue between 2 or more stateful services, or do I need to directly call it via tcp/http to put a message on its own internal queue? For example; say I have my first service that puts an order on a queue based on a condition: public sealed class Service1 : StatefulService { public Service1(StatefulServiceContext context, IReliableStateManagerReplica reliableStateManagerReplica) : base(context, reliableStateManagerReplica) { } protected override async Task RunAsync

Does service fabric create singleton instance for each stateful partition?

老子叫甜甜 提交于 2019-12-11 04:35:01
问题 Say I created a stateful service fabric service with 5 partitions on a 5 node cluster. I see that each node gets 1 partition per node. When I debug the service in VS, I notice that service fabric is creating exactly 5 instances of the stateful service [essentially 1 static instance per partition] across all 5 partitions. No mater how many calls the clients make, there are only 5 instances of this class to serve requests from. Are the following statements true? Any class level member variables

How is data in Reliable Dictionary in Azure Service Fabric persisted to disk

泪湿孤枕 提交于 2019-12-08 13:05:35
问题 How does Azure Reliable Dictionary actually handles data persistence. Is it like SQL which persists mostly all data excepts indexes(i.e. key in our case) on disk or is like hashmap which have everything in memory(i.e. both key and value) and just keeps a backup on disk 回答1: The current implementation of Reliable Collections store the entire set of data in the memory, and a copy serialized in the disk. It is required to stay in memory because the data stored in the disks are serialized and a