Commit 9dacc922 authored by mohammad.salama's avatar mohammad.salama

Validator Service added - no DB for it yet , All clients are sending and receiving correctly

parent 7b9e1709
......@@ -45,7 +45,27 @@
"ProjectGuid": "79a276e9-da51-4434-9241-a0f8e6771232",
"DisplayName": "HTTPMessageNode",
"ColorIndex": 7
},
"79828c38-a68b-4340-9f93-d55c5dcc203a": {
"ProjectGuid": "79828c38-a68b-4340-9f93-d55c5dcc203a",
"DisplayName": "HTTPMessageNode",
"ColorIndex": 8
},
"c008aeeb-fd9f-4d59-b047-a77bd058c12f": {
"ProjectGuid": "c008aeeb-fd9f-4d59-b047-a77bd058c12f",
"DisplayName": "HTTPMessageGenerator",
"ColorIndex": 9
},
"8b5aab7b-c390-40d2-837b-053ede2a4bec": {
"ProjectGuid": "8b5aab7b-c390-40d2-837b-053ede2a4bec",
"DisplayName": "ttt",
"ColorIndex": 10
},
"d2c3addd-ba47-473c-a761-1ce5b1ee6407": {
"ProjectGuid": "d2c3addd-ba47-473c-a761-1ce5b1ee6407",
"DisplayName": "Validator",
"ColorIndex": 11
}
},
"NextColorIndex": 8
"NextColorIndex": 12
}
\ No newline at end of file

