Sign inSign up

ponylin1985/zayni3.client.app

By ponylin1985

•Updated almost 7 years ago

Image
0

110

ponylin1985/zayni3.client.app repository overview

This is a Zayni Framework's Middle.Service.Client module test application image.

More detail or example please go to here⁠.

⁠docker-compose.yml
version: "3"

services:
  service-host-clientside-console:
    image: zayni.client.app:alpine-x64
    volumes:
      - ~/GitRepo/MyGitLab/ZayniFramework/Test/ServiceHostTest/ServiceHost.Client.ConsoleApp/serviceClientConfig.json:/app/serviceClientConfig.json
      - ~/GitRepo/MyGitLab/ZayniFramework/Test/ServiceHostTest/ServiceHost.Client.ConsoleApp/app.config:/app/ServiceHost.Client.ConsoleApp.dll.config
      - ~/ApplicationLog/ServiceHost.ClientSide.ConsoleApp:/app/Log
    ports:
      - 2223:2223   # Remote Telnet Command Service port
    container_name: zayni.client.app.test.alpine
⁠app.config Example
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="ZayniFramework" type="ZayniFramework.Common.ZayniConfigSection, ZayniFramework.Common"/>
    </configSections>
    <ZayniFramework>
        <LoggingSettings eventLogEnable="false" logEnable="true">
            <DefaultTextLogger>
                <add name="_DefaultLog" enable="false" maxSize="8" consoleOutput="true" consoleColor="Yellow">
                    <!-- ZayniFramework框架預設的文字日誌檔 -->
                    <LogFile path="Log/Zayni/Tracing.log"/>
                    <Filter filterType="deny" category="Information,Warning"/>
                </add>
                <add name="RedisCacheTrace" enable="false" maxSize="8">
                    <!-- ZaynigFramework Caching 模組對 Redis 請求回應的日誌紀錄 -->
                    <LogFile path="Log/Zayni/Redis-Tracing.log"/>
                    <!--<Filter filterType="deny" category="Information,Warning" />-->
                </add>
                <add name="ServiceHostTrace" enable="true" maxSize="8" consoleOutput="true" consoleColor="Green">
                    <!-- ZaynigFramework Middle Service 的文字日誌記錄 -->
                    <LogFile path="Log/Zayni/Middle.ServiceClient-Tracing.log"/>
                    <!-- <Filter filterType="deny" category="Information,Warning"/> -->
                </add>
            </DefaultTextLogger>
        </LoggingSettings>
        <CachingSettings managerMode="RemoteCache">
            <CachePool resetEnable="false" cleanerIntervalSecond="3" maxCapacity="10000" refreshIntervalMinute="1"/>
            <CacheData timeoutInterval="0"/>
            <RedisCache>
                <add name="Local-Dev" isDefault="true" dbActionLog="true" host="localhost" port="6379" password="" dbNumber="10" responseTimeout="50000"/>
            </RedisCache>
            <RemoteCache defaultCacheClientName="Remote.ShareData"></RemoteCache>
        </CachingSettings>
        <DataAccessSettings>
            <DatabaseProviders>
                <add name="Zayni" dataBaseProvider="MySQL" sqlLogEnable="true"/>
                <add name="ZayniUnitTest" dataBaseProvider="MySQL" sqlLogEnable="true"/>
            </DatabaseProviders>
        </DataAccessSettings>
    </ZayniFramework>
    <appSettings>
        <add key="TelnetServerPort" value="2223" />
        <add key="TelnetServerPassword" value="Admin123" />
        <add key="WebAPIUrl" value="http://localhost:5000/values" />
    </appSettings>
    <connectionStrings>
        <!-- MySQL資料庫連線字串: 個人開發環境 (如果是連 MySQL 8.0 以後版本,要加上 SslMode=none)-->
        <add name="Zayni" connectionString="SERVER=localhost;DATABASE=zayni;UID=pony;PASSWORD=Admin123;Allow User Variables=True;Charset=utf8;Convert Zero Datetime=True;SslMode=none" 
             providerName="MySql.Data.MySqlClient"/>
        <add name="ZayniUnitTest" connectionString="SERVER=localhost;DATABASE=zayni;UID=pony;PASSWORD=Admin123;Allow User Variables=True;Charset=utf8;Convert Zero Datetime=True;SslMode=none" 
             providerName="MySql.Data.MySqlClient"/>
    </connectionStrings>
