Compare commits

..
7 Commits
Author SHA1 Message Date
xrain 71acb35df9 cancle json refrence 2025-08-13 17:28:24 +08:00
xrain 67cc7346dc use concurrentDic 2025-05-17 21:17:43 +08:00
xrain 8627ae61fa use lock 2025-05-17 21:11:27 +08:00
xrain 02523028db add task.run 2025-05-17 20:40:48 +08:00
xrain 7d39ab5e0b add task.run 2025-05-17 20:38:39 +08:00
xrain 87fda473d3 udpate 2025-05-14 06:26:10 +08:00
xrain 4ae72d2e6b add CoceLoginProcessor 2025-01-17 01:30:13 +08:00
13 changed files with 236 additions and 152 deletions
@@ -1,14 +1,16 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using SimApi.Attributes;
using SimApi.CoceSdk;
using SimApi.Communications;
using SimApi.Controllers;
using SimApi.Helpers;
namespace SimApi.Controllers;
namespace SimApi.CoceSdk;
public class SimApiCoceController(CoceApp coce,SimApiAuth auth) : SimApiBaseController
public class CoceController(CoceApp coce, SimApiAuth auth, IServiceProvider sp) : SimApiBaseController
{
[HttpPost]
public SimApiBaseResponse<ConfigResponse> GetConfig()
@@ -33,8 +35,9 @@ public class SimApiCoceController(CoceApp coce,SimApiAuth auth) : SimApiBaseCont
{
Id = data.UserId,
Meta = meta,
Extra = groups
};
var processor = sp.GetService<ICoceLoginProcessor>();
processor?.Process(loginItem, groups.ToArray());
return new SimApiBaseResponse<string>(auth.Login(loginItem));
}
+9
View File
@@ -0,0 +1,9 @@
using System.Collections.Generic;
using SimApi.Communications;
namespace SimApi.CoceSdk;
public interface ICoceLoginProcessor
{
SimApiLoginItem Process(SimApiLoginItem loginItem, GroupInfo[] groups);
}
+4 -4
View File
@@ -7,8 +7,8 @@ namespace SimApi.Communications;
/// </summary>
public class SimApiLoginItem
{
public string? Id { get; set; }
public string[] Type { get; set; } = new[] { "user" };
public Dictionary<string, string>? Meta { get; set; } = null;
public object? Extra { get; set; } = null;
public string Id { get; set; } = null!;
public string[] Type { get; set; } = ["user"];
public Dictionary<string, string> Meta { get; set; } = new();
public object? Extra { get; set; }
};
+22 -19
View File
@@ -10,13 +10,7 @@ public class SimApiOptions
/// <summary>
/// 是否启用后台任务系统 *基于Hangfire
/// </summary>
public bool EnableJob { get; set; } = false;
/// <summary>
/// 启用全部Cors,对于开发前后分离的时候很有用。
/// default: true
/// </summary>
public bool EnableCors { get; set; } = true;
public bool EnableJob { get; set; }
/// <summary>
/// 启用SimApiAuth,一个简单的基于Header Token的认证方式。
@@ -24,13 +18,16 @@ public class SimApiOptions
/// </summary>
public bool EnableSimApiAuth { get; set; }
/// <summary>
/// 是否使用CoceSdk
/// </summary>
public bool EnableCoceSdk { get; set; }
public CoceAppSdkOption CoceSdkOptions { get; set; } = new();
/// <summary>
/// 开启S3兼容的存储系统。
/// default: false
/// </summary>
public bool EnableSimApiStorage { get; set; }
/// <summary>
/// 启用在线文档,启用后 访问 /swagger 可以查看对应的api文档。
@@ -38,6 +35,20 @@ public class SimApiOptions
/// </summary>
public bool EnableSimApiDoc { get; set; }
/// <summary>
/// 是否启用Synapse
/// </summary>
public bool EnableSynapse { get; set; }
/// <summary>
/// 启用全部Cors,对于开发前后分离的时候很有用。
/// default: true
/// </summary>
public bool EnableCors { get; set; } = true;
public CoceAppSdkOption CoceSdkOptions { get; set; } = new();
/// <summary>
/// 启用异常拦截,启用后,所有的异常将被通过json反馈。
/// default: true
@@ -49,11 +60,6 @@ public class SimApiOptions
/// </summary>
public bool EnableSimApiResponseFilter { get; set; } = true;
/// <summary>
/// 开启S3兼容的存储系统。
/// default: false
/// </summary>
public bool EnableSimApiStorage { get; set; }
/// <summary>
/// 开启ForwardHeaders,开启后可以透传负载均衡的Headers
@@ -67,16 +73,13 @@ public class SimApiOptions
/// </summary>
public bool EnableLowerUrl { get; set; } = true;
/// <summary>
/// 启用格式化的 Console Logger
/// default: false
/// </summary>
public bool EnableLogger { get; set; }
public bool EnableLogger { get; set; } = true;
/// <summary>
/// 是否启用Synapse
/// </summary>
public bool EnableSynapse { get; set; }
/// <summary>
/// 配置Job
+1 -3
View File
@@ -1,6 +1,4 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Text.Json;
using Microsoft.Extensions.Caching.Distributed;
using SimApi.Communications;
@@ -33,7 +31,7 @@ public class SimApiAuth(IDistributedCache cache)
public SimApiLoginItem? GetLogin(string token)
{
var login = cache.GetString(token);
return login != null ? JsonSerializer.Deserialize<SimApiLoginItem>(login) : default;
return login != null ? JsonSerializer.Deserialize<SimApiLoginItem>(login) : null;
}
/// <summary>
+1 -1
View File
@@ -5,7 +5,7 @@ namespace SimApi.Helpers;
public class SimApiCache(IDistributedCache cache)
{
private const string Prefix = "SimApi:Cache";
private const string Prefix = "SimApi:Cache:";
public void Set(string key, object value, DistributedCacheEntryOptions? options = null)
{
+1 -1
View File
@@ -14,7 +14,7 @@ public class SimApiJobWebAuth(string user, string pass) : IDashboardAuthorizatio
var authHeader = httpContext.Request.Headers["Authorization"].FirstOrDefault();
if (authHeader != null && authHeader.StartsWith("Basic "))
{
var encodedUsernamePassword = authHeader.Split(' ', 2, StringSplitOptions.RemoveEmptyEntries)[1]?.Trim();
var encodedUsernamePassword = authHeader.Split(' ', 2, StringSplitOptions.RemoveEmptyEntries)[1].Trim();
var decodedUsernamePassword = Encoding.UTF8.GetString(Convert.FromBase64String(encodedUsernamePassword));
var username = decodedUsernamePassword.Split(':', 2)[0];
var password = decodedUsernamePassword.Split(':', 2)[1];
+35 -1
View File
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
@@ -7,6 +8,7 @@ using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Text.Unicode;
using System.Xml.Serialization;
namespace SimApi.Helpers;
@@ -22,6 +24,7 @@ public static class SimApiUtil
/// </summary>
public static JsonSerializerOptions JsonOption => new()
{
ReferenceHandler = ReferenceHandler.Preserve,
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All),
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
@@ -62,12 +65,43 @@ public static class SimApiUtil
return stringBuilder.ToString();
}
/// <summary>
/// sha1加密字符串
/// </summary>
/// <param name="source">源字符串</param>
/// <param name="mode">加密结果"x2"结果为32位,"x3"结果为48位,"x4"结果为64位</param>
/// <returns></returns>
public static string Sha1(string source, string mode = "x2")
{
var hash = SHA1.HashData(Encoding.UTF8.GetBytes(source));
var sb = new StringBuilder(hash.Length * 2);
foreach (var b in hash)
{
sb.Append(b.ToString(mode));
}
return sb.ToString();
}
/// <summary>
/// 将XML字符串序列化为对象
/// </summary>
/// <param name="source"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static T XmlDeserialize<T>(string source)
{
var xmlConvertor = new XmlSerializer(typeof(T));
using var reader = new StringReader(source);
return (T)xmlConvertor.Deserialize(reader)!;
}
/// <summary>
/// 将对象序列化成JSON (控制台输出中文不会被编码)
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public static string Json(object obj)
public static string Json(object? obj)
{
return JsonSerializer.Serialize(obj, JsonOption);
}
+5 -5
View File
@@ -23,14 +23,14 @@
<Folder Include="Exceptions\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.17" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.18" />
<PackageReference Include="Hangfire.Console" Version="1.4.3" />
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.9.4" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.1" />
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.12.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.5" />
<PackageReference Include="Minio" Version="6.0.4" />
<PackageReference Include="MQTTnet" Version="5.0.1.1416" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="8.1.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="8.1.1" />
</ItemGroup>
<ProjectExtensions>
<MonoDevelop>
+37 -7
View File
@@ -3,6 +3,7 @@ using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
using Hangfire;
using Hangfire.Console;
using Hangfire.Redis.StackExchange;
@@ -246,7 +247,11 @@ public static class SimApiExtensions
if (simApiOptions.EnableSimApiResponseFilter)
{
builder.AddControllers(opt => opt.Filters.Add<SimApiResponseFilter>())
.AddJsonOptions(opt => opt.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase);
.AddXmlSerializerFormatters()
.AddJsonOptions(opt =>
{
opt.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
});
}
builder.AddSingleton(simApiOptions);
@@ -319,6 +324,7 @@ public static class SimApiExtensions
if (options.EnableSimApiResponseFilter)
{
logger.LogInformation("开始配置SimApiResponseFilter...");
builder.MapControllers();
}
if (options.EnableSimApiAuth)
@@ -326,22 +332,46 @@ public static class SimApiExtensions
logger.LogInformation("开始配置SimApiAuth...");
builder.UseMiddleware<SimApiAuthMiddleware>();
builder.MapControllerRoute(name: "GetUserInfo", pattern: "/user/info",
defaults: new { controller = "SimApiCommon", action = "UserInfo" });
defaults: new
{
controller = "SimApiCommon",
action = "UserInfo"
});
builder.MapControllerRoute(name: "CheckLogin", pattern: "/auth/check",
defaults: new { controller = "SimApiCommon", action = "CheckLogin" });
defaults: new
{
controller = "SimApiCommon",
action = "CheckLogin"
});
builder.MapControllerRoute(name: "Logout", pattern: "/auth/logout",
defaults: new { controller = "SimApiCommon", action = "Logout" });
defaults: new
{
controller = "SimApiCommon",
action = "Logout"
});
if (options.EnableCoceSdk)
{
logger.LogInformation("开始配置CoceAppSdk...\nApi入口: {ApiUrl}\nAuth入口:{AuthUrl}n\nAppId: {AppId}",
options.CoceSdkOptions.ApiEndpoint, options.CoceSdkOptions.AuthEndpoint,
options.CoceSdkOptions.AppId);
builder.MapControllerRoute(name: "LoginUseCoce", pattern: "/auth/login",
defaults: new { controller = "SimApiCoce", action = "Login" });
defaults: new
{
controller = "Coce",
action = "Login"
});
builder.MapControllerRoute(name: "LoginUseCoce", pattern: "/user/groups",
defaults: new { controller = "SimApiCoce", action = "ListGroups" });
defaults: new
{
controller = "Coce",
action = "ListGroups"
});
builder.MapControllerRoute(name: "LoginUseCoce", pattern: "/auth/config",
defaults: new { controller = "SimApiCoce", action = "GetConfig" });
defaults: new
{
controller = "Coce",
action = "GetConfig"
});
}
}
+31 -28
View File
@@ -19,39 +19,42 @@ public partial class Synapse
{
Client!.ApplicationMessageReceivedAsync += async e =>
{
if (!e.ApplicationMessage.Topic.StartsWith(EventServerTopicPrefix)) return;
var reqBody = e.ApplicationMessage.ConvertPayloadToString();
var eventName = e.ApplicationMessage.Topic.Replace(EventServerTopicPrefix, string.Empty);
logger.LogDebug("Synapse Event Receive: {EventName}\n{Body}", eventName, reqBody);
var methods = EventRegistry
.Where(x => Regex.IsMatch(eventName,
"^" + Regex.Escape(x.Key!).Replace("\\+", "[^/]+").Replace("\\#", ".*") + "$"))
.ToArray();
var tasks = methods.Select(method => Task.Run(() =>
{
var callClass = sp.CreateScope().ServiceProvider.GetRequiredService(method.Class!);
var mt = callClass.GetType().GetMethod(method.Method!);
try
await Task.Run(async () =>
{
if (!e.ApplicationMessage.Topic.StartsWith(EventServerTopicPrefix)) return;
var reqBody = e.ApplicationMessage.ConvertPayloadToString();
var eventName = e.ApplicationMessage.Topic.Replace(EventServerTopicPrefix, string.Empty);
logger.LogDebug("Synapse Event Receive: {EventName}\n{Body}", eventName, reqBody);
var methods = EventRegistry
.Where(x => Regex.IsMatch(eventName,
"^" + Regex.Escape(x.Key!).Replace("\\+", "[^/]+").Replace("\\#", ".*") + "$"))
.ToArray();
var tasks = methods.Select(method => Task.Run(() =>
{
if (mt!.GetParameters().Length == 2)
var callClass = sp.CreateScope().ServiceProvider.GetRequiredService(method.Class!);
var mt = callClass.GetType().GetMethod(method.Method!);
try
{
var pt = mt.GetParameters()[1].ParameterType;
mt.Invoke(callClass, pt == typeof(string)
? new object?[] { eventName, reqBody }
: new object?[] { eventName, JsonSerializer.Deserialize(reqBody, pt, SimApiUtil.JsonOption) });
if (mt!.GetParameters().Length == 2)
{
var pt = mt.GetParameters()[1].ParameterType;
mt.Invoke(callClass, pt == typeof(string)
? [eventName, reqBody]
: [eventName, JsonSerializer.Deserialize(reqBody, pt, SimApiUtil.JsonOption)]);
}
else
{
mt.Invoke(callClass, new object[] { eventName });
}
}
else
catch (Exception ex)
{
mt.Invoke(callClass, new object[] { eventName });
logger.LogError("Synapse Event Processor Error: {Err}\n{Stack}", ex.Message, ex.StackTrace);
}
}
catch (Exception ex)
{
logger.LogError("Synapse Event Processor Error: {Err}\n{Stack}", ex.Message, ex.StackTrace);
}
}))
.ToList();
await Task.WhenAll(tasks);
}))
.ToList();
await Task.WhenAll(tasks);
});
};
SubEventServerTopic();
}
+5 -5
View File
@@ -1,20 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using MQTTnet;
using MQTTnet.Packets;
using SimApi.Communications;
using SimApi.Helpers;
using System.Collections.Concurrent;
namespace SimApi;
public partial class Synapse
{
private Dictionary<string, TaskCompletionSource<string>> ResponseCompletionSources { get; } = new();
private ConcurrentDictionary<string, TaskCompletionSource<string>> ResponseCompletionSources { get; } = new();
private string EventClientTopicPrefix => $"{Options.SysName}/{Options.AppName}/rpc/client/{Options.AppId}/";
@@ -27,7 +26,7 @@ public partial class Synapse
var messageId = e.ApplicationMessage.Topic.Replace(EventClientTopicPrefix, string.Empty);
if (!ResponseCompletionSources.TryGetValue(messageId, out var tcs)) return Task.CompletedTask;
tcs.SetResult(reqBody);
ResponseCompletionSources.Remove(messageId);
ResponseCompletionSources.Remove(messageId, out _);
return Task.CompletedTask;
};
SubRpcClientTopic();
@@ -43,6 +42,7 @@ public partial class Synapse
private string? FireRpc(string app, string action, object? param, Dictionary<string, string>? headers = null,
int? timeout = null)
{
// 移除锁语句
string paramJson;
if (param is string strParam)
{
@@ -56,7 +56,7 @@ public partial class Synapse
var topic = $"{Options.SysName}/{app}/rpc/server/{action}";
var messageId = Guid.NewGuid().ToString();
var tcs = new TaskCompletionSource<string>();
ResponseCompletionSources.Add(messageId, tcs);
ResponseCompletionSources.TryAdd(messageId, tcs);
var messageBuilder = new MqttApplicationMessageBuilder()
.WithTopic(topic)
.WithPayload(paramJson)
+77 -73
View File
@@ -20,91 +20,95 @@ public partial class Synapse
private void RunRpcServer()
{
Client!.ApplicationMessageReceivedAsync += e =>
Client!.ApplicationMessageReceivedAsync += async e =>
{
if (!e.ApplicationMessage.Topic.StartsWith(RpcServerTopicPrefix)) return Task.CompletedTask;
var reqBody = e.ApplicationMessage.ConvertPayloadToString();
var action = e.ApplicationMessage.Topic.Replace(RpcServerTopicPrefix, string.Empty);
var appInfo = e.ApplicationMessage.ResponseTopic.Split(",");
logger.LogDebug(
"Synapse RPC Server Receive: ({BasicPropertiesMessageId}) {BasicPropertiesReplyTo} -> {BasicPropertiesType}@{OptionsAppName}\n{S}",
appInfo[2], appInfo[0], action, Options.AppName, reqBody);
SimApiBaseResponse res;
var method = RpcRegistry.FirstOrDefault(x => x.Key == action);
if (method == null)
await Task.Run(() =>
{
res = new SimApiBaseResponse(404, "method not found");
}
else
{
var callClass = sp.CreateScope().ServiceProvider.GetRequiredService(method.Class!);
var mt = callClass.GetType().GetMethod(method.Method!);
try
if (!e.ApplicationMessage.Topic.StartsWith(RpcServerTopicPrefix)) return;
var reqBody = e.ApplicationMessage.ConvertPayloadToString();
var action = e.ApplicationMessage.Topic.Replace(RpcServerTopicPrefix, string.Empty);
var appInfo = e.ApplicationMessage.ResponseTopic.Split(",");
logger.LogDebug(
"Synapse RPC Server Receive: ({BasicPropertiesMessageId}) {BasicPropertiesReplyTo} -> {BasicPropertiesType}@{OptionsAppName}\n{S}",
appInfo[2], appInfo[0], action, Options.AppName, reqBody);
SimApiBaseResponse res;
var method = RpcRegistry.FirstOrDefault(x => x.Key == action);
if (method == null)
{
var methodParams = mt!.GetParameters();
object? ret;
switch (methodParams.Length)
{
case 1:
var pt = mt.GetParameters()[0].ParameterType;
var param = pt == typeof(string)
? [reqBody]
: new[] { JsonSerializer.Deserialize(reqBody, pt, SimApiUtil.JsonOption) };
ret = mt.Invoke(callClass, param);
break;
case 2:
var headerData =
e.ApplicationMessage.UserProperties.ToDictionary(x => x.Name, x => x.Value);
var pt2 = mt.GetParameters()[0].ParameterType;
var param2 = pt2 == typeof(string)
? [reqBody]
: new[] { JsonSerializer.Deserialize(reqBody, pt2, SimApiUtil.JsonOption), headerData };
ret = mt.Invoke(callClass, param2);
break;
default:
ret = mt.Invoke(callClass, []);
break;
}
res = new SimApiBaseResponse<object?>
{
Data = ret
};
res = new SimApiBaseResponse(404, "method not found");
}
catch (TargetInvocationException ex)
else
{
if (ex.InnerException is SimApiException ie)
var callClass = sp.CreateScope().ServiceProvider.GetRequiredService(method.Class!);
var mt = callClass.GetType().GetMethod(method.Method!);
try
{
logger.LogDebug("Synapse RPC调用错误: {Err}", ie.Message);
res = new SimApiBaseResponse(ie.Code, ie.Message);
var methodParams = mt!.GetParameters();
object? ret;
switch (methodParams.Length)
{
case 1:
var pt = mt.GetParameters()[0].ParameterType;
var param = pt == typeof(string)
? [reqBody]
: new[] { JsonSerializer.Deserialize(reqBody, pt, SimApiUtil.JsonOption) };
ret = mt.Invoke(callClass, param);
break;
case 2:
var headerData =
e.ApplicationMessage.UserProperties.ToDictionary(x => x.Name, x => x.Value);
var pt2 = mt.GetParameters()[0].ParameterType;
var param2 = pt2 == typeof(string)
? [reqBody]
: new[]
{
JsonSerializer.Deserialize(reqBody, pt2, SimApiUtil.JsonOption), headerData
};
ret = mt.Invoke(callClass, param2);
break;
default:
ret = mt.Invoke(callClass, []);
break;
}
res = new SimApiBaseResponse<object?>
{
Data = ret
};
}
else
catch (TargetInvocationException ex)
{
logger.LogError("Synapse RPC 方法异常: {Err}\n{Stack}", ex.Message, ex.StackTrace);
if (ex.InnerException is SimApiException ie)
{
logger.LogDebug("Synapse RPC调用错误: {Err}", ie.Message);
res = new SimApiBaseResponse(ie.Code, ie.Message);
}
else
{
logger.LogError("Synapse RPC 方法异常: {Err}\n{Stack}", ex.Message, ex.StackTrace);
res = new SimApiBaseResponse(500, ex.Message);
}
}
catch (Exception ex)
{
logger.LogDebug("Synapse RPC调用失败: {Err}", ex.Message);
res = new SimApiBaseResponse(500, ex.Message);
}
}
catch (Exception ex)
{
logger.LogDebug("Synapse RPC调用失败: {Err}", ex.Message);
res = new SimApiBaseResponse(500, ex.Message);
}
}
var returnJson = JsonSerializer.Serialize((object)res, SimApiUtil.JsonOption);
var reply = $"{Options.SysName}/{appInfo[0]}/rpc/client/{appInfo[1]}/{appInfo[2]}";
var message = new MqttApplicationMessageBuilder()
.WithTopic(reply)
.WithPayload(returnJson)
.WithRetainFlag(false)
.Build();
if (!Client.IsConnected) return Task.CompletedTask;
Client.PublishAsync(message, CancellationToken.None).Wait();
logger.LogDebug(
"Synapse Rpc Server Return: ({BasicPropertiesMessageId}) {BasicPropertiesType}@{OptionsAppName} -> {BasicPropertiesReplyTo}\n{ReturnJson}",
appInfo[2], action, Options.AppName, appInfo[0], returnJson);
return Task.CompletedTask;
var returnJson = JsonSerializer.Serialize((object)res, SimApiUtil.JsonOption);
var reply = $"{Options.SysName}/{appInfo[0]}/rpc/client/{appInfo[1]}/{appInfo[2]}";
var message = new MqttApplicationMessageBuilder()
.WithTopic(reply)
.WithPayload(returnJson)
.WithRetainFlag(false)
.Build();
if (!Client.IsConnected) return;
Client.PublishAsync(message, CancellationToken.None).Wait();
logger.LogDebug(
"Synapse Rpc Server Return: ({BasicPropertiesMessageId}) {BasicPropertiesType}@{OptionsAppName} -> {BasicPropertiesReplyTo}\n{ReturnJson}",
appInfo[2], action, Options.AppName, appInfo[0], returnJson);
});
};
SubRpcServerTopic();
}