using GrpcMessageNode.DataBaseAccess;
using Grpc.Net.Client;
namespace GrpcMessageNode.DataBaseAccess
{
public static class DBAccess
public class DBAccess
{
/// <summary>
/// this class encapsulates MessageStorage and ProcessMessage classed and through it
/// we access them as a type of layering
/// check message for tag , Authentication , Quota perhaps from service validator with address
/// passed as a parameter to the function
/// </summary>
private static string messageStorageURL = "db that stores messagees";
private static string accountStorageURL = "db that holds information about account + quota";
/// <param name="message" > the message we received to check</param>
/// <param name="validatorAddress"> The validator service address which as a mongodb service </param>
/// <returns> validator reply which is ok if we can proceed with account priority</returns>
public static int getPriority(ref Message message , string validatorAddress)
{
//Console.WriteLine("Validating NOW IN GRPC !! ");
ValidatorReply reply = ValidateAsync(message , validatorAddress);
public static int getPriorityAndStoreMessage(Message message)
if (reply == null)
{
return -1;
}
if (!reply.ReplyCode.Contains("ok"))
{
//authenticate and something else with logic and booleans to ensure all operation is done
MessageStorage.store(message, messageStorageURL);
int x = ProcessMessage.getPriority(message, accountStorageURL);
// if something wrong retrn -1
return x;
return -1;
}
return reply.AccountPriority;
}
private static ValidatorReply ValidateAsync(Message message, string validatorAddress)
{
using var channel = GrpcChannel.ForAddress(validatorAddress);
var client = new Validate.ValidateClient(channel);
MessageMetaData messageMeta = extractMetaData(message);
//Console.WriteLine("Calling GRPC for address = " + validatorAddress);
var reply = client.ValidateMessageAsync(messageMeta);
var ans = reply.GetAwaiter().GetResult();
return ans;
}
private static MessageMetaData extractMetaData(Message message)
{
MessageMetaData metaData = new MessageMetaData();
metaData.Tag = message.Tag;
metaData.ApiKey = message.ApiKey;
metaData.ClientID = message.ClientID;
return metaData;
}
}
}
namespace GrpcMessageNode.DataBaseAccess
{
public class MessageStorage
{
//use this class to store messages in database
public static bool store(Message message , string DB)
{
Console.WriteLine(message.MsgId + " - is being stored in data base : " + DB);
return true;
}
}
}
namespace GrpcMessageNode.DataBaseAccess
{
public class ProcessMessage
{
/// use this class to authenticate and process logic on message receipt
/// get the account priority and use it to determine total priority before
/// sending the message to coordinator and queuing
///
public static int getPriority(Message message , string DB)
{
string accId = message.ClientID;
Console.WriteLine("Getting priority of account " + accId + " from DataBase : " + DB);
int x = 1;
return x;
}
}
}
......@@ -6,9 +6,14 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<None Remove="Protos\validator.proto" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\schema.proto" GrpcServices="Server" />
<Protobuf Include="Protos\schema-queue.proto" GrpcServices="Client" />
<Protobuf Include="Protos\validator.proto" GrpcServices="Client" />
</ItemGroup>
<ItemGroup>
......
......@@ -7,14 +7,14 @@
*/
private static int MAX_PRIRITY = 5;
private static int MIN_PRIRITY = 1;
public static bool setFinalPriority(Message message)
public static bool setFinalPriority(ref Message message , string validatorAddress)
{
int account_p = DataBaseAccess.DBAccess.getPriorityAndStoreMessage(message);
int account_p = DataBaseAccess.DBAccess.getPriority(ref message , validatorAddress);
if (account_p == -1) return false;
int x = account_p + message.LocalPriority;
if (x > MAX_PRIRITY) x = MAX_PRIRITY;
if (x < MIN_PRIRITY && x!=-1) x = MIN_PRIRITY;
message.LocalPriority = x;
if (x == -1) return false;
return true;
}
/// we can complicate the mechanism as much as we want
......
......@@ -11,12 +11,14 @@ message Message2 {
string phoneNumber = 4;
int32 localPriority = 5;
string text = 6;
string tag = 7;
}
message Acknowledgement2
{
string replyCode = 1;
string requestID = 2;
}
service Queue {
......
......@@ -11,12 +11,14 @@ message Message {
string phoneNumber = 4;
int32 localPriority = 5;
string text = 6;
string tag = 7;
}
message Acknowledgement
{
string replyCode = 1;
string requestID = 2;
}
service Send {
......
syntax = "proto3";
option csharp_namespace = "GrpcMessageNode";
package Validator;
service Validate {
rpc ValidateMessage (MessageMetaData) returns (ValidatorReply);
}
message MessageMetaData {
string clientID = 1;
string apiKey = 2;
string tag = 3;
}
message ValidatorReply {
string replyCode = 1;
int32 accountPriority = 2;
}
......@@ -18,8 +18,12 @@ namespace GrpcMessageNode.Services
public override Task<Acknowledgement> SendMessage(Message message, ServerCallContext context)
{
string validator = getValidatorAddress();
//Console.WriteLine("Pr = " + message.LocalPriority);
bool res = PriorityHandling.SetPriority.setFinalPriority(message);
bool res = true;
res = PriorityHandling.SetPriority.setFinalPriority(ref message , validator);
if (res == false) // something went wrong
{
......@@ -29,6 +33,9 @@ namespace GrpcMessageNode.Services
});
}
//Console.WriteLine("new Pr = " + message.LocalPriority);
//Console.WriteLine("Account Checker Passed ");
string reply = sendToCoordinator(message);
......@@ -73,6 +80,7 @@ namespace GrpcMessageNode.Services
message2.ClientID = message.ClientID;
message2.ApiKey = message.ApiKey;
message2.PhoneNumber = message.PhoneNumber;
message2.Tag = message.Tag;
return message2;
}
......@@ -86,5 +94,16 @@ namespace GrpcMessageNode.Services
return address;
}
private string getValidatorAddress()
{
string address = "";
var y = discoveryClient.GetInstances("Validator"); /// write names to config file
address = y[0].Uri.ToString();
return address;
}
}
}
obj\Debug\net6.0\Protos/Validator.cs \
obj\Debug\net6.0\Protos/ValidatorGrpc.cs: Protos/validator.proto
\ No newline at end of file
286ecfa468b3d36df6d23da6551204042dd6dca9
de78e082071d7059e64956cfe7d5a48d015e9853
......@@ -24,18 +24,19 @@ namespace GrpcMessageNode {
static SchemaReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChNQcm90b3Mvc2NoZW1hLnByb3RvEgpUcmFubWl0dGVyInQKB01lc3NhZ2US",
"EAoIY2xpZW50SUQYASABKAkSDgoGYXBpS2V5GAIgASgJEg0KBW1zZ0lkGAMg",
"ASgJEhMKC3Bob25lTnVtYmVyGAQgASgJEhUKDWxvY2FsUHJpb3JpdHkYBSAB",
"KAUSDAoEdGV4dBgGIAEoCSIkCg9BY2tub3dsZWRnZW1lbnQSEQoJcmVwbHlD",
"b2RlGAEgASgJMkcKBFNlbmQSPwoLU2VuZE1lc3NhZ2USEy5UcmFubWl0dGVy",
"Lk1lc3NhZ2UaGy5UcmFubWl0dGVyLkFja25vd2xlZGdlbWVudEISqgIPR3Jw",
"Y01lc3NhZ2VOb2RlYgZwcm90bzM="));
"ChNQcm90b3Mvc2NoZW1hLnByb3RvEgpUcmFubWl0dGVyIoEBCgdNZXNzYWdl",
"EhAKCGNsaWVudElEGAEgASgJEg4KBmFwaUtleRgCIAEoCRINCgVtc2dJZBgD",
"IAEoCRITCgtwaG9uZU51bWJlchgEIAEoCRIVCg1sb2NhbFByaW9yaXR5GAUg",
"ASgFEgwKBHRleHQYBiABKAkSCwoDdGFnGAcgASgJIjcKD0Fja25vd2xlZGdl",
"bWVudBIRCglyZXBseUNvZGUYASABKAkSEQoJcmVxdWVzdElEGAIgASgJMkcK",
"BFNlbmQSPwoLU2VuZE1lc3NhZ2USEy5UcmFubWl0dGVyLk1lc3NhZ2UaGy5U",
"cmFubWl0dGVyLkFja25vd2xlZGdlbWVudEISqgIPR3JwY01lc3NhZ2VOb2Rl",
"YgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::GrpcMessageNode.Message), global::GrpcMessageNode.Message.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::GrpcMessageNode.Acknowledgement), global::GrpcMessageNode.Acknowledgement.Parser, new[]{ "ReplyCode" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::GrpcMessageNode.Message), global::GrpcMessageNode.Message.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text", "Tag" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::GrpcMessageNode.Acknowledgement), global::GrpcMessageNode.Acknowledgement.Parser, new[]{ "ReplyCode", "RequestID" }, null, null, null, null)
}));
}
#endregion
......@@ -83,6 +84,7 @@ namespace GrpcMessageNode {
phoneNumber_ = other.phoneNumber_;
localPriority_ = other.localPriority_;
text_ = other.text_;
tag_ = other.tag_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -164,6 +166,18 @@ namespace GrpcMessageNode {
}
}
/// <summary>Field number for the "tag" field.</summary>
public const int TagFieldNumber = 7;
private string tag_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Tag {
get { return tag_; }
set {
tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -185,6 +199,7 @@ namespace GrpcMessageNode {
if (PhoneNumber != other.PhoneNumber) return false;
if (LocalPriority != other.LocalPriority) return false;
if (Text != other.Text) return false;
if (Tag != other.Tag) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -198,6 +213,7 @@ namespace GrpcMessageNode {
if (PhoneNumber.Length != 0) hash ^= PhoneNumber.GetHashCode();
if (LocalPriority != 0) hash ^= LocalPriority.GetHashCode();
if (Text.Length != 0) hash ^= Text.GetHashCode();
if (Tag.Length != 0) hash ^= Tag.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -240,6 +256,10 @@ namespace GrpcMessageNode {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -274,6 +294,10 @@ namespace GrpcMessageNode {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -302,6 +326,9 @@ namespace GrpcMessageNode {
if (Text.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
}
if (Tag.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -332,6 +359,9 @@ namespace GrpcMessageNode {
if (other.Text.Length != 0) {
Text = other.Text;
}
if (other.Tag.Length != 0) {
Tag = other.Tag;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -371,6 +401,10 @@ namespace GrpcMessageNode {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
#endif
......@@ -410,6 +444,10 @@ namespace GrpcMessageNode {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
}
......@@ -453,6 +491,7 @@ namespace GrpcMessageNode {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Acknowledgement(Acknowledgement other) : this() {
replyCode_ = other.replyCode_;
requestID_ = other.requestID_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -474,6 +513,18 @@ namespace GrpcMessageNode {
}
}
/// <summary>Field number for the "requestID" field.</summary>
public const int RequestIDFieldNumber = 2;
private string requestID_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string RequestID {
get { return requestID_; }
set {
requestID_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -490,6 +541,7 @@ namespace GrpcMessageNode {
return true;
}
if (ReplyCode != other.ReplyCode) return false;
if (RequestID != other.RequestID) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -498,6 +550,7 @@ namespace GrpcMessageNode {
public override int GetHashCode() {
int hash = 1;
if (ReplyCode.Length != 0) hash ^= ReplyCode.GetHashCode();
if (RequestID.Length != 0) hash ^= RequestID.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -520,6 +573,10 @@ namespace GrpcMessageNode {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -534,6 +591,10 @@ namespace GrpcMessageNode {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -547,6 +608,9 @@ namespace GrpcMessageNode {
if (ReplyCode.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ReplyCode);
}
if (RequestID.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestID);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -562,6 +626,9 @@ namespace GrpcMessageNode {
if (other.ReplyCode.Length != 0) {
ReplyCode = other.ReplyCode;
}
if (other.RequestID.Length != 0) {
RequestID = other.RequestID;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -581,6 +648,10 @@ namespace GrpcMessageNode {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
#endif
......@@ -600,6 +671,10 @@ namespace GrpcMessageNode {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
}
......
......@@ -24,18 +24,19 @@ namespace GrpcMessageNode {
static SchemaQueueReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChlQcm90b3Mvc2NoZW1hLXF1ZXVlLnByb3RvEgpUcmFubWl0dGVyInUKCE1l",
"c3NhZ2UyEhAKCGNsaWVudElEGAEgASgJEg4KBmFwaUtleRgCIAEoCRINCgVt",
"c2dJZBgDIAEoCRITCgtwaG9uZU51bWJlchgEIAEoCRIVCg1sb2NhbFByaW9y",
"aXR5GAUgASgFEgwKBHRleHQYBiABKAkiJQoQQWNrbm93bGVkZ2VtZW50MhIR",
"CglyZXBseUNvZGUYASABKAkySwoFUXVldWUSQgoMUXVldWVNZXNzYWdlEhQu",
"VHJhbm1pdHRlci5NZXNzYWdlMhocLlRyYW5taXR0ZXIuQWNrbm93bGVkZ2Vt",
"ZW50MkISqgIPR3JwY01lc3NhZ2VOb2RlYgZwcm90bzM="));
"ChlQcm90b3Mvc2NoZW1hLXF1ZXVlLnByb3RvEgpUcmFubWl0dGVyIoIBCghN",
"ZXNzYWdlMhIQCghjbGllbnRJRBgBIAEoCRIOCgZhcGlLZXkYAiABKAkSDQoF",
"bXNnSWQYAyABKAkSEwoLcGhvbmVOdW1iZXIYBCABKAkSFQoNbG9jYWxQcmlv",
"cml0eRgFIAEoBRIMCgR0ZXh0GAYgASgJEgsKA3RhZxgHIAEoCSI4ChBBY2tu",
"b3dsZWRnZW1lbnQyEhEKCXJlcGx5Q29kZRgBIAEoCRIRCglyZXF1ZXN0SUQY",
"AiABKAkySwoFUXVldWUSQgoMUXVldWVNZXNzYWdlEhQuVHJhbm1pdHRlci5N",
"ZXNzYWdlMhocLlRyYW5taXR0ZXIuQWNrbm93bGVkZ2VtZW50MkISqgIPR3Jw",
"Y01lc3NhZ2VOb2RlYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::GrpcMessageNode.Message2), global::GrpcMessageNode.Message2.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::GrpcMessageNode.Acknowledgement2), global::GrpcMessageNode.Acknowledgement2.Parser, new[]{ "ReplyCode" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::GrpcMessageNode.Message2), global::GrpcMessageNode.Message2.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text", "Tag" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::GrpcMessageNode.Acknowledgement2), global::GrpcMessageNode.Acknowledgement2.Parser, new[]{ "ReplyCode", "RequestID" }, null, null, null, null)
}));
}
#endregion
......@@ -83,6 +84,7 @@ namespace GrpcMessageNode {
phoneNumber_ = other.phoneNumber_;
localPriority_ = other.localPriority_;
text_ = other.text_;
tag_ = other.tag_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -164,6 +166,18 @@ namespace GrpcMessageNode {
}
}
/// <summary>Field number for the "tag" field.</summary>
public const int TagFieldNumber = 7;
private string tag_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Tag {
get { return tag_; }
set {
tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -185,6 +199,7 @@ namespace GrpcMessageNode {
if (PhoneNumber != other.PhoneNumber) return false;
if (LocalPriority != other.LocalPriority) return false;
if (Text != other.Text) return false;
if (Tag != other.Tag) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -198,6 +213,7 @@ namespace GrpcMessageNode {
if (PhoneNumber.Length != 0) hash ^= PhoneNumber.GetHashCode();
if (LocalPriority != 0) hash ^= LocalPriority.GetHashCode();
if (Text.Length != 0) hash ^= Text.GetHashCode();
if (Tag.Length != 0) hash ^= Tag.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -240,6 +256,10 @@ namespace GrpcMessageNode {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -274,6 +294,10 @@ namespace GrpcMessageNode {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -302,6 +326,9 @@ namespace GrpcMessageNode {
if (Text.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
}
if (Tag.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -332,6 +359,9 @@ namespace GrpcMessageNode {
if (other.Text.Length != 0) {
Text = other.Text;
}
if (other.Tag.Length != 0) {
Tag = other.Tag;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -371,6 +401,10 @@ namespace GrpcMessageNode {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
#endif
......@@ -410,6 +444,10 @@ namespace GrpcMessageNode {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
}
......@@ -453,6 +491,7 @@ namespace GrpcMessageNode {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Acknowledgement2(Acknowledgement2 other) : this() {
replyCode_ = other.replyCode_;
requestID_ = other.requestID_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -474,6 +513,18 @@ namespace GrpcMessageNode {
}
}
/// <summary>Field number for the "requestID" field.</summary>
public const int RequestIDFieldNumber = 2;
private string requestID_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string RequestID {
get { return requestID_; }
set {
requestID_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -490,6 +541,7 @@ namespace GrpcMessageNode {
return true;
}
if (ReplyCode != other.ReplyCode) return false;
if (RequestID != other.RequestID) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -498,6 +550,7 @@ namespace GrpcMessageNode {
public override int GetHashCode() {
int hash = 1;
if (ReplyCode.Length != 0) hash ^= ReplyCode.GetHashCode();
if (RequestID.Length != 0) hash ^= RequestID.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -520,6 +573,10 @@ namespace GrpcMessageNode {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -534,6 +591,10 @@ namespace GrpcMessageNode {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -547,6 +608,9 @@ namespace GrpcMessageNode {
if (ReplyCode.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ReplyCode);
}
if (RequestID.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestID);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -562,6 +626,9 @@ namespace GrpcMessageNode {
if (other.ReplyCode.Length != 0) {
ReplyCode = other.ReplyCode;
}
if (other.RequestID.Length != 0) {
RequestID = other.RequestID;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -581,6 +648,10 @@ namespace GrpcMessageNode {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
#endif
......@@ -600,6 +671,10 @@ namespace GrpcMessageNode {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
}
......
This diff is collapsed.
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Protos/validator.proto
// </auto-generated>
#pragma warning disable 0414, 1591, 8981, 0612
#region Designer generated code
using grpc = global::Grpc.Core;
namespace GrpcMessageNode {
public static partial class Validate
{
static readonly string __ServiceName = "Validator.Validate";
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)
{
#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
if (message is global::Google.Protobuf.IBufferMessage)
{
context.SetPayloadLength(message.CalculateSize());
global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter());
context.Complete();
return;
}
#endif
context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static class __Helper_MessageCache<T>
{
public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T>
{
#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
if (__Helper_MessageCache<T>.IsBufferMessage)
{
return parser.ParseFrom(context.PayloadAsReadOnlySequence());
}
#endif
return parser.ParseFrom(context.PayloadAsNewBuffer());
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::GrpcMessageNode.MessageMetaData> __Marshaller_Validator_MessageMetaData = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::GrpcMessageNode.MessageMetaData.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::GrpcMessageNode.ValidatorReply> __Marshaller_Validator_ValidatorReply = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::GrpcMessageNode.ValidatorReply.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::GrpcMessageNode.MessageMetaData, global::GrpcMessageNode.ValidatorReply> __Method_ValidateMessage = new grpc::Method<global::GrpcMessageNode.MessageMetaData, global::GrpcMessageNode.ValidatorReply>(
grpc::MethodType.Unary,
__ServiceName,
"ValidateMessage",
__Marshaller_Validator_MessageMetaData,
__Marshaller_Validator_ValidatorReply);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::GrpcMessageNode.ValidatorReflection.Descriptor.Services[0]; }
}
/// <summary>Client for Validate</summary>
public partial class ValidateClient : grpc::ClientBase<ValidateClient>
{
/// <summary>Creates a new client for Validate</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public ValidateClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for Validate that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public ValidateClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected ValidateClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected ValidateClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::GrpcMessageNode.ValidatorReply ValidateMessage(global::GrpcMessageNode.MessageMetaData request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ValidateMessage(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::GrpcMessageNode.ValidatorReply ValidateMessage(global::GrpcMessageNode.MessageMetaData request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_ValidateMessage, null, options, request);
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::GrpcMessageNode.ValidatorReply> ValidateMessageAsync(global::GrpcMessageNode.MessageMetaData request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ValidateMessageAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::GrpcMessageNode.ValidatorReply> ValidateMessageAsync(global::GrpcMessageNode.MessageMetaData request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_ValidateMessage, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected override ValidateClient NewInstance(ClientBaseConfiguration configuration)
{
return new ValidateClient(configuration);
}
}
}
}
#endregion
......@@ -37,3 +37,9 @@
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
......@@ -9,9 +9,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessageGeneratorGRPC", "Mes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QueuerNode", "QueuerNode\QueuerNode.csproj", "{676D9604-4597-4935-826A-7F054FD5936A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTTPMessageNode", "HTTPMessageNode\HTTPMessageNode.csproj", "{79828C38-A68B-4340-9F93-D55C5DCC203A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HTTPMessageNode", "HTTPMessageNode\HTTPMessageNode.csproj", "{79828C38-A68B-4340-9F93-D55C5DCC203A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTTPMessageGenerator", "HTTPMessageGenerator\HTTPMessageGenerator.csproj", "{C008AEEB-FD9F-4D59-B047-A77BD058C12F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HTTPMessageGenerator", "HTTPMessageGenerator\HTTPMessageGenerator.csproj", "{C008AEEB-FD9F-4D59-B047-A77BD058C12F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Validator", "Validator\Validator.csproj", "{D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -39,6 +41,10 @@ Global
{C008AEEB-FD9F-4D59-B047-A77BD058C12F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C008AEEB-FD9F-4D59-B047-A77BD058C12F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C008AEEB-FD9F-4D59-B047-A77BD058C12F}.Release|Any CPU.Build.0 = Release|Any CPU
{D2C3ADDD-BA47-473C-A761-1CE5B1EE6407}.Debug|Any CPU.ActiveCfg = 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.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -14,5 +14,6 @@ namespace HTTPMessageGenerator
public string? phoneNumber { get; set; }
public int localPriority { get; set; }
public string? text { get; set; }
public string? tag { get; set; }
}
}
......@@ -14,18 +14,10 @@ message.clientID = "m-salameh";
message.localPriority = 1;
message.msgId = "msg-id=1";
message.phoneNumber = "043 33 00 83";
message.tag = "SYYR";
var client = new HttpClient();
/*
using StringContent jsonContent = new(
JsonSerializer.Serialize(new
{message
}),
Encoding.UTF8,
"application/json");
*/
StringContent payload = new (JsonSerializer.Serialize(message) , Encoding.UTF8 , "application/json");
......
......@@ -11,12 +11,14 @@ message Message {
string phoneNumber = 4;
int32 localPriority = 5;
string text = 6;
string tag = 7;
}
message Acknowledgement
{
string replyCode = 1;
string requestID = 2;
}
service Queue {
......
......@@ -24,18 +24,19 @@ namespace HTTPMessageGenerator {
static SchemaReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChNQcm90b3Mvc2NoZW1hLnByb3RvEgpUcmFubWl0dGVyInQKB01lc3NhZ2US",
"EAoIY2xpZW50SUQYASABKAkSDgoGYXBpS2V5GAIgASgJEg0KBW1zZ0lkGAMg",
"ASgJEhMKC3Bob25lTnVtYmVyGAQgASgJEhUKDWxvY2FsUHJpb3JpdHkYBSAB",
"KAUSDAoEdGV4dBgGIAEoCSIkCg9BY2tub3dsZWRnZW1lbnQSEQoJcmVwbHlD",
"b2RlGAEgASgJMkkKBVF1ZXVlEkAKDFF1ZXVlTWVzc2FnZRITLlRyYW5taXR0",
"ZXIuTWVzc2FnZRobLlRyYW5taXR0ZXIuQWNrbm93bGVkZ2VtZW50QheqAhRI",
"VFRQTWVzc2FnZUdlbmVyYXRvcmIGcHJvdG8z"));
"ChNQcm90b3Mvc2NoZW1hLnByb3RvEgpUcmFubWl0dGVyIoEBCgdNZXNzYWdl",
"EhAKCGNsaWVudElEGAEgASgJEg4KBmFwaUtleRgCIAEoCRINCgVtc2dJZBgD",
"IAEoCRITCgtwaG9uZU51bWJlchgEIAEoCRIVCg1sb2NhbFByaW9yaXR5GAUg",
"ASgFEgwKBHRleHQYBiABKAkSCwoDdGFnGAcgASgJIjcKD0Fja25vd2xlZGdl",
"bWVudBIRCglyZXBseUNvZGUYASABKAkSEQoJcmVxdWVzdElEGAIgASgJMkkK",
"BVF1ZXVlEkAKDFF1ZXVlTWVzc2FnZRITLlRyYW5taXR0ZXIuTWVzc2FnZRob",
"LlRyYW5taXR0ZXIuQWNrbm93bGVkZ2VtZW50QheqAhRIVFRQTWVzc2FnZUdl",
"bmVyYXRvcmIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::HTTPMessageGenerator.Message), global::HTTPMessageGenerator.Message.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::HTTPMessageGenerator.Acknowledgement), global::HTTPMessageGenerator.Acknowledgement.Parser, new[]{ "ReplyCode" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::HTTPMessageGenerator.Message), global::HTTPMessageGenerator.Message.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text", "Tag" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::HTTPMessageGenerator.Acknowledgement), global::HTTPMessageGenerator.Acknowledgement.Parser, new[]{ "ReplyCode", "RequestID" }, null, null, null, null)
}));
}
#endregion
......@@ -83,6 +84,7 @@ namespace HTTPMessageGenerator {
phoneNumber_ = other.phoneNumber_;
localPriority_ = other.localPriority_;
text_ = other.text_;
tag_ = other.tag_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -164,6 +166,18 @@ namespace HTTPMessageGenerator {
}
}
/// <summary>Field number for the "tag" field.</summary>
public const int TagFieldNumber = 7;
private string tag_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Tag {
get { return tag_; }
set {
tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -185,6 +199,7 @@ namespace HTTPMessageGenerator {
if (PhoneNumber != other.PhoneNumber) return false;
if (LocalPriority != other.LocalPriority) return false;
if (Text != other.Text) return false;
if (Tag != other.Tag) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -198,6 +213,7 @@ namespace HTTPMessageGenerator {
if (PhoneNumber.Length != 0) hash ^= PhoneNumber.GetHashCode();
if (LocalPriority != 0) hash ^= LocalPriority.GetHashCode();
if (Text.Length != 0) hash ^= Text.GetHashCode();
if (Tag.Length != 0) hash ^= Tag.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -240,6 +256,10 @@ namespace HTTPMessageGenerator {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -274,6 +294,10 @@ namespace HTTPMessageGenerator {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -302,6 +326,9 @@ namespace HTTPMessageGenerator {
if (Text.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
}
if (Tag.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -332,6 +359,9 @@ namespace HTTPMessageGenerator {
if (other.Text.Length != 0) {
Text = other.Text;
}
if (other.Tag.Length != 0) {
Tag = other.Tag;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -371,6 +401,10 @@ namespace HTTPMessageGenerator {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
#endif
......@@ -410,6 +444,10 @@ namespace HTTPMessageGenerator {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
}
......@@ -453,6 +491,7 @@ namespace HTTPMessageGenerator {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Acknowledgement(Acknowledgement other) : this() {
replyCode_ = other.replyCode_;
requestID_ = other.requestID_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -474,6 +513,18 @@ namespace HTTPMessageGenerator {
}
}
/// <summary>Field number for the "requestID" field.</summary>
public const int RequestIDFieldNumber = 2;
private string requestID_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string RequestID {
get { return requestID_; }
set {
requestID_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -490,6 +541,7 @@ namespace HTTPMessageGenerator {
return true;
}
if (ReplyCode != other.ReplyCode) return false;
if (RequestID != other.RequestID) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -498,6 +550,7 @@ namespace HTTPMessageGenerator {
public override int GetHashCode() {
int hash = 1;
if (ReplyCode.Length != 0) hash ^= ReplyCode.GetHashCode();
if (RequestID.Length != 0) hash ^= RequestID.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -520,6 +573,10 @@ namespace HTTPMessageGenerator {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -534,6 +591,10 @@ namespace HTTPMessageGenerator {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -547,6 +608,9 @@ namespace HTTPMessageGenerator {
if (ReplyCode.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ReplyCode);
}
if (RequestID.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestID);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -562,6 +626,9 @@ namespace HTTPMessageGenerator {
if (other.ReplyCode.Length != 0) {
ReplyCode = other.ReplyCode;
}
if (other.RequestID.Length != 0) {
RequestID = other.RequestID;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -581,6 +648,10 @@ namespace HTTPMessageGenerator {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
#endif
......@@ -600,6 +671,10 @@ namespace HTTPMessageGenerator {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
}
......
......@@ -24,6 +24,18 @@ namespace HTTPMessageNode.Controllers
{
Console.WriteLine("Msg from : " + messageDTO.clientID);
string validator = getValidatorAddress();
Message message = copyMessage(messageDTO);
bool res = PriorityHandling.SetPriority.setFinalPriority(ref message , validator);
if (res == false)
{
return "Error";
}
string address = getAddress();
using var channel = GrpcChannel.ForAddress(address);
var client = new Queue.QueueClient(channel);
......@@ -31,20 +43,13 @@ namespace HTTPMessageNode.Controllers
Console.WriteLine("Sending to " + address);
Message message = copyMessage(messageDTO);
/*Message message = new Message();
message.MsgId = messageDTO.msgId;
message.Text = messageDTO.text;
message.LocalPriority = messageDTO.localPriority;
message.PhoneNumber = messageDTO.phoneNumber;
message.ApiKey = messageDTO.apiKey;
message.ClientID = messageDTO.clientID;*/
var reply = client.QueueMessage(message);
Console.WriteLine(reply.ReplyCode);
return reply.ReplyCode;
return (reply.ReplyCode );
}
......@@ -58,6 +63,7 @@ namespace HTTPMessageNode.Controllers
message.PhoneNumber = messageDTO.phoneNumber;
message.ApiKey = messageDTO.apiKey;
message.ClientID = messageDTO.clientID;
message.Tag = messageDTO.tag;
return message;
}
private string getAddress()
......@@ -70,5 +76,16 @@ namespace HTTPMessageNode.Controllers
return address;
}
private string getValidatorAddress()
{
string address = "";
var y = discoveryClient.GetInstances("Validator"); /// write names to config file
address = y[0].Uri.ToString();
return address;
}
}
}
\ No newline at end of file

using Grpc.Net.Client;
using Validator;
namespace HTTPMessageNode.DataBaseAccess
/// <summary>
/// this class encapsulates MessageStorage and ProcessMessage classed and through it
/// we access them as a type of layering
/// </summary>
{
public class DBAccess
{
/// <summary>
/// check message for tag , Authentication , Quota perhaps from service validator with address
/// passed as a parameter to the function
/// </summary>
/// <param name="message" > the message we received to check</param>
/// <param name="validatorAddress"> The validator service address which as a mongodb service </param>
/// <returns> validator reply which is ok if we can proceed with account priority</returns>
public static int getPriority(ref Message message , string validatorAddress)
{
ValidatorReply reply = ValidateAsync(message , validatorAddress);
if (reply == null)
{
return -1;
}
if (!reply.ReplyCode.Contains("ok"))
{
return -1;
}
Console.WriteLine(reply.ReplyCode);
return reply.AccountPriority;
}
private static ValidatorReply ValidateAsync(Message message, string validatorAddress)
{
using var channel = GrpcChannel.ForAddress(validatorAddress);
var client = new Validate.ValidateClient(channel);
MessageMetaData messageMeta = extractMetaData(message);
var reply = client.ValidateMessageAsync(messageMeta);
var ans = reply.GetAwaiter().GetResult();
return ans;
}
private static MessageMetaData extractMetaData(Message message)
{
MessageMetaData metaData = new MessageMetaData();
metaData.Tag = message.Tag;
metaData.ApiKey = message.ApiKey;
metaData.ClientID = message.ClientID;
return metaData;
}
}
}
......@@ -6,6 +6,10 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<None Remove="Protos\validator.proto" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.40.0" />
......@@ -34,5 +38,6 @@
<ItemGroup>
<Protobuf Include="Protos\schema.proto" GrpcServices="Client" />
<Protobuf Include="Protos\validator.proto" GrpcServices="Client" />
</ItemGroup>
</Project>
......@@ -14,5 +14,6 @@ namespace HTTPMessageNode
public string? phoneNumber { get; set; }
public int localPriority { get; set; }
public string? text { get; set; }
public string? tag { get; set; }
}
}
namespace HTTPMessageNode.PriorityHandling
{
public class SetPriority
{
/*
* better to make priorities configurable from files !!
*/
private static int MAX_PRIRITY = 5;
private static int MIN_PRIRITY = 1;
public static bool setFinalPriority(ref Message message , string validatorAddress)
{
int account_p = DataBaseAccess.DBAccess.getPriority(ref message , validatorAddress);
if (account_p == -1) return false;
int x = account_p + message.LocalPriority;
if (x > MAX_PRIRITY) x = MAX_PRIRITY;
if (x < MIN_PRIRITY && x!=-1) x = MIN_PRIRITY;
message.LocalPriority = x;
return true;
}
/// we can complicate the mechanism as much as we want
}
}
......@@ -11,12 +11,14 @@ message Message {
string phoneNumber = 4;
int32 localPriority = 5;
string text = 6;
string tag = 7;
}
message Acknowledgement
{
string replyCode = 1;
string requestID = 2;
}
service Queue {
......
syntax = "proto3";
option csharp_namespace = "Validator";
package Validator;
service Validate {
rpc ValidateMessage (MessageMetaData) returns (ValidatorReply);
}
message MessageMetaData {
string clientID = 1;
string apiKey = 2;
string tag = 3;
}
message ValidatorReply {
string replyCode = 1;
int32 accountPriority = 2;
}
obj\Debug\net6.0\Protos/Validator.cs \
obj\Debug\net6.0\Protos/ValidatorGrpc.cs: Protos/validator.proto
\ No newline at end of file
07356545f4b7d9887cb89969581b06a53fa226d1
4cfc54818bac6f68e42c2cdebb5e9d540dad794f
......@@ -24,18 +24,19 @@ namespace HTTPMessageNode {
static SchemaReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChNQcm90b3Mvc2NoZW1hLnByb3RvEgpUcmFubWl0dGVyInQKB01lc3NhZ2US",
"EAoIY2xpZW50SUQYASABKAkSDgoGYXBpS2V5GAIgASgJEg0KBW1zZ0lkGAMg",
"ASgJEhMKC3Bob25lTnVtYmVyGAQgASgJEhUKDWxvY2FsUHJpb3JpdHkYBSAB",
"KAUSDAoEdGV4dBgGIAEoCSIkCg9BY2tub3dsZWRnZW1lbnQSEQoJcmVwbHlD",
"b2RlGAEgASgJMkkKBVF1ZXVlEkAKDFF1ZXVlTWVzc2FnZRITLlRyYW5taXR0",
"ZXIuTWVzc2FnZRobLlRyYW5taXR0ZXIuQWNrbm93bGVkZ2VtZW50QhKqAg9I",
"VFRQTWVzc2FnZU5vZGViBnByb3RvMw=="));
"ChNQcm90b3Mvc2NoZW1hLnByb3RvEgpUcmFubWl0dGVyIoEBCgdNZXNzYWdl",
"EhAKCGNsaWVudElEGAEgASgJEg4KBmFwaUtleRgCIAEoCRINCgVtc2dJZBgD",
"IAEoCRITCgtwaG9uZU51bWJlchgEIAEoCRIVCg1sb2NhbFByaW9yaXR5GAUg",
"ASgFEgwKBHRleHQYBiABKAkSCwoDdGFnGAcgASgJIjcKD0Fja25vd2xlZGdl",
"bWVudBIRCglyZXBseUNvZGUYASABKAkSEQoJcmVxdWVzdElEGAIgASgJMkkK",
"BVF1ZXVlEkAKDFF1ZXVlTWVzc2FnZRITLlRyYW5taXR0ZXIuTWVzc2FnZRob",
"LlRyYW5taXR0ZXIuQWNrbm93bGVkZ2VtZW50QhKqAg9IVFRQTWVzc2FnZU5v",
"ZGViBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::HTTPMessageNode.Message), global::HTTPMessageNode.Message.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::HTTPMessageNode.Acknowledgement), global::HTTPMessageNode.Acknowledgement.Parser, new[]{ "ReplyCode" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::HTTPMessageNode.Message), global::HTTPMessageNode.Message.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text", "Tag" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::HTTPMessageNode.Acknowledgement), global::HTTPMessageNode.Acknowledgement.Parser, new[]{ "ReplyCode", "RequestID" }, null, null, null, null)
}));
}
#endregion
......@@ -83,6 +84,7 @@ namespace HTTPMessageNode {
phoneNumber_ = other.phoneNumber_;
localPriority_ = other.localPriority_;
text_ = other.text_;
tag_ = other.tag_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -164,6 +166,18 @@ namespace HTTPMessageNode {
}
}
/// <summary>Field number for the "tag" field.</summary>
public const int TagFieldNumber = 7;
private string tag_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Tag {
get { return tag_; }
set {
tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -185,6 +199,7 @@ namespace HTTPMessageNode {
if (PhoneNumber != other.PhoneNumber) return false;
if (LocalPriority != other.LocalPriority) return false;
if (Text != other.Text) return false;
if (Tag != other.Tag) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -198,6 +213,7 @@ namespace HTTPMessageNode {
if (PhoneNumber.Length != 0) hash ^= PhoneNumber.GetHashCode();
if (LocalPriority != 0) hash ^= LocalPriority.GetHashCode();
if (Text.Length != 0) hash ^= Text.GetHashCode();
if (Tag.Length != 0) hash ^= Tag.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -240,6 +256,10 @@ namespace HTTPMessageNode {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -274,6 +294,10 @@ namespace HTTPMessageNode {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -302,6 +326,9 @@ namespace HTTPMessageNode {
if (Text.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
}
if (Tag.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -332,6 +359,9 @@ namespace HTTPMessageNode {
if (other.Text.Length != 0) {
Text = other.Text;
}
if (other.Tag.Length != 0) {
Tag = other.Tag;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -371,6 +401,10 @@ namespace HTTPMessageNode {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
#endif
......@@ -410,6 +444,10 @@ namespace HTTPMessageNode {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
}
......@@ -453,6 +491,7 @@ namespace HTTPMessageNode {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Acknowledgement(Acknowledgement other) : this() {
replyCode_ = other.replyCode_;
requestID_ = other.requestID_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -474,6 +513,18 @@ namespace HTTPMessageNode {
}
}
/// <summary>Field number for the "requestID" field.</summary>
public const int RequestIDFieldNumber = 2;
private string requestID_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string RequestID {
get { return requestID_; }
set {
requestID_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -490,6 +541,7 @@ namespace HTTPMessageNode {
return true;
}
if (ReplyCode != other.ReplyCode) return false;
if (RequestID != other.RequestID) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -498,6 +550,7 @@ namespace HTTPMessageNode {
public override int GetHashCode() {
int hash = 1;
if (ReplyCode.Length != 0) hash ^= ReplyCode.GetHashCode();
if (RequestID.Length != 0) hash ^= RequestID.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -520,6 +573,10 @@ namespace HTTPMessageNode {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -534,6 +591,10 @@ namespace HTTPMessageNode {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -547,6 +608,9 @@ namespace HTTPMessageNode {
if (ReplyCode.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ReplyCode);
}
if (RequestID.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestID);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -562,6 +626,9 @@ namespace HTTPMessageNode {
if (other.ReplyCode.Length != 0) {
ReplyCode = other.ReplyCode;
}
if (other.RequestID.Length != 0) {
RequestID = other.RequestID;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -581,6 +648,10 @@ namespace HTTPMessageNode {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
#endif
......@@ -600,6 +671,10 @@ namespace HTTPMessageNode {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
}
......
This diff is collapsed.
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Protos/validator.proto
// </auto-generated>
#pragma warning disable 0414, 1591, 8981, 0612
#region Designer generated code
using grpc = global::Grpc.Core;
namespace Validator {
public static partial class Validate
{
static readonly string __ServiceName = "Validator.Validate";
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)
{
#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
if (message is global::Google.Protobuf.IBufferMessage)
{
context.SetPayloadLength(message.CalculateSize());
global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter());
context.Complete();
return;
}
#endif
context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static class __Helper_MessageCache<T>
{
public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T>
{
#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
if (__Helper_MessageCache<T>.IsBufferMessage)
{
return parser.ParseFrom(context.PayloadAsReadOnlySequence());
}
#endif
return parser.ParseFrom(context.PayloadAsNewBuffer());
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Validator.MessageMetaData> __Marshaller_Validator_MessageMetaData = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Validator.MessageMetaData.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Validator.ValidatorReply> __Marshaller_Validator_ValidatorReply = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Validator.ValidatorReply.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Validator.MessageMetaData, global::Validator.ValidatorReply> __Method_ValidateMessage = new grpc::Method<global::Validator.MessageMetaData, global::Validator.ValidatorReply>(
grpc::MethodType.Unary,
__ServiceName,
"ValidateMessage",
__Marshaller_Validator_MessageMetaData,
__Marshaller_Validator_ValidatorReply);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Validator.ValidatorReflection.Descriptor.Services[0]; }
}
/// <summary>Client for Validate</summary>
public partial class ValidateClient : grpc::ClientBase<ValidateClient>
{
/// <summary>Creates a new client for Validate</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public ValidateClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for Validate that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public ValidateClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected ValidateClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected ValidateClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Validator.ValidatorReply ValidateMessage(global::Validator.MessageMetaData request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ValidateMessage(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Validator.ValidatorReply ValidateMessage(global::Validator.MessageMetaData request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_ValidateMessage, null, options, request);
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Validator.ValidatorReply> ValidateMessageAsync(global::Validator.MessageMetaData request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ValidateMessageAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Validator.ValidatorReply> ValidateMessageAsync(global::Validator.MessageMetaData request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_ValidateMessage, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected override ValidateClient NewInstance(ClientBaseConfiguration configuration)
{
return new ValidateClient(configuration);
}
}
}
}
#endregion
......@@ -4,3 +4,7 @@
2.0
2.0
2.0
2.0
2.0
2.0
2.0
......@@ -11,12 +11,14 @@ message Message {
string phoneNumber = 4;
int32 localPriority = 5;
string text = 6;
string tag = 7;
}
message Acknowledgement
{
string replyCode = 1;
string requestID = 2;
}
service Send {
......
......@@ -11,12 +11,14 @@ message Message2 {
string phoneNumber = 4;
int32 localPriority = 5;
string text = 6;
string tag = 7;
}
message Acknowledgement2
{
string replyCode = 1;
string requestID = 2;
}
service Queue {
......
......@@ -27,7 +27,7 @@ namespace MessageGeneratorGRPC
message.LocalPriority = 1;
message.MsgId = "msg-id=1";
message.PhoneNumber = "043 33 00 83";
message.Tag = "SYR";
Console.WriteLine("Sending to " + address);
......
......@@ -24,18 +24,19 @@ namespace MessageGeneratorGRPC {
static SchemaReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChNQcm90b3Mvc2NoZW1hLnByb3RvEgpUcmFubWl0dGVyInQKB01lc3NhZ2US",
"EAoIY2xpZW50SUQYASABKAkSDgoGYXBpS2V5GAIgASgJEg0KBW1zZ0lkGAMg",
"ASgJEhMKC3Bob25lTnVtYmVyGAQgASgJEhUKDWxvY2FsUHJpb3JpdHkYBSAB",
"KAUSDAoEdGV4dBgGIAEoCSIkCg9BY2tub3dsZWRnZW1lbnQSEQoJcmVwbHlD",
"b2RlGAEgASgJMkcKBFNlbmQSPwoLU2VuZE1lc3NhZ2USEy5UcmFubWl0dGVy",
"Lk1lc3NhZ2UaGy5UcmFubWl0dGVyLkFja25vd2xlZGdlbWVudEIXqgIUTWVz",
"c2FnZUdlbmVyYXRvckdSUENiBnByb3RvMw=="));
"ChNQcm90b3Mvc2NoZW1hLnByb3RvEgpUcmFubWl0dGVyIoEBCgdNZXNzYWdl",
"EhAKCGNsaWVudElEGAEgASgJEg4KBmFwaUtleRgCIAEoCRINCgVtc2dJZBgD",
"IAEoCRITCgtwaG9uZU51bWJlchgEIAEoCRIVCg1sb2NhbFByaW9yaXR5GAUg",
"ASgFEgwKBHRleHQYBiABKAkSCwoDdGFnGAcgASgJIjcKD0Fja25vd2xlZGdl",
"bWVudBIRCglyZXBseUNvZGUYASABKAkSEQoJcmVxdWVzdElEGAIgASgJMkcK",
"BFNlbmQSPwoLU2VuZE1lc3NhZ2USEy5UcmFubWl0dGVyLk1lc3NhZ2UaGy5U",
"cmFubWl0dGVyLkFja25vd2xlZGdlbWVudEIXqgIUTWVzc2FnZUdlbmVyYXRv",
"ckdSUENiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::MessageGeneratorGRPC.Message), global::MessageGeneratorGRPC.Message.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::MessageGeneratorGRPC.Acknowledgement), global::MessageGeneratorGRPC.Acknowledgement.Parser, new[]{ "ReplyCode" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::MessageGeneratorGRPC.Message), global::MessageGeneratorGRPC.Message.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text", "Tag" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::MessageGeneratorGRPC.Acknowledgement), global::MessageGeneratorGRPC.Acknowledgement.Parser, new[]{ "ReplyCode", "RequestID" }, null, null, null, null)
}));
}
#endregion
......@@ -83,6 +84,7 @@ namespace MessageGeneratorGRPC {
phoneNumber_ = other.phoneNumber_;
localPriority_ = other.localPriority_;
text_ = other.text_;
tag_ = other.tag_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -164,6 +166,18 @@ namespace MessageGeneratorGRPC {
}
}
/// <summary>Field number for the "tag" field.</summary>
public const int TagFieldNumber = 7;
private string tag_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Tag {
get { return tag_; }
set {
tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -185,6 +199,7 @@ namespace MessageGeneratorGRPC {
if (PhoneNumber != other.PhoneNumber) return false;
if (LocalPriority != other.LocalPriority) return false;
if (Text != other.Text) return false;
if (Tag != other.Tag) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -198,6 +213,7 @@ namespace MessageGeneratorGRPC {
if (PhoneNumber.Length != 0) hash ^= PhoneNumber.GetHashCode();
if (LocalPriority != 0) hash ^= LocalPriority.GetHashCode();
if (Text.Length != 0) hash ^= Text.GetHashCode();
if (Tag.Length != 0) hash ^= Tag.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -240,6 +256,10 @@ namespace MessageGeneratorGRPC {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -274,6 +294,10 @@ namespace MessageGeneratorGRPC {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -302,6 +326,9 @@ namespace MessageGeneratorGRPC {
if (Text.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
}
if (Tag.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -332,6 +359,9 @@ namespace MessageGeneratorGRPC {
if (other.Text.Length != 0) {
Text = other.Text;
}
if (other.Tag.Length != 0) {
Tag = other.Tag;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -371,6 +401,10 @@ namespace MessageGeneratorGRPC {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
#endif
......@@ -410,6 +444,10 @@ namespace MessageGeneratorGRPC {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
}
......@@ -453,6 +491,7 @@ namespace MessageGeneratorGRPC {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Acknowledgement(Acknowledgement other) : this() {
replyCode_ = other.replyCode_;
requestID_ = other.requestID_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -474,6 +513,18 @@ namespace MessageGeneratorGRPC {
}
}
/// <summary>Field number for the "requestID" field.</summary>
public const int RequestIDFieldNumber = 2;
private string requestID_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string RequestID {
get { return requestID_; }
set {
requestID_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -490,6 +541,7 @@ namespace MessageGeneratorGRPC {
return true;
}
if (ReplyCode != other.ReplyCode) return false;
if (RequestID != other.RequestID) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -498,6 +550,7 @@ namespace MessageGeneratorGRPC {
public override int GetHashCode() {
int hash = 1;
if (ReplyCode.Length != 0) hash ^= ReplyCode.GetHashCode();
if (RequestID.Length != 0) hash ^= RequestID.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -520,6 +573,10 @@ namespace MessageGeneratorGRPC {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -534,6 +591,10 @@ namespace MessageGeneratorGRPC {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -547,6 +608,9 @@ namespace MessageGeneratorGRPC {
if (ReplyCode.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ReplyCode);
}
if (RequestID.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestID);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -562,6 +626,9 @@ namespace MessageGeneratorGRPC {
if (other.ReplyCode.Length != 0) {
ReplyCode = other.ReplyCode;
}
if (other.RequestID.Length != 0) {
RequestID = other.RequestID;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -581,6 +648,10 @@ namespace MessageGeneratorGRPC {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
#endif
......@@ -600,6 +671,10 @@ namespace MessageGeneratorGRPC {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
}
......
......@@ -24,18 +24,19 @@ namespace MessageGeneratorGRPC {
static SchemaQReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChRQcm90b3Mvc2NoZW1hUS5wcm90bxIKVHJhbm1pdHRlciJ1CghNZXNzYWdl",
"MhIQCghjbGllbnRJRBgBIAEoCRIOCgZhcGlLZXkYAiABKAkSDQoFbXNnSWQY",
"AyABKAkSEwoLcGhvbmVOdW1iZXIYBCABKAkSFQoNbG9jYWxQcmlvcml0eRgF",
"IAEoBRIMCgR0ZXh0GAYgASgJIiUKEEFja25vd2xlZGdlbWVudDISEQoJcmVw",
"bHlDb2RlGAEgASgJMksKBVF1ZXVlEkIKDFF1ZXVlTWVzc2FnZRIULlRyYW5t",
"aXR0ZXIuTWVzc2FnZTIaHC5UcmFubWl0dGVyLkFja25vd2xlZGdlbWVudDJC",
"F6oCFE1lc3NhZ2VHZW5lcmF0b3JHUlBDYgZwcm90bzM="));
"ChRQcm90b3Mvc2NoZW1hUS5wcm90bxIKVHJhbm1pdHRlciKCAQoITWVzc2Fn",
"ZTISEAoIY2xpZW50SUQYASABKAkSDgoGYXBpS2V5GAIgASgJEg0KBW1zZ0lk",
"GAMgASgJEhMKC3Bob25lTnVtYmVyGAQgASgJEhUKDWxvY2FsUHJpb3JpdHkY",
"BSABKAUSDAoEdGV4dBgGIAEoCRILCgN0YWcYByABKAkiOAoQQWNrbm93bGVk",
"Z2VtZW50MhIRCglyZXBseUNvZGUYASABKAkSEQoJcmVxdWVzdElEGAIgASgJ",
"MksKBVF1ZXVlEkIKDFF1ZXVlTWVzc2FnZRIULlRyYW5taXR0ZXIuTWVzc2Fn",
"ZTIaHC5UcmFubWl0dGVyLkFja25vd2xlZGdlbWVudDJCF6oCFE1lc3NhZ2VH",
"ZW5lcmF0b3JHUlBDYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::MessageGeneratorGRPC.Message2), global::MessageGeneratorGRPC.Message2.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::MessageGeneratorGRPC.Acknowledgement2), global::MessageGeneratorGRPC.Acknowledgement2.Parser, new[]{ "ReplyCode" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::MessageGeneratorGRPC.Message2), global::MessageGeneratorGRPC.Message2.Parser, new[]{ "ClientID", "ApiKey", "MsgId", "PhoneNumber", "LocalPriority", "Text", "Tag" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::MessageGeneratorGRPC.Acknowledgement2), global::MessageGeneratorGRPC.Acknowledgement2.Parser, new[]{ "ReplyCode", "RequestID" }, null, null, null, null)
}));
}
#endregion
......@@ -83,6 +84,7 @@ namespace MessageGeneratorGRPC {
phoneNumber_ = other.phoneNumber_;
localPriority_ = other.localPriority_;
text_ = other.text_;
tag_ = other.tag_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -164,6 +166,18 @@ namespace MessageGeneratorGRPC {
}
}
/// <summary>Field number for the "tag" field.</summary>
public const int TagFieldNumber = 7;
private string tag_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Tag {
get { return tag_; }
set {
tag_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -185,6 +199,7 @@ namespace MessageGeneratorGRPC {
if (PhoneNumber != other.PhoneNumber) return false;
if (LocalPriority != other.LocalPriority) return false;
if (Text != other.Text) return false;
if (Tag != other.Tag) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -198,6 +213,7 @@ namespace MessageGeneratorGRPC {
if (PhoneNumber.Length != 0) hash ^= PhoneNumber.GetHashCode();
if (LocalPriority != 0) hash ^= LocalPriority.GetHashCode();
if (Text.Length != 0) hash ^= Text.GetHashCode();
if (Tag.Length != 0) hash ^= Tag.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -240,6 +256,10 @@ namespace MessageGeneratorGRPC {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -274,6 +294,10 @@ namespace MessageGeneratorGRPC {
output.WriteRawTag(50);
output.WriteString(Text);
}
if (Tag.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Tag);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -302,6 +326,9 @@ namespace MessageGeneratorGRPC {
if (Text.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Text);
}
if (Tag.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Tag);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -332,6 +359,9 @@ namespace MessageGeneratorGRPC {
if (other.Text.Length != 0) {
Text = other.Text;
}
if (other.Tag.Length != 0) {
Tag = other.Tag;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -371,6 +401,10 @@ namespace MessageGeneratorGRPC {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
#endif
......@@ -410,6 +444,10 @@ namespace MessageGeneratorGRPC {
Text = input.ReadString();
break;
}
case 58: {
Tag = input.ReadString();
break;
}
}
}
}
......@@ -453,6 +491,7 @@ namespace MessageGeneratorGRPC {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Acknowledgement2(Acknowledgement2 other) : this() {
replyCode_ = other.replyCode_;
requestID_ = other.requestID_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -474,6 +513,18 @@ namespace MessageGeneratorGRPC {
}
}
/// <summary>Field number for the "requestID" field.</summary>
public const int RequestIDFieldNumber = 2;
private string requestID_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string RequestID {
get { return requestID_; }
set {
requestID_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
......@@ -490,6 +541,7 @@ namespace MessageGeneratorGRPC {
return true;
}
if (ReplyCode != other.ReplyCode) return false;
if (RequestID != other.RequestID) return false;
return Equals(_unknownFields, other._unknownFields);
}
......@@ -498,6 +550,7 @@ namespace MessageGeneratorGRPC {
public override int GetHashCode() {
int hash = 1;
if (ReplyCode.Length != 0) hash ^= ReplyCode.GetHashCode();
if (RequestID.Length != 0) hash ^= RequestID.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
......@@ -520,6 +573,10 @@ namespace MessageGeneratorGRPC {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
......@@ -534,6 +591,10 @@ namespace MessageGeneratorGRPC {
output.WriteRawTag(10);
output.WriteString(ReplyCode);
}
if (RequestID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(RequestID);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
......@@ -547,6 +608,9 @@ namespace MessageGeneratorGRPC {
if (ReplyCode.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ReplyCode);
}
if (RequestID.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestID);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
......@@ -562,6 +626,9 @@ namespace MessageGeneratorGRPC {
if (other.ReplyCode.Length != 0) {
ReplyCode = other.ReplyCode;
}
if (other.RequestID.Length != 0) {
RequestID = other.RequestID;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
......@@ -581,6 +648,10 @@ namespace MessageGeneratorGRPC {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
#endif
......@@ -600,6 +671,10 @@ namespace MessageGeneratorGRPC {
ReplyCode = input.ReadString();
break;
}
case 18: {
RequestID = input.ReadString();
break;
}
}
}
}
......
......@@ -12,9 +12,9 @@ namespace QueuerNode.Helper
private const int sms_rates = 15;
private Queue<Message>[] messageQueue;// = new Queue<Message>[priority_levels];
private Queue<Message>[] messageQueue;
private object[] locks;// = new object[priority_levels];
private object[] locks;
public MessageQueues()
{
......@@ -25,8 +25,6 @@ namespace QueuerNode.Helper
messageQueue[i] = new Queue<Message>();
locks[i] = new object();
}
/*messageQueue = new Queue<Message>[priority_levels];
locks = new object[priority_levels];*/
}
public void addMessage(Message message)
......
using Steeltoe.Discovery.Client;
using Validator.Services;
var builder = WebApplication.CreateBuilder(args);
// Additional configuration is required to successfully run gRPC on macOS.
// For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682
// Add services to the container.
builder.Services.AddGrpc();
builder.Services.AddDiscoveryClient();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.MapGrpcService<ValidatorService>();
app.MapGet("/", () => "Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909");
app.Run();
{
"profiles": {
"Validator": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5205;https://localhost:9095",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
syntax = "proto3";
option csharp_namespace = "Validator";
package Validator;
service Validate {
rpc ValidateMessage (MessageMetaData) returns (Reply);
}
message MessageMetaData {
string clientID = 1;
string apiKey = 2;
string tag = 3;
}
message Reply {
string replyCode = 1;
int32 accountPriority = 2;
}
using Grpc.Core;
using Validator;
namespace Validator.Services
{
public class ValidatorService : Validate.ValidateBase
{
private readonly ILogger<ValidatorService> _logger;
public ValidatorService(ILogger<ValidatorService> logger)
{
_logger = logger;
}
public override Task<Reply> ValidateMessage(MessageMetaData messageMetaData , ServerCallContext context)
{
// do some work with /DataBase
return Task.FromResult(new Reply
{
ReplyCode = "OK ok 200 + validated !! ",
AccountPriority = 5
}) ;
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Protobuf Include="Protos\validator.proto" GrpcServices="Server" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.40.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.27.1" />
<PackageReference Include="Grpc.Net.Client" Version="2.63.0" />
<PackageReference Include="Grpc.Tools" Version="2.64.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<SteeltoeVersion>3.2.6</SteeltoeVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Steeltoe.Connector.ConnectorCore" Version="$(SteeltoeVersion)" />
<PackageReference Include="Steeltoe.Discovery.Eureka" Version="$(SteeltoeVersion)" />
</ItemGroup>
</Project>
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
{
"spring": {
"application": {
"name": "Validator"
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"eureka": {
"client": {
"serviceUrl": "http://localhost:8761/eureka/",
"shouldFetchRegistry": "false",
"shouldRegisterWithEureka": true,
"validateCertificates": false
}
},
"AllowedHosts": "*",
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
}
}
}
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