Skip to content

Commit 2654fe6

Browse files
committed
Enable services and enhance configuration settings
- Updated `appsettings.json` to enable `consul` and `fabio` services for both `api-gateway` and `orders-service`. - Increased random exception threshold in `GetProductHandler` from 20 to 90. - Set `httpClient` type to `fabio` and disabled request masking. - Added `openTelemetry` section for telemetry features with console and Azure exporter settings. - Changed JWT certificate from `.cer` to `.pfx` and increased `expiryMinutes` from 30 to 60, with several validation properties set to `false`. - Updated `swagger` version from `v01` to `v1`. - Introduced new `webApi` section to bind requests from the route. - Added `Logging` section to specify application log levels.
1 parent 1040881 commit 2654fe6

File tree

4 files changed

+58
-16
lines changed

4 files changed

+58
-16
lines changed

src/apps/api-gateway/Genocs.APIGateway/appsettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"displayVersion": true
99
},
1010
"consul": {
11-
"enabled": false,
11+
"enabled": true,
1212
"url": "http://localhost:8500",
1313
"service": "api-gateway",
1414
"address": "docker.for.mac.localhost",
@@ -20,7 +20,7 @@
2020
"requestRetries": 3
2121
},
2222
"fabio": {
23-
"enabled": false,
23+
"enabled": true,
2424
"url": "http://localhost:9999",
2525
"service": "api-gateway",
2626
"requestRetries": 3

src/apps/orders/Genocs.Orders.WebApi/appsettings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"displayVersion": true
99
},
1010
"consul": {
11-
"enabled": false,
11+
"enabled": true,
1212
"url": "http://localhost:8500",
1313
"service": "orders-service",
1414
"address": "docker.for.mac.localhost",
@@ -20,7 +20,7 @@
2020
"requestRetries": 3
2121
},
2222
"fabio": {
23-
"enabled": false,
23+
"enabled": true,
2424
"url": "http://localhost:9999",
2525
"service": "orders-service",
2626
"requestRetries": 3
@@ -29,7 +29,7 @@
2929
"type": "fabio",
3030
"retries": 3,
3131
"services": {
32-
"products": "https://localhost:5520"
32+
"products": "products-service"
3333
},
3434
"requestMasking": {
3535
"enabled": false,

src/apps/products/Genocs.Products.WebApi/Queries/Handlers/GetProductHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public GetProductHandler(IMongoDbBaseRepository<Domain.Product, Guid> repository
1919
{
2020
int currentValue = _random.Next(0, 100);
2121

22-
if (currentValue < 20)
22+
if (currentValue < 90)
2323
{
2424
throw new Exception("Random exception");
2525
}

src/apps/signalr/Genocs.SignalR.WebApi/appsettings.json

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
"requestRetries": 3
2727
},
2828
"httpClient": {
29-
"type": "",
29+
"type": "fabio",
3030
"retries": 3,
3131
"services": {
32-
"pricing": "localhost:5003"
32+
"pricing": "prices-service"
3333
},
3434
"requestMasking": {
35-
"enabled": true,
35+
"enabled": false,
3636
"maskTemplate": "*****"
3737
},
3838
"correlationIdHeader": "x-correlation-id"
@@ -91,22 +91,58 @@
9191
"maxQueueSize": 2048,
9292
"scheduledDelayMilliseconds": 5000,
9393
"exporterTimeoutMilliseconds": 30000,
94-
"maxExportBatchSize": 512
94+
"maxExportBatchSize": 512,
95+
"excludePaths": [
96+
"/",
97+
"/healthz",
98+
"/alive",
99+
"/metrics"
100+
]
101+
},
102+
"openTelemetry": {
103+
"enabled": true,
104+
"exporter": {
105+
"enabled": true,
106+
"otlpEndpoint": "http://localhost:4317",
107+
"protocol": "Grpc",
108+
"processorType": "Batch",
109+
"maxQueueSize": 2048,
110+
"scheduledDelayMilliseconds": 5000,
111+
"exporterTimeoutMilliseconds": 30000,
112+
"maxExportBatchSize": 512
113+
},
114+
"console": {
115+
"enabled": true,
116+
"enableTracing": true,
117+
"enableMetrics": true,
118+
"enableLogging": true
119+
},
120+
"azure": {
121+
"enabled": true,
122+
"enableTracing": true,
123+
"enableMetrics": true,
124+
"enableLogging": true,
125+
"connectionString": "InstrumentationKey=1496274b-bda7-4ac6-88ab-9f73b4d3c7b8;IngestionEndpoint=https://italynorth-0.in.applicationinsights.azure.com/;LiveEndpoint=https://italynorth.livediagnostics.monitor.azure.com/;ApplicationId=c417f66d-3611-48a2-80fe-5a6d302bed4f"
126+
}
95127
},
96128
"jwt": {
97129
"enabled": true,
98130
"allowAnonymousEndpoints": [],
99-
"certificate": {
100-
"location": "certs/localhost.cer",
131+
"_certificate": {
132+
"location": "certs/localhost.pfx",
101133
"password": "test",
102134
"rawData": ""
103135
},
104-
"expiryMinutes": 30,
136+
"expiryMinutes": 60,
105137
"issuer": "genocs-identity-service",
138+
"issuerSigningKey": "THIS IS USED TO SIGN AND VERIFY JWT TOKENS, REPLACE IT WITH YOUR OWN SECRET, IT CAN BE ANY STRING",
106139
"validIssuer": "genocs-identity-service",
107140
"validateAudience": false,
108-
"validateIssuer": true,
109-
"validateLifetime": true,
141+
"validateIssuer": false,
142+
"validateLifetime": false,
143+
"requireExpirationTime": false,
144+
"requireSignedTokens": false,
145+
"validateIssuerSigningKey": false,
110146
"expiry": "01:00:00"
111147
},
112148
"metrics": {
@@ -212,7 +248,7 @@
212248
"reDocEnabled": false,
213249
"name": "SignalR",
214250
"title": "SignalR Service",
215-
"version": "v01",
251+
"version": "v1",
216252
"description": "SignalR Service",
217253
"routePrefix": "swagger",
218254
"includeSecurity": true,
@@ -269,5 +305,11 @@
269305
},
270306
"webApi": {
271307
"bindRequestFromRoute": true
308+
},
309+
"Logging": {
310+
"LogLevel": {
311+
"Default": "Warning",
312+
"Microsoft.AspNetCore": "Warning"
313+
}
272314
}
273315
}

0 commit comments

Comments
 (0)