</configuration>
⁠serviceClientConfig.json Example
{
    "serviceClients": [
        {
            "serviceClientName": "ServiceHost.Test.Client",
            "remoteServiceName": "WebAPI.Test.TCPSocket",
            "remoteHostType": "TCPSocket",
            "remoteClient": "Local-Dev",
            "enableActionLogToDB": true
        },
        {
            "serviceClientName": "Remote.ShareData",
            "remoteServiceName": "RemoteCache-UnitTest-gRPC",
            "remoteHostType": "gRPC",
            "remoteClient": "Local-Dev3",
            "enableActionLogToDB": true
        }
    ],
    "gRPCProtocol": {
        "remoteClients": [
            {
                "name": "Local-Dev",
                "serverHost": "localhost",
                "serverPort": 1110
            },
            {
                "name": "Local-Dev2",
                "serverHost": "localhost",
                "serverPort": 1111
            },
            {
                "name": "Local-Dev3",
                "serverHost": "localhost",
                "serverPort": 5555
            }
        ]
    },
    "rabbitMQProtocol": {
        "defaultRemoteClient": "Local-Dev",
        "remoteClients": [
            {
                "name": "Local-Dev",
                "mbHost": "localhost",
                "mbPort": 5672,
                "mbUserId": "pony",
                "mbPassword": "Admin123",
                "mbVHost": "ZayniTest",
                "defaultExchange": "Middle.Test.Topic",
                "rpc": {
                    "exchange": "Middle.Test.Topic",
                    "routingKey": "RPC.Server.",
                    "rpcReplyQueue": "Middle.Server.RPC.Res",
                    "rcpResponseTimeout": 5
                },
                "publish": {
                    "exchange": "Middle.Test.Topic",
                    "routingKey": "Event.Client."
                },
                "listen": {
                    "msgQueue": "Middle.Client.ListenServer.Msg",
                    "msgRoutingKey": "Event.Server."
                }
            }
        ]
    },
    "tcpSocketProtocol": {
        "defaultRemoteClient": "Local-Dev",
        "remoteClients": [
            {
                "name": "Local-Dev",
                "tcpMsgEndsWith": "u0003",
                "tcpServerHost": "localhost",
                "tcpServerPort": 5590,
                "tcpSendBufferSize": 5,
                "tcpReceiveBufferSize": 5,
                "connectionTimeout": 1,
                "tcpResponseTimeout": 1
            },
            {
                "name": "Local-Dev2",
                "tcpMsgEndsWith": "u0003",
                "tcpServerHost": "localhost",
                "tcpServerPort": 5591,
                "tcpSendBufferSize": 5,
                "tcpReceiveBufferSize": 5,
                "connectionTimeout": 2,
                "tcpResponseTimeout": 1
            },
            {
                "name": "Local-Dev3",
                "tcpMsgEndsWith": "u0003",
                "tcpServerHost": "localhost",
                "tcpServerPort": 5592,
                "tcpSendBufferSize": 5,
                "tcpReceiveBufferSize": 5,
                "connectionTimeout": 2,
                "tcpResponseTimeout": 1
            }
        ]
    },
    "webSocketProtocol": {
        "defaultRemoteClient": "Local-Dev",
        "remoteClients": [
            {
                "name": "Local-Dev",
                "webSocketHostBaseUrl": "ws://localhost:5580",
                "wsResponseTimeout": 5
            },
            {
                "name": "Local-Dev2",
                "webSocketHostBaseUrl": "ws://localhost:5581",
                "wsResponseTimeout": 5
            },
            {
                "name": "Local-Dev3",
                "webSocketHostBaseUrl": "ws://localhost:5582",
                "wsResponseTimeout": 5
            }
        ]
    },
    "httpCoreProtocol": {
        "remoteClients": [
            {
                "name": "Local-Dev",
                "httpHostUrl": "http://localhost:5100/action",
                "httpResponseTimeout": 5
            },
            {
                "name": "Local-Dev2",
                "httpHostUrl": "http://localhost:5110/action",
                "httpResponseTimeout": 5
            }
        ]
    }
}

Tag summary

Content type

Image

Digest

Size

64.3 MB

Last updated

almost 7 years ago

docker pull ponylin1985/zayni3.client.app:alpine-x64