Releases: TsuyoshiUshio/AzureServiceFabricSample
TicTacToe 1.0.2
I edit Game code. I wrote some wrong code related async/await. Please refer this version.
TicTacToe 1.0.1
Writing a UnitTest for TicTacToe 1.0.1
Don't forget to change the Test > Test Settings > Default Processor Architecture > X64
** Sorry, I wrote wrong code related async/await. Please refer the next version. **
BadApplication v1.0.0
Chaos Testing and Failover
ConfigurationUpdate v1.0.0
You may change something. If you want to get a proper result, you need to add the additional code in while loop.
protected override async Task RunAsync(CancellationToken cancellationToken)
{
int incrementStep = 1;
long iterations = 0;
while (true)
{
cancellationToken.ThrowIfCancellationRequested();
var configSection = this.Context.CodePackageActivationContext.GetConfigurationPackageObject("Config");
var text = configSection.Settings.Sections["MyConfigSection"]
.Parameters["IncrementStep"].Value;
incrementStep = int.Parse(text);
ServiceEventSource.Current.ServiceMessage(this, "Working-{0}", iterations += incrementStep);
await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
}
}
NodeJSHelloWorldApplication v1.0.0
You can deploy this application to ServiceFabricCluster using Deploy.ps1
As Haishi mentioned, it doesn't work (See P116 Assumptions and known issues)
However, you can see the deployment works well.
Also you may need to change Deploy.ps1 according to your environment. (ServiceFabric Cluster directory)
ConsoleRedirect 1.0.1
Adding DataPackage.
You need to replace this.ServiceInitializationParameters to this.Context of ConsolRedirect.cs
You won't have any problem however, the first time, when I publish this code, I'd got an error "TestData" can't find.
After versioning up of ConfigPackage / DataPackage, it seems to work. Now works fine.
I guess "ConsoleRedirectPkg.Manifest.1.0.1" was on the ServiceFabric cluster. However, DataPackage starts with
1.0.0. The first time, Config/Data package didn't copied because they are v1.0.0. after upgrading over1.0.1 it worked. This is just my guess.
ConsoleRedirect 1.0.0
Chapter 5 Console Redirect 1.0.0
The code of the book works fine. However, we have a pitfall.
The batch file(cmd)'s default character encoding is different from Visual Studio.
If you create cmd file via Visual Studio, it might be UTF-8 with BOM. In Japan, cmd's character encoding default is Shift_JIS.
The cmd will execute in Shift_JIS. Please check your default encoding of batch files of your country.
TicTacToe 1.0.0
Chapter 04 Tic Tac Toe application.
Actor model has been modified.
- the.State -> this.StateManager
- StatefulActor, StatelessActor -> Actor. StatePersistence is defined by annotation.
Simple Store Application 1.0.2
Applied a change for Named Partition.
You need to delete the old service before deploying this version. If you change the base params of ApplicationManifest.xml, you should remove the service.
Simple Store Application 1.0.0
Chapter 03. Stateful Service Example. The Simple Store Service / Client.
Note: I need to add IAsyncEnumerableExtensions class for converting IReliableDictionary into Enumerable.
See IAsyncEnumerableExtensions comment.