Commit 953e7cd3 authored by mohammad.salama's avatar mohammad.salama

Added Parsing for appsetting.json for all and added the setting we want,...

Added Parsing for appsetting.json for all and added the setting we want, compiled correctly, not yet tested, and not called for parsing
parent dfd16aa5
...@@ -6,7 +6,7 @@ using System.Linq; ...@@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MessagesConsumer.Extractor namespace FinalMessagesConsumer.Extractor
{ {
public class Extractor public class Extractor
{ {
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-FinalMessagesConsumer-C27D36D8-44DD-48C5-BC19-18A03CCAEAF1</UserSecretsId>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CSRedisCore" Version="3.8.803" /> <PackageReference Include="CSRedisCore" Version="3.8.803" />
<PackageReference Include="StackExchange.Redis" Version="2.8.0" /> <PackageReference Include="StackExchange.Redis" Version="2.8.0" />
......

namespace FinalMessagesConsumer.Initializer
{
public class Initializer
{
public static void init(ref IConfiguration conf)
{
RedisInfoParser.setInfo(ref conf);
ProvidersInfoParser.setInfo(ref conf);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FinalMessagesConsumer.Initializer
{
public class ProvidersInfoParser
{
public static string MTN = "";
public static string Syriatel = "";
public static int mtn_rate = 0;
public static int syr_rate = 0;
public static void setInfo(ref IConfiguration config)
{
var syr_sect = config.GetSection("RedisInfo").GetSection("Providors").GetSection("Syriatel");
var mtn_sect = config.GetSection("RedisInfo").GetSection("Providors").GetSection("MTN");
string? stag = syr_sect.GetSection("Tag").Value;
string? srate = syr_sect.GetSection("sms_rate").Value;
string? mtag = mtn_sect.GetSection("Tag").Value;
string? mrate = mtn_sect.GetSection("sms_rate").Value;
if (stag == null || srate == null || mtag == null || mrate == null)
{
throw new ArgumentException("Providers Full Info (Names(Tags) + Sms_Rate) Not Defined in appsettings.json");
}
MTN = mtag;
Syriatel = stag;
mtn_rate = int.Parse(mrate);
syr_rate = int.Parse(srate);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FinalMessagesConsumer.Initializer
{
public class ReadRedisInfoParser
{
public static string connection = "";
public static string consumer_id = "";
public static void setInfo(ref IConfiguration config)
{
var sect = config.GetSection("RedisInfo").GetSection("Read");
string? conn = sect.GetSection("Connection").Value;
string? id = sect.GetSection("ConsumerID").Value;
if (conn == null || id == null)
{
throw new ArgumentException("Read Redis Full Info (connection + consumer id) Not Defined in appsettings.json");
}
connection = conn;
consumer_id = id;
}
}
}
namespace FinalMessagesConsumer.Initializer
{
public class RedisInfoParser
{
public static void setInfo(ref IConfiguration config)
{
ReadRedisInfoParser.setInfo(ref config);
/*
Write Consumer Groups Are The Same As Providers
*/
}
}
}
...@@ -4,7 +4,7 @@ using System.Linq; ...@@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace PriorityStream namespace FinalMessagesConsumer
{ {
public class MessageDTO public class MessageDTO
{ {
......
using FinalMessagesConsumer;
using FinalMessagesConsumer.StreamsHandler;
IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices(services =>
{
services.AddHostedService<Worker>();
})
.Build();
string redis_read = "localhost:6400";
try
{
TotalWorker.setAll(redis_read);
}
catch (Exception ex)
{
return;
}
await host.RunAsync();
{
"profiles": {
"FinalMessagesConsumer": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
}
}
}
...@@ -5,7 +5,7 @@ using System.Linq; ...@@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MessagesConsumer.StreamsHandler namespace FinalMessagesConsumer.StreamsHandler
{ {
public class TotalWorker public class TotalWorker
{ {
......
using FinalMessagesConsumer.StreamsHandler;
namespace FinalMessagesConsumer
{
public class Worker : BackgroundService
{
private readonly ILogger<Worker> _logger;
public Worker(ILogger<Worker> logger)
{
_logger = logger;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
string[] provs = new string[] { "MTN", "SYR" };
int turn = 0;
while (true)
{
TotalWorker.work(provs[turn]);
turn ^= 1;
//Console.WriteLine("\n\n\n\n");
TotalWorker.work(provs[turn]);
turn ^= 1;
//Console.WriteLine("**************************************************");
await Task.Delay(1000);
}
}
}
}
\ No newline at end of file
...@@ -6,7 +6,7 @@ using System.Linq; ...@@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MessagesConsumer.Writer namespace FinalMessagesConsumer.Writer
{ {
public class Writer public class Writer
{ {
......
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"RedisInfo": {
"Read": {
"Connection": "localhost:6400",
"ConsumerID": "cons-1"
},
"Providors": {
"Syriatel": {
"Tag": "SYR",
"sms_rate": 100
},
"MTN": {
"Tag": "MTN",
"sms_rate": 100
}
}
}
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"RedisInfo": {
"Read": {
"Connection": "localhost:6400",
"ConsumerID": "cons-1"
},
"Providors": {
"Syriatel": {
"Tag": "SYR",
"sms_rate": 100
},
"MTN": {
"Tag": "MTN",
"sms_rate": 100
}
}
}
}
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
using System; using System;
using System.Reflection; using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("MessagesConsumer")] [assembly: System.Reflection.AssemblyCompanyAttribute("FinalMessagesConsumer")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("MessagesConsumer")] [assembly: System.Reflection.AssemblyProductAttribute("FinalMessagesConsumer")]
[assembly: System.Reflection.AssemblyTitleAttribute("MessagesConsumer")] [assembly: System.Reflection.AssemblyTitleAttribute("FinalMessagesConsumer")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class. // Generated by the MSBuild WriteCodeFragment class.
......
...@@ -6,5 +6,5 @@ build_property.ProjectTypeGuids = ...@@ -6,5 +6,5 @@ build_property.ProjectTypeGuids =
build_property.InvariantGlobalization = build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly = build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = MessagesConsumer build_property.RootNamespace = FinalMessagesConsumer
build_property.ProjectDir = D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\MessagesConsumer\ build_property.ProjectDir = D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\
// <auto-generated/> // <auto-generated/>
global using global::Microsoft.Extensions.Configuration;
global using global::Microsoft.Extensions.DependencyInjection;
global using global::Microsoft.Extensions.Hosting;
global using global::Microsoft.Extensions.Logging;
global using global::System; global using global::System;
global using global::System.Collections.Generic; global using global::System.Collections.Generic;
global using global::System.IO; global using global::System.IO;
......
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\appsettings.Development.json
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\appsettings.json
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\FinalMessagesConsumer.exe
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\FinalMessagesConsumer.deps.json
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\FinalMessagesConsumer.runtimeconfig.json
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\FinalMessagesConsumer.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\ref\FinalMessagesConsumer.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\FinalMessagesConsumer.pdb
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\CSRedisCore.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Configuration.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Configuration.Abstractions.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Configuration.Binder.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Configuration.CommandLine.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Configuration.FileExtensions.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Configuration.Json.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Configuration.UserSecrets.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.DependencyInjection.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.FileProviders.Abstractions.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.FileProviders.Physical.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.FileSystemGlobbing.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Hosting.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Hosting.Abstractions.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Logging.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Logging.Abstractions.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Logging.Configuration.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Logging.Console.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Logging.Debug.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Logging.EventLog.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Logging.EventSource.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Options.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Microsoft.Extensions.Primitives.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Newtonsoft.Json.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\Pipelines.Sockets.Unofficial.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\StackExchange.Redis.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\System.Diagnostics.EventLog.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\System.IO.Pipelines.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Diagnostics.EventLog.Messages.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Diagnostics.EventLog.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.csproj.AssemblyReference.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.GeneratedMSBuildEditorConfig.editorconfig
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.AssemblyInfoInputs.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.AssemblyInfo.cs
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.csproj.CoreCompileInputs.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.csproj.CopyComplete
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\ref\FinalMessagesConsumer.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.pdb
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\FinalMessagesConsumer\obj\Debug\net6.0\FinalMessagesConsumer.genruntimeconfig.cache
{ {
"format": 1, "format": 1,
"restore": { "restore": {
"D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\PriorityStream\\PriorityStream.csproj": {} "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\FinalMessagesConsumer\\FinalMessagesConsumer.csproj": {}
}, },
"projects": { "projects": {
"D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\PriorityStream\\PriorityStream.csproj": { "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\FinalMessagesConsumer\\FinalMessagesConsumer.csproj": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\PriorityStream\\PriorityStream.csproj", "projectUniqueName": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\FinalMessagesConsumer\\FinalMessagesConsumer.csproj",
"projectName": "PriorityStream", "projectName": "FinalMessagesConsumer",
"projectPath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\PriorityStream\\PriorityStream.csproj", "projectPath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\FinalMessagesConsumer\\FinalMessagesConsumer.csproj",
"packagesPath": "C:\\Users\\moham\\.nuget\\packages\\", "packagesPath": "C:\\Users\\moham\\.nuget\\packages\\",
"outputPath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\PriorityStream\\obj\\", "outputPath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\FinalMessagesConsumer\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
"target": "Package", "target": "Package",
"version": "[3.8.803, )" "version": "[3.8.803, )"
}, },
"Microsoft.Extensions.Hosting": {
"target": "Package",
"version": "[6.0.0, )"
},
"StackExchange.Redis": { "StackExchange.Redis": {
"target": "Package", "target": "Package",
"version": "[2.8.0, )" "version": "[2.8.0, )"
......
This diff is collapsed.
{
"version": 2,
"dgSpecHash": "wvum4EwPcM7MkldOBPVFjTAPZ88ToqYnYGOQf47xqysv+nhIqqB5b/B8QLbB9XyM7WAovuJGpC9/qZAxbloNCQ==",
"success": true,
"projectFilePath": "D:\\HIAST\\FIY\\Project-MSGPriorityQ\\GrpcMessage\\message-priority-queue\\FinalMessagesConsumer\\FinalMessagesConsumer.csproj",
"expectedPackageFiles": [
"C:\\Users\\moham\\.nuget\\packages\\csrediscore\\3.8.803\\csrediscore.3.8.803.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.configuration\\6.0.0\\microsoft.extensions.configuration.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.configuration.abstractions\\6.0.0\\microsoft.extensions.configuration.abstractions.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.configuration.binder\\6.0.0\\microsoft.extensions.configuration.binder.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.configuration.commandline\\6.0.0\\microsoft.extensions.configuration.commandline.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.configuration.environmentvariables\\6.0.0\\microsoft.extensions.configuration.environmentvariables.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.configuration.fileextensions\\6.0.0\\microsoft.extensions.configuration.fileextensions.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.configuration.json\\6.0.0\\microsoft.extensions.configuration.json.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.configuration.usersecrets\\6.0.0\\microsoft.extensions.configuration.usersecrets.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.dependencyinjection\\6.0.0\\microsoft.extensions.dependencyinjection.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\6.0.0\\microsoft.extensions.dependencyinjection.abstractions.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.fileproviders.abstractions\\6.0.0\\microsoft.extensions.fileproviders.abstractions.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.fileproviders.physical\\6.0.0\\microsoft.extensions.fileproviders.physical.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.filesystemglobbing\\6.0.0\\microsoft.extensions.filesystemglobbing.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.hosting\\6.0.0\\microsoft.extensions.hosting.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.hosting.abstractions\\6.0.0\\microsoft.extensions.hosting.abstractions.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.logging\\6.0.0\\microsoft.extensions.logging.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\6.0.0\\microsoft.extensions.logging.abstractions.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.logging.configuration\\6.0.0\\microsoft.extensions.logging.configuration.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.logging.console\\6.0.0\\microsoft.extensions.logging.console.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.logging.debug\\6.0.0\\microsoft.extensions.logging.debug.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.logging.eventlog\\6.0.0\\microsoft.extensions.logging.eventlog.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.logging.eventsource\\6.0.0\\microsoft.extensions.logging.eventsource.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.options\\6.0.0\\microsoft.extensions.options.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.options.configurationextensions\\6.0.0\\microsoft.extensions.options.configurationextensions.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\microsoft.extensions.primitives\\6.0.0\\microsoft.extensions.primitives.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\newtonsoft.json\\13.0.1\\newtonsoft.json.13.0.1.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\pipelines.sockets.unofficial\\2.2.8\\pipelines.sockets.unofficial.2.2.8.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\stackexchange.redis\\2.8.0\\stackexchange.redis.2.8.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\system.diagnostics.diagnosticsource\\6.0.0\\system.diagnostics.diagnosticsource.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\system.diagnostics.eventlog\\6.0.0\\system.diagnostics.eventlog.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\system.io.pipelines\\5.0.1\\system.io.pipelines.5.0.1.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\6.0.0\\system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\system.text.encodings.web\\6.0.0\\system.text.encodings.web.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\system.text.json\\6.0.0\\system.text.json.6.0.0.nupkg.sha512",
"C:\\Users\\moham\\.nuget\\packages\\system.valuetuple\\4.5.0\\system.valuetuple.4.5.0.nupkg.sha512"
],
"logs": []
}
\ No newline at end of file
namespace GrpcMessageNode.Initializer
{
public class Initializer
{
public static void init(ref IConfiguration conf)
{
ServiceNameParser.setServiceName(ref conf);
}
}
}
using Microsoft.Extensions.Options;
namespace GrpcMessageNode.Initializer
{
public class ServiceNameParser
{
public static string serviceName = "";
public static void setServiceName(ref IConfiguration config)
{
string? name = config.GetSection("OpenTelemetry").GetSection("ServiceName").Value;
if (name == null)
{
throw new ArgumentException("Service Name Not Defined in appsettings.json");
}
serviceName = name;
}
}
}
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
} }
}, },
"OpenTelemetry": { "OpenTelemetry": {
"ServiceName": "grpc-message-node-1",
"Tracing": { "Tracing": {
"Exporter": { "Exporter": {
"Jaeger": { "Jaeger": {
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
} }
}, },
"OpenTelemetry": { "OpenTelemetry": {
"ServiceName": "grpc-message-node-1",
"Tracing": { "Tracing": {
"Exporter": { "Exporter": {
"Jaeger": { "Jaeger": {
......
aa3bc6662559c22097c59fa97316d5d4b319e7bd fa78f0a389719867f82ac67f314e712ce019d73e
...@@ -100,7 +100,6 @@ D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage ...@@ -100,7 +100,6 @@ D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\bin\Debug\net6.0\Swashbuckle.AspNetCore.SwaggerUI.dll D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\bin\Debug\net6.0\Swashbuckle.AspNetCore.SwaggerUI.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\bin\Debug\net6.0\System.Diagnostics.DiagnosticSource.dll D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\bin\Debug\net6.0\System.Diagnostics.DiagnosticSource.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\bin\Debug\net6.0\System.Reflection.MetadataLoadContext.dll D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\bin\Debug\net6.0\System.Reflection.MetadataLoadContext.dll
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\obj\Debug\net6.0\GrpcMessageNode.csproj.AssemblyReference.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\obj\Debug\net6.0\GrpcMessageNode.GeneratedMSBuildEditorConfig.editorconfig D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\obj\Debug\net6.0\GrpcMessageNode.GeneratedMSBuildEditorConfig.editorconfig
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\obj\Debug\net6.0\GrpcMessageNode.AssemblyInfoInputs.cache D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\obj\Debug\net6.0\GrpcMessageNode.AssemblyInfoInputs.cache
D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\obj\Debug\net6.0\GrpcMessageNode.AssemblyInfo.cs D:\HIAST\FIY\Project-MSGPriorityQ\GrpcMessage\message-priority-queue\GrpcMessage\obj\Debug\net6.0\GrpcMessageNode.AssemblyInfo.cs
......
...@@ -58,3 +58,4 @@ ...@@ -58,3 +58,4 @@
2.0 2.0
2.0 2.0
2.0 2.0
2.0
...@@ -15,11 +15,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HTTPMessageGenerator", "HTT ...@@ -15,11 +15,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HTTPMessageGenerator", "HTT
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Validator", "Validator\Validator.csproj", "{D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Validator", "Validator\Validator.csproj", "{D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PriorityStream", "PriorityStream\PriorityStream.csproj", "{4F286608-7770-4511-BF37-2B94F5351D42}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScheduledMessagesHandler", "ScheduledMessagesHandler\ScheduledMessagesHandler.csproj", "{62D17724-6487-4586-9F2F-C2C0175280A5}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagesConsumer", "MessagesConsumer\MessagesConsumer.csproj", "{EA05977F-A221-49AF-99EA-2086C63E8FB1}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PriorityStreamsExtractor", "PriorityStreamsExtractor\PriorityStreamsExtractor.csproj", "{FD51E864-BF79-4D63-A31C-D017C0239C3A}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScheduledMessagesHandler", "ScheduledMessagesHandler\ScheduledMessagesHandler.csproj", "{62D17724-6487-4586-9F2F-C2C0175280A5}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FinalMessagesConsumer", "FinalMessagesConsumer\FinalMessagesConsumer.csproj", "{8F0B7AED-41D9-4326-A17C-89057E166331}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
...@@ -51,18 +51,18 @@ Global ...@@ -51,18 +51,18 @@ Global
{D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}.Release|Any CPU.ActiveCfg = Release|Any CPU {D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}.Release|Any CPU.Build.0 = Release|Any CPU {D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}.Release|Any CPU.Build.0 = Release|Any CPU
{4F286608-7770-4511-BF37-2B94F5351D42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F286608-7770-4511-BF37-2B94F5351D42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F286608-7770-4511-BF37-2B94F5351D42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F286608-7770-4511-BF37-2B94F5351D42}.Release|Any CPU.Build.0 = Release|Any CPU
{EA05977F-A221-49AF-99EA-2086C63E8FB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA05977F-A221-49AF-99EA-2086C63E8FB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA05977F-A221-49AF-99EA-2086C63E8FB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA05977F-A221-49AF-99EA-2086C63E8FB1}.Release|Any CPU.Build.0 = Release|Any CPU
{62D17724-6487-4586-9F2F-C2C0175280A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {62D17724-6487-4586-9F2F-C2C0175280A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62D17724-6487-4586-9F2F-C2C0175280A5}.Debug|Any CPU.Build.0 = Debug|Any CPU {62D17724-6487-4586-9F2F-C2C0175280A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62D17724-6487-4586-9F2F-C2C0175280A5}.Release|Any CPU.ActiveCfg = Release|Any CPU {62D17724-6487-4586-9F2F-C2C0175280A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62D17724-6487-4586-9F2F-C2C0175280A5}.Release|Any CPU.Build.0 = Release|Any CPU {62D17724-6487-4586-9F2F-C2C0175280A5}.Release|Any CPU.Build.0 = Release|Any CPU
{FD51E864-BF79-4D63-A31C-D017C0239C3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD51E864-BF79-4D63-A31C-D017C0239C3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD51E864-BF79-4D63-A31C-D017C0239C3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD51E864-BF79-4D63-A31C-D017C0239C3A}.Release|Any CPU.Build.0 = Release|Any CPU
{8F0B7AED-41D9-4326-A17C-89057E166331}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F0B7AED-41D9-4326-A17C-89057E166331}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F0B7AED-41D9-4326-A17C-89057E166331}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F0B7AED-41D9-4326-A17C-89057E166331}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
namespace HTTPMessageNode.Initializer
{
public class Initializer
{
public static void init(ref IConfiguration conf)
{
ServiceNameParser.setServiceName(ref conf);
}
}
}
using Microsoft.Extensions.Options;
namespace HTTPMessageNode.Initializer
{
public class ServiceNameParser
{
public static string serviceName = "";
public static void setServiceName(ref IConfiguration config)
{
string? name = config.GetSection("OpenTelemetry").GetSection("ServiceName").Value;
if (name == null)
{
throw new ArgumentException("Service Name Not Defined in appsettings.json");
}
serviceName = name;
}
}
}
...@@ -10,9 +10,7 @@ ...@@ -10,9 +10,7 @@
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
}, },
"database": {
"conn": "localhost:27017"
},
"eureka": { "eureka": {
"client": { "client": {
"serviceUrl": "http://localhost:8761/eureka/", "serviceUrl": "http://localhost:8761/eureka/",
...@@ -24,6 +22,7 @@ ...@@ -24,6 +22,7 @@
}, },
"OpenTelemetry": { "OpenTelemetry": {
"ServiceName": "http-message-node-1",
"Tracing": { "Tracing": {
"Exporter": { "Exporter": {
"Jaeger": { "Jaeger": {
......
...@@ -10,9 +10,7 @@ ...@@ -10,9 +10,7 @@
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
}, },
"database": {
"conn": "localhost:27017"
},
"eureka": { "eureka": {
"client": { "client": {
"serviceUrl": "http://localhost:8761/eureka/", "serviceUrl": "http://localhost:8761/eureka/",
...@@ -24,6 +22,7 @@ ...@@ -24,6 +22,7 @@
}, },
"OpenTelemetry": { "OpenTelemetry": {
"ServiceName": "http-message-node-1",
"Tracing": { "Tracing": {
"Exporter": { "Exporter": {
"Jaeger": { "Jaeger": {
......
7d7c46e0556bfc1c8ac0f370e64d88714cb762d7 dbd36804e78adf3cfa151ee458ab4f91ac9794df
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment