Skip to content

Commit 33acd97

Browse files
Ticket #63 : Update template projects + add eventmeshinmemory documentation
1 parent f44c13a commit 33acd97

File tree

23 files changed

+257
-112
lines changed

23 files changed

+257
-112
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,7 @@ docs/_build/
215215
wwwroot/
216216

217217
# Ignore DB
218-
*.db
218+
*.db
219+
220+
# Ignore Nuget
221+
Nuget.config

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>0.0.4</VersionPrefix>
3+
<VersionPrefix>0.0.5</VersionPrefix>
44
<Authors>SimpleIdServer</Authors>
55
<Owners>SimpleIdServer</Owners>
66
</PropertyGroup>

FaasNet.Templates.sln

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.29503.13
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01. Core", "01. Core", "{1064A767-7322-4A14-BFD4-97FDD40E76B4}"
7-
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03. Startup", "03. Startup", "{B0C38F6D-3F83-458A-A493-428AB3DD9F85}"
9-
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Runtime.Startup", "src\FaasNet.Runtime.Startup\FaasNet.Runtime.Startup.csproj", "{892918CD-9BE2-4023-9026-FAFE03BC77BE}"
11-
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Kubernetes", "src\FaasNet.Kubernetes\FaasNet.Kubernetes.csproj", "{2B6F7B44-91D5-44DD-8615-4EE8447F4839}"
13-
EndProject
14-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Runtime", "src\FaasNet.Runtime\FaasNet.Runtime.csproj", "{74F28744-9578-4547-8CE8-A388EFED1DB6}"
15-
EndProject
16-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "02. Functions", "02. Functions", "{E407AB8F-BDC8-4084-BE20-B4442CFE5EE9}"
17-
EndProject
18-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Runtime.GetSql", "src\FaasNet.Runtime.GetSql\FaasNet.Runtime.GetSql.csproj", "{39083E6B-D9AE-41A7-A364-82681B781A8B}"
19-
EndProject
20-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Runtime.Transform", "src\FaasNet.Runtime.Transform\FaasNet.Runtime.Transform.csproj", "{E1FBEF1B-892D-4F3B-ADB2-A150152F4E51}"
21-
EndProject
22-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Gateway.Core", "src\FaasNet.Gateway.Core\FaasNet.Gateway.Core.csproj", "{65DA8EDF-48A2-4AB5-B93A-6301718F1C1B}"
23-
EndProject
24-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Gateway.Startup", "src\FaasNet.Gateway.Startup\FaasNet.Gateway.Startup.csproj", "{24686604-17C3-4BBB-9B05-7668073546E2}"
25-
EndProject
26-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.CLI", "src\FaasNet.CLI\FaasNet.CLI.csproj", "{EDDFD04B-B4F0-47A6-8FD3-628F3F542402}"
27-
EndProject
28-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Common", "src\FaasNet.Common\FaasNet.Common.csproj", "{8B02C02D-EF1A-4F48-A69D-DC8592D966B9}"
29-
EndProject
30-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Website", "src\FaasNet.Website\FaasNet.Website.csproj", "{6B493287-F29B-4988-A21F-A32EF81DE717}"
31-
EndProject
32-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "04. Templates", "04. Templates", "{6CFE3CE6-8D78-4393-92C3-433EB75F5CF5}"
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01. Templates", "01. Templates", "{6CFE3CE6-8D78-4393-92C3-433EB75F5CF5}"
337
EndProject
348
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaasNet.Templates", "src\FaasNet.Templates\FaasNet.Templates.csproj", "{75F97048-1A5D-460A-9392-C982C9B6A0EF}"
359
EndProject
@@ -39,46 +13,6 @@ Global
3913
Release|Any CPU = Release|Any CPU
4014
EndGlobalSection
4115
GlobalSection(ProjectConfigurationPlatforms) = postSolution
42-
{892918CD-9BE2-4023-9026-FAFE03BC77BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43-
{892918CD-9BE2-4023-9026-FAFE03BC77BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
44-
{892918CD-9BE2-4023-9026-FAFE03BC77BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
45-
{892918CD-9BE2-4023-9026-FAFE03BC77BE}.Release|Any CPU.Build.0 = Release|Any CPU
46-
{2B6F7B44-91D5-44DD-8615-4EE8447F4839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47-
{2B6F7B44-91D5-44DD-8615-4EE8447F4839}.Debug|Any CPU.Build.0 = Debug|Any CPU
48-
{2B6F7B44-91D5-44DD-8615-4EE8447F4839}.Release|Any CPU.ActiveCfg = Release|Any CPU
49-
{2B6F7B44-91D5-44DD-8615-4EE8447F4839}.Release|Any CPU.Build.0 = Release|Any CPU
50-
{74F28744-9578-4547-8CE8-A388EFED1DB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51-
{74F28744-9578-4547-8CE8-A388EFED1DB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
52-
{74F28744-9578-4547-8CE8-A388EFED1DB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
53-
{74F28744-9578-4547-8CE8-A388EFED1DB6}.Release|Any CPU.Build.0 = Release|Any CPU
54-
{39083E6B-D9AE-41A7-A364-82681B781A8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55-
{39083E6B-D9AE-41A7-A364-82681B781A8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
56-
{39083E6B-D9AE-41A7-A364-82681B781A8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
57-
{39083E6B-D9AE-41A7-A364-82681B781A8B}.Release|Any CPU.Build.0 = Release|Any CPU
58-
{E1FBEF1B-892D-4F3B-ADB2-A150152F4E51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59-
{E1FBEF1B-892D-4F3B-ADB2-A150152F4E51}.Debug|Any CPU.Build.0 = Debug|Any CPU
60-
{E1FBEF1B-892D-4F3B-ADB2-A150152F4E51}.Release|Any CPU.ActiveCfg = Release|Any CPU
61-
{E1FBEF1B-892D-4F3B-ADB2-A150152F4E51}.Release|Any CPU.Build.0 = Release|Any CPU
62-
{65DA8EDF-48A2-4AB5-B93A-6301718F1C1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63-
{65DA8EDF-48A2-4AB5-B93A-6301718F1C1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
64-
{65DA8EDF-48A2-4AB5-B93A-6301718F1C1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
65-
{65DA8EDF-48A2-4AB5-B93A-6301718F1C1B}.Release|Any CPU.Build.0 = Release|Any CPU
66-
{24686604-17C3-4BBB-9B05-7668073546E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67-
{24686604-17C3-4BBB-9B05-7668073546E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
68-
{24686604-17C3-4BBB-9B05-7668073546E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
69-
{24686604-17C3-4BBB-9B05-7668073546E2}.Release|Any CPU.Build.0 = Release|Any CPU
70-
{EDDFD04B-B4F0-47A6-8FD3-628F3F542402}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
71-
{EDDFD04B-B4F0-47A6-8FD3-628F3F542402}.Debug|Any CPU.Build.0 = Debug|Any CPU
72-
{EDDFD04B-B4F0-47A6-8FD3-628F3F542402}.Release|Any CPU.ActiveCfg = Release|Any CPU
73-
{EDDFD04B-B4F0-47A6-8FD3-628F3F542402}.Release|Any CPU.Build.0 = Release|Any CPU
74-
{8B02C02D-EF1A-4F48-A69D-DC8592D966B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
75-
{8B02C02D-EF1A-4F48-A69D-DC8592D966B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
76-
{8B02C02D-EF1A-4F48-A69D-DC8592D966B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
77-
{8B02C02D-EF1A-4F48-A69D-DC8592D966B9}.Release|Any CPU.Build.0 = Release|Any CPU
78-
{6B493287-F29B-4988-A21F-A32EF81DE717}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
79-
{6B493287-F29B-4988-A21F-A32EF81DE717}.Debug|Any CPU.Build.0 = Debug|Any CPU
80-
{6B493287-F29B-4988-A21F-A32EF81DE717}.Release|Any CPU.ActiveCfg = Release|Any CPU
81-
{6B493287-F29B-4988-A21F-A32EF81DE717}.Release|Any CPU.Build.0 = Release|Any CPU
8216
{75F97048-1A5D-460A-9392-C982C9B6A0EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
8317
{75F97048-1A5D-460A-9392-C982C9B6A0EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
8418
{75F97048-1A5D-460A-9392-C982C9B6A0EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -88,16 +22,6 @@ Global
8822
HideSolutionNode = FALSE
8923
EndGlobalSection
9024
GlobalSection(NestedProjects) = preSolution
91-
{892918CD-9BE2-4023-9026-FAFE03BC77BE} = {B0C38F6D-3F83-458A-A493-428AB3DD9F85}
92-
{2B6F7B44-91D5-44DD-8615-4EE8447F4839} = {B0C38F6D-3F83-458A-A493-428AB3DD9F85}
93-
{74F28744-9578-4547-8CE8-A388EFED1DB6} = {1064A767-7322-4A14-BFD4-97FDD40E76B4}
94-
{39083E6B-D9AE-41A7-A364-82681B781A8B} = {E407AB8F-BDC8-4084-BE20-B4442CFE5EE9}
95-
{E1FBEF1B-892D-4F3B-ADB2-A150152F4E51} = {E407AB8F-BDC8-4084-BE20-B4442CFE5EE9}
96-
{65DA8EDF-48A2-4AB5-B93A-6301718F1C1B} = {1064A767-7322-4A14-BFD4-97FDD40E76B4}
97-
{24686604-17C3-4BBB-9B05-7668073546E2} = {B0C38F6D-3F83-458A-A493-428AB3DD9F85}
98-
{EDDFD04B-B4F0-47A6-8FD3-628F3F542402} = {B0C38F6D-3F83-458A-A493-428AB3DD9F85}
99-
{8B02C02D-EF1A-4F48-A69D-DC8592D966B9} = {1064A767-7322-4A14-BFD4-97FDD40E76B4}
100-
{6B493287-F29B-4988-A21F-A32EF81DE717} = {B0C38F6D-3F83-458A-A493-428AB3DD9F85}
10125
{75F97048-1A5D-460A-9392-C982C9B6A0EF} = {6CFE3CE6-8D78-4393-92C3-433EB75F5CF5}
10226
EndGlobalSection
10327
GlobalSection(ExtensibilityGlobals) = postSolution

default.ps1

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ task compile -depends clean {
4949
exec { msbuild -version }
5050

5151
exec { dotnet build .\FaasNet.sln -c $config --version-suffix=$buildSuffix }
52+
exec { dotnet build .\EventMesh.sln -c $config --version-suffix=$buildSuffix }
5253
}
5354

5455
task publishHelmAndWebsite {
@@ -133,10 +134,40 @@ task builderDockerImage -depends publish {
133134
exec { docker push simpleidserver/faasprometheus:0.0.4 }
134135
}
135136

137+
task packTemplate {
138+
exec { dotnet pack $source_dir\FaasNet.Templates\FaasNet.Templates.csproj -c $config --no-build --output $result_dir }
139+
}
140+
136141
task pack -depends release, compile {
137142
exec { dotnet pack $source_dir\FaasNet.Runtime\FaasNet.Runtime.csproj -c $config --no-build $versionSuffix --output $result_dir }
138-
# exec { dotnet pack $source_dir\FaasNet.Templates\FaasNet.Templates.csproj -c $config --no-build $versionSuffix --output $result_dir }
143+
exec { dotnet pack $source_dir\EventMesh.Runtime\EventMesh.Runtime.csproj -c $config --no-build $versionSuffix --output $result_dir }
144+
exec { dotnet pack $source_dir\EventMesh.Runtime.AMQP\EventMesh.Runtime.AMQP.csproj -c $config --no-build $versionSuffix --output $result_dir }
145+
exec { dotnet pack $source_dir\EventMesh.Runtime.EF\EventMesh.Runtime.EF.csproj -c $config --no-build $versionSuffix --output $result_dir }
146+
exec { dotnet pack $source_dir\EventMesh.Runtime.Kafka\EventMesh.Runtime.Kafka.csproj -c $config --no-build $versionSuffix --output $result_dir }
147+
}
148+
149+
task packNoSuffix -depends release, compile {
150+
exec { dotnet pack $source_dir\FaasNet.Runtime\FaasNet.Runtime.csproj -c $config --output $result_dir }
151+
exec { dotnet pack $source_dir\EventMesh.Runtime\EventMesh.Runtime.csproj -c $config --output $result_dir }
152+
exec { dotnet pack $source_dir\EventMesh.Runtime.AMQP\EventMesh.Runtime.AMQP.csproj -c $config --output $result_dir }
153+
exec { dotnet pack $source_dir\EventMesh.Runtime.EF\EventMesh.Runtime.EF.csproj -c $config --output $result_dir }
154+
exec { dotnet pack $source_dir\EventMesh.Runtime.Kafka\EventMesh.Runtime.Kafka.csproj -c $config --output $result_dir }
139155
}
140156

141-
task test {
157+
task test {
158+
Push-Location -Path $base_dir\tests\EventMesh.Runtime.Tests
159+
160+
try {
161+
exec { & dotnet test -c $config --no-build --no-restore }
162+
} finally {
163+
Pop-Location
164+
}
165+
166+
Push-Location -Path $base_dir\tests\FaasNet.Runtime.Tests
167+
168+
try {
169+
exec { & dotnet test -c $config --no-build --no-restore }
170+
} finally {
171+
Pop-Location
172+
}
142173
}

docs/documentation/eventmesh/concepts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Acts as a proxy between message brokers and clients.
88

99
## Client
1010

11-
Client can be any types of application which implements the EventMesh protocol.
11+
Client can be any types of application which implements the EventMesh protocol and who are interesting on publishing or receiving messages.
1212

1313
## Session
1414

@@ -20,9 +20,9 @@ There are two types of session :
2020
## Bridge
2121

2222
Link between two servers. When a bridge is established, messages can be transfered from one server to an another.
23-
Any clients with an active session can subscribe to one or more topics present in different brokers and those brokers can be hosted on different machines.
23+
Any client with an active session can subscribe to one or more topics present in different brokers and those brokers can be hosted on different machines.
2424

25-
The schema below shows a client who have active sessions on two EventMesh servers hosted on different machines.
25+
The schema below shows a client with active sessions on two EventMesh servers hosted on different machines.
2626
It has one active session which subscribed to the topic `Person.*`. Therefore the client can receive messages from two RabbitMQ brokers hosted on different machines.
2727

2828
![Bridge](images/eventmesh-2.png)
5.7 KB
Loading
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Installation
2+
3+
> [!NOTE]
4+
> The source code of this project can be found [here](https://github.com/simpleidserver/FaasNet/tree/master/samples/EventMeshServerInMemory).
5+
6+
An EventMesh Server can be hosted in a console application.
7+
8+
```
9+
mkdir QuickStart
10+
cd QuickStart
11+
12+
mkdir src
13+
cd src
14+
15+
dotnet new evtmeshinmem -n EventMeshServer
16+
```
17+
18+
A `Program.cs` file will be created. It is the application entry point. It contains the configuration of the EventMesh server like : `urn` and `port`.
19+
20+
In case the Visual Studio Support is needed, a solution can be created :
21+
22+
```
23+
cd ..
24+
dotnet new sln -n QuickStart
25+
```
26+
27+
Add the EventMesh server into the solution :
28+
29+
```
30+
dotnet sln add ./src/EventMeshServer/EventMeshServer.csproj
31+
```
32+
33+
Run the server. By default the server is listening on `localhost:4000`.
34+
35+
```
36+
cd src/EventMeshServer
37+
dotnet run
38+
```
39+
40+
![Architecture](images/installation-1.png)
41+
42+
## Listen topics
43+
44+
A client can subscribe to one or more topics and receive messages from them.
45+
46+
Topic subscription can be implemented by any type of DOTNET CORE applications.
47+
48+
First the Nuget package `EventMesh.Runtime` must be installed.
49+
50+
```
51+
dotnet add package EventMesh.Runtime`
52+
```
53+
54+
A session must be established with the server.
55+
56+
57+
```
58+
private static async Task<string> CreateSession(string clientId)
59+
{
60+
var helloResponse = await _runtimeClient.Hello(new UserAgent
61+
{
62+
ClientId = clientId,
63+
Environment = "TST",
64+
Password = "password",
65+
Pid = 2000,
66+
BufferCloudEvents = 1,
67+
Version = "0",
68+
Purpose = UserAgentPurpose.SUB
69+
});
70+
return helloResponse.SessionId;
71+
}
72+
```
73+
74+
TODO
75+
76+
## Publish messages
77+
78+
TODO

docs/documentation/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
items:
2323
- name: Concepts
2424
href: eventmesh/concepts.md
25+
- name: Installation
26+
href: eventmesh/installation.md
2527
- name: Protocol
2628
href: eventmesh/protocol.md
2729
- name: CLI
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30114.105
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B5CF35CA-56BA-4B02-9203-0A96AD268D74}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventMeshServer", "src\EventMeshServer\EventMeshServer.csproj", "{451E8741-AE59-4EA9-8FD3-337DE8697A58}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{451E8741-AE59-4EA9-8FD3-337DE8697A58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{451E8741-AE59-4EA9-8FD3-337DE8697A58}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{451E8741-AE59-4EA9-8FD3-337DE8697A58}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{451E8741-AE59-4EA9-8FD3-337DE8697A58}.Release|Any CPU.Build.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(NestedProjects) = preSolution
25+
{451E8741-AE59-4EA9-8FD3-337DE8697A58} = {B5CF35CA-56BA-4B02-9203-0A96AD268D74}
26+
EndGlobalSection
27+
GlobalSection(ExtensibilityGlobals) = postSolution
28+
SolutionGuid = {EB3C5596-5570-4E5E-81B9-7B4B7A72B418}
29+
EndGlobalSection
30+
EndGlobal
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net5.0</TargetFramework>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageReference Include="EventMesh.Runtime" Version="0.0.5" />
8+
</ItemGroup>
9+
</Project>

0 commit comments

Comments
 (0)