Skip to content

Commit c1fc732

Browse files
authored
Update samples v4 (#346)
* Extract non-management improvements from #343 * Reduce logging in ConfigServer sample (output flooded by placeholder logs otherwise) * Update SBA port number
1 parent e8a233a commit c1fc732

23 files changed

+137
-185
lines changed

CommonTasks.md

+57-54
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,37 @@
22

33
This page contains information on basic tasks that are used throughout the Steeltoe Samples. Use this page to quickly get your local development environment up and running.
44

5+
Containers images produced by the Steeltoe team (all images hosted at `steeltoe.azurecr.io`) are *For local development purposes only*. Images are generally very basic and formal support should not be expected. To see how the images are built and/or participate in improving them, visit [this repository](https://github.com/SteeltoeOSS/Dockerfiles).
6+
7+
Feel free to modify these commands as needed, knowing that commands provided in this document will result in:
8+
9+
* The latest available (tag-matching) image being used: `--pull=always`
10+
* Servers that are automatically removed when the container is stopped: `--rm`
11+
* An attached pseudo-TTY with STDIN kept open: `-it` [read more](https://docs.docker.com/reference/cli/docker/container/run/#tty)
12+
* Published ports: `-p <hostPort>:<containerPort>`
13+
* Named containers: `--name <name>`. If the command has Steeltoe-specific configuration and/or the image was built by the Steeltoe team, the name starts with 'steeltoe-'
14+
515
## Spring Cloud Config Server
616

717
### Run SCCS with Docker
818

9-
The Steeltoe team has built a docker image of a [basic Config server](https://github.com/SteeltoeOSS/Dockerfiles/tree/main/config-server) for an easy experience getting started
10-
1119
To start a config server backed by the Spring Cloud Samples repo:
1220

13-
```bash
14-
docker run --rm -ti -p 8888:8888 --name steeltoe-config steeltoeoss/config-server
21+
```shell
22+
docker run --rm -it --pull=always -p 8888:8888 --name steeltoe-config steeltoe.azurecr.io/config-server
1523
```
1624

1725
To start a config server backed by a folder on your local disk, start the docker image like this:
1826

19-
```bash
27+
```shell
2028
# Note: Ensure Docker is configured to share host drive/volume so the mount below will work correctly!
21-
docker run --rm -ti -p 8888:8888 -v $PWD/steeltoe/config-repo:/config --name steeltoe-config steeltoeoss/configserver --spring.profiles.active=native
29+
docker run --rm -it --pull=always -p 8888:8888 -v $PWD/steeltoe/config-repo:/config --name steeltoe-config steeltoe.azurecr.io/configserver --spring.profiles.active=native
2230
```
2331

2432
To start a config server that registers itself with Eureka at startup (discovery-first):
2533

26-
```bash
27-
docker run --rm -ti -p 8888:8888 --name steeltoe-config -e eureka.client.enabled=true steeltoeoss/config-server
34+
```shell
35+
docker run --rm -it --pull=always -p 8888:8888 --name steeltoe-config -e eureka.client.enabled=true steeltoe.azurecr.io/config-server
2836
```
2937

3038
### Run SCCS with Java
@@ -53,14 +61,10 @@ Use the [cf cli](https://github.com/cloudfoundry/cli) to create a Spring Cloud C
5361

5462
### Run Eureka with Docker
5563

56-
The Steeltoe team has built a docker image of a [basic Eureka server](https://github.com/SteeltoeOSS/Dockerfiles/tree/main/eureka-server) for an easy experience getting started:
57-
58-
```bash
59-
docker run --rm -ti -p 8761:8761 --name steeltoe-eureka steeltoeoss/eureka-server
64+
```shell
65+
docker run --rm -it --pull=always -p 8761:8761 --name steeltoe-eureka steeltoe.azurecr.io/eureka-server
6066
```
6167

62-
### Run Eureka with Java
63-
6468
### Provision Eureka on Cloud Foundry
6569

6670
Use the [cf cli](https://github.com/cloudfoundry/cli) to create a Service Registry service in a org/space.
@@ -69,72 +73,71 @@ Use the [cf cli](https://github.com/cloudfoundry/cli) to create a Service Regist
6973
1. cf create-service p.service-registry standard myDiscoveryServiceInstanceName
7074
1. Wait for service to be ready. (use `cf services` to check the status)
7175

72-
## RabbitMQ
73-
74-
### Run RabbitMQ Server with Docker
76+
## Spring Boot Admin
7577

76-
This command starts a RabbitMQ server with the management plugin enabled with no credentials and default ports:
78+
### Run Spring Boot Admin Server with Docker
7779

78-
```script
79-
docker run --rm -ti -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3-management
80+
```shell
81+
docker run --rm -it --pull=always -p 9099:9099 --name steeltoe-SpringBootAdmin steeltoe.azurecr.io/spring-boot-admin
8082
```
8183

82-
## Consul
84+
## HashiCorp Consul
8385

84-
### Run Consul Server with Docker
86+
### Run HashiCorp Consul Server with Docker
8587

86-
```script
87-
docker run --rm -ti -p 8500:8500 --name=steeltoe-consul hashicorp/consul
88+
```shell
89+
docker run --rm -it --pull=always -p 8500:8500 --name consul hashicorp/consul
8890
```
8991

90-
## Spring Boot Admin
91-
92-
### Run Spring Boot Admin Server with Docker
92+
## MongoDB
9393

94-
There are multiple Spring Boot Admin images to choose from, this is only one option:
94+
### Run MongoDB Server with Docker
9595

96-
```script
97-
docker run --rm -it -p 8080:8080 --name steeltoe-springbootadmin steeltoeoss/spring-boot-admin
96+
```shell
97+
docker run --rm -it --pull=always -p 27017:27017 --name mongo mongo
9898
```
9999

100-
## Redis
100+
## MySQL
101101

102-
### Run Redis server with Docker
102+
### Run MySQL Server with Docker
103103

104-
```script
105-
docker run --rm -ti -p 6379:6379 --name redis redis
104+
```shell
105+
docker run --rm -it --pull=always -p 3306:3306 --name steeltoe-mysql -e MYSQL_ROOT_PASSWORD=steeltoe -e MYSQL_DATABASE=steeltoe -e MYSQL_USER=steeltoe -e MYSQL_PASSWORD=steeltoe mysql
106106
```
107107

108-
## MySQL
108+
## PostgreSQL
109109

110-
### Run MySQL Server with Docker
110+
### Run PostgreSQL Server with Docker
111111

112-
```script
113-
docker run --rm -ti -p 3306:3306 --name steeltoe-mysql -e MYSQL_ROOT_PASSWORD=steeltoe -e MYSQL_DATABASE=steeltoe -e MYSQL_USER=steeltoe -e MYSQL_PASSWORD=steeltoe mysql
112+
```shell
113+
docker run --rm -it --pull=always -p 5432:5432 --name steeltoe-postgres -e POSTGRES_DB=steeltoe -e POSTGRES_USER=steeltoe -e POSTGRES_PASSWORD=steeltoe postgres:alpine
114114
```
115115

116-
## SQL Server
116+
## RabbitMQ
117117

118-
### Run SQL Server with Docker
118+
### Run RabbitMQ Server with Docker
119119

120-
```script
121-
docker run --rm -ti -p 1433:1433 --name steeltoe-sqlserver -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=St33ltoeR0cks!' mcr.microsoft.com/mssql/server
120+
> [!NOTE]
121+
> This image has the management plugin enabled and no credentials set.
122+
123+
```shell
124+
docker run --rm -it --pull=always -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3-management
122125
```
123126

124-
## PostgreSQL
127+
## Redis
125128

126-
### Run PostgreSQL Server with Docker
129+
### Run Redis server with Docker
127130

128-
```script
129-
docker run --rm -ti -p 5432:5432 --name steeltoe-postgres -e POSTGRES_DB=steeltoe -e POSTGRES_USER=steeltoe -e POSTGRES_PASSWORD=steeltoe postgres:alpine
131+
```shell
132+
docker run --rm -it --pull=always -p 6379:6379 --name redis redis
130133
```
131134

132-
## MongoDB
135+
## SQL Server
133136

134-
### Run MongoDB Server with Docker
137+
### Run SQL Server with Docker
135138

136-
```script
137-
docker run --rm -ti -p 27017:27017 --name mongoserver mongo
139+
```shell
140+
docker run --rm -it --pull=always -p 1433:1433 --name mssql -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=St33ltoeR0cks!' mcr.microsoft.com/mssql/server
138141
```
139142

140143
## UAA Server for Steeltoe Samples
@@ -143,8 +146,8 @@ The Steeltoe team has created a [UAA configuration](https://github.com/SteeltoeO
143146

144147
### Run UAA Server with Docker
145148

146-
```script
147-
docker run --rm -it -p 8080:8080 --name steeltoe-uaa steeltoe.azurecr.io/uaa-server:77.10
149+
```shell
150+
docker run --rm -it --pull=always -p 8080:8080 --name steeltoe-uaa steeltoe.azurecr.io/uaa-server:77.10
148151
```
149152

150153
### Run Steeltoe UAA on Cloud Foundry
@@ -155,6 +158,6 @@ Refer to the [README in the Dockerfiles repository](https://github.com/SteeltoeO
155158

156159
### Run Zipkin Server with Docker
157160

158-
```script
159-
docker run --rm -ti -p 9411:9411 --name zipkin openzipkin/zipkin
161+
```shell
162+
docker run --rm -it --pull=always -p 9411:9411 --name zipkin openzipkin/zipkin
160163
```

Configuration/src/ConfigurationProviders/Program.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Steeltoe.Configuration.Kubernetes.ServiceBindings;
55
using Steeltoe.Configuration.Placeholder;
66
using Steeltoe.Configuration.RandomValue;
7-
using Steeltoe.Management.Endpoint;
7+
using Steeltoe.Management.Endpoint.Actuators.All;
88
using Steeltoe.Samples.ConfigurationProviders.Models;
99

1010
// Steeltoe: Log to the console until the app has fully started.
@@ -32,7 +32,7 @@
3232
builder.Services.UpgradeBootstrapLoggerFactory(bootstrapLoggerFactory);
3333

3434
// Steeltoe: Add actuator endpoints.
35-
builder.AddAllActuators();
35+
builder.Services.AddAllActuators();
3636

3737
// Steeltoe: map VCAP_APPLICATION and VCAP_SERVICES to IOptions<CloudFoundryApplicationOptions> and IOptions<CloudFoundryServicesOptions>
3838
builder.Services.AddCloudFoundryOptions();

Configuration/src/ConfigurationProviders/appsettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"LogLevel": {
66
"Default": "Information",
77
"Microsoft.AspNetCore": "Warning",
8-
"Steeltoe.Configuration": "Trace"
8+
"Steeltoe.Configuration": "Debug"
99
}
1010
},
1111
"AllowedHosts": "*",

Configuration/src/Steeltoe.Samples.Configuration.sln.DotSettings

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceSequenceEqualWithConstantPattern/@EntryIndexedValue">WARNING</s:String>
8888
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceSliceWithRangeIndexer/@EntryIndexedValue">WARNING</s:String>
8989
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceSubstringWithRangeIndexer/@EntryIndexedValue">WARNING</s:String>
90+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithPrimaryConstructorParameter/@EntryIndexedValue">DO_NOT_SHOW</s:String>
9091
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SimplifyStringInterpolation/@EntryIndexedValue">WARNING</s:String>
9192
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SpecifyStringComparison/@EntryIndexedValue">WARNING</s:String>
9293
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringEndsWithIsCultureSpecific/@EntryIndexedValue">WARNING</s:String>
@@ -105,6 +106,7 @@
105106
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VirtualMemberNeverOverridden_002ELocal/@EntryIndexedValue">WARNING</s:String>
106107
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/ReplaceWithPrimaryConstructorParameter/PreserveReadonlyModifier/@EntryValue">True</s:Boolean>
107108
<s:String x:Key="/Default/CodeInspection/Highlighting/UseCollectionExpression/ConvertEmptyCollection/@EntryValue">SUGGESTION</s:String>
109+
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/UseCollectionExpression/ConvertForInterfaceTargetTypes/@EntryValue">False</s:Boolean>
108110
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Steeltoe_0020Full_0020Cleanup/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="Steeltoe Full Cleanup"&gt;&lt;XMLReformatCode&gt;True&lt;/XMLReformatCode&gt;&lt;CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeArgumentsStyle="True" ArrangeCodeBodyStyle="True" ArrangeVarStyle="True" ArrangeTrailingCommas="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeNamespaces="True" ArrangeNullCheckingPattern="True" /&gt;&lt;CssAlphabetizeProperties&gt;True&lt;/CssAlphabetizeProperties&gt;&lt;JsInsertSemicolon&gt;True&lt;/JsInsertSemicolon&gt;&lt;FormatAttributeQuoteDescriptor&gt;True&lt;/FormatAttributeQuoteDescriptor&gt;&lt;CorrectVariableKindsDescriptor&gt;True&lt;/CorrectVariableKindsDescriptor&gt;&lt;VariablesToInnerScopesDescriptor&gt;True&lt;/VariablesToInnerScopesDescriptor&gt;&lt;StringToTemplatesDescriptor&gt;True&lt;/StringToTemplatesDescriptor&gt;&lt;JsReformatCode&gt;True&lt;/JsReformatCode&gt;&lt;JsFormatDocComments&gt;True&lt;/JsFormatDocComments&gt;&lt;RemoveRedundantQualifiersTs&gt;True&lt;/RemoveRedundantQualifiersTs&gt;&lt;OptimizeImportsTs&gt;True&lt;/OptimizeImportsTs&gt;&lt;OptimizeReferenceCommentsTs&gt;True&lt;/OptimizeReferenceCommentsTs&gt;&lt;PublicModifierStyleTs&gt;True&lt;/PublicModifierStyleTs&gt;&lt;ExplicitAnyTs&gt;True&lt;/ExplicitAnyTs&gt;&lt;TypeAnnotationStyleTs&gt;True&lt;/TypeAnnotationStyleTs&gt;&lt;RelativePathStyleTs&gt;True&lt;/RelativePathStyleTs&gt;&lt;AsInsteadOfCastTs&gt;True&lt;/AsInsteadOfCastTs&gt;&lt;HtmlReformatCode&gt;True&lt;/HtmlReformatCode&gt;&lt;AspOptimizeRegisterDirectives&gt;True&lt;/AspOptimizeRegisterDirectives&gt;&lt;RemoveCodeRedundancies&gt;True&lt;/RemoveCodeRedundancies&gt;&lt;CSUseAutoProperty&gt;True&lt;/CSUseAutoProperty&gt;&lt;CSMakeFieldReadonly&gt;True&lt;/CSMakeFieldReadonly&gt;&lt;CSMakeAutoPropertyGetOnly&gt;True&lt;/CSMakeAutoPropertyGetOnly&gt;&lt;CSArrangeQualifiers&gt;True&lt;/CSArrangeQualifiers&gt;&lt;CSFixBuiltinTypeReferences&gt;True&lt;/CSFixBuiltinTypeReferences&gt;&lt;CssReformatCode&gt;True&lt;/CssReformatCode&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;/CSOptimizeUsings&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSharpFormatDocComments&gt;True&lt;/CSharpFormatDocComments&gt;&lt;CSReorderTypeMembers&gt;True&lt;/CSReorderTypeMembers&gt;&lt;XAMLCollapseEmptyTags&gt;False&lt;/XAMLCollapseEmptyTags&gt;&lt;CSReformatInactiveBranches&gt;True&lt;/CSReformatInactiveBranches&gt;&lt;CSUpdateFileHeader&gt;True&lt;/CSUpdateFileHeader&gt;&lt;/Profile&gt;</s:String>
109111
<s:String x:Key="/Default/CodeStyle/CodeCleanup/SilentCleanupProfile/@EntryValue">Steeltoe Full Cleanup</s:String>
110112
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOR/@EntryValue">Required</s:String>
@@ -612,6 +614,7 @@
612614
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
613615
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
614616
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
617+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002EMemberReordering_002EMigrations_002ECSharpFileLayoutPatternRemoveIsAttributeUpgrade/@EntryIndexedValue">True</s:Boolean>
615618
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
616619
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
617620
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>

Connectors/src/CosmosDb/Program.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
using Microsoft.Azure.Cosmos.Fluent;
22
using Microsoft.Extensions.Options;
3+
using Steeltoe.Configuration.CloudFoundry;
34
using Steeltoe.Connectors.CosmosDb;
4-
using Steeltoe.Management.Endpoint;
5+
using Steeltoe.Management.Endpoint.Actuators.All;
56
using Steeltoe.Samples.CosmosDb;
67

78
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
89

910
// Add services to the container.
1011
builder.Services.AddControllersWithViews();
1112

13+
// Steeltoe: Add Cloud Foundry Configuration Provider for Actuator integration (not required for connectors).
14+
builder.AddCloudFoundryConfiguration();
15+
1216
// Steeltoe: Add actuator endpoints.
13-
builder.AddAllActuators();
17+
builder.Services.AddAllActuators();
1418

1519
// Steeltoe: Setup CosmosDB options, connection factory and health checks.
1620
builder.AddCosmosDb(null, addOptions =>

Connectors/src/MongoDb/Program.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
using MongoDB.Driver;
2+
using Steeltoe.Configuration.CloudFoundry;
23
using Steeltoe.Connectors.MongoDb;
3-
using Steeltoe.Management.Endpoint;
4+
using Steeltoe.Management.Endpoint.Actuators.All;
45
using Steeltoe.Samples.MongoDb;
56

67
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
78

89
// Add services to the container.
910
builder.Services.AddControllersWithViews();
1011

12+
// Steeltoe: Add Cloud Foundry Configuration Provider for Actuator integration (not required for connectors).
13+
builder.AddCloudFoundryConfiguration();
14+
1115
// Steeltoe: Add actuator endpoints.
12-
builder.AddAllActuators();
16+
builder.Services.AddAllActuators();
1317

1418
// Steeltoe: Setup MongoDB options, connection factory and health checks.
1519
builder.AddMongoDb();

Connectors/src/MySql/Program.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
using MySqlConnector;
2+
using Steeltoe.Configuration.CloudFoundry;
23
using Steeltoe.Connectors.MySql;
3-
using Steeltoe.Management.Endpoint;
4+
using Steeltoe.Management.Endpoint.Actuators.All;
45
using Steeltoe.Samples.MySql;
56

67
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
78

89
// Add services to the container.
910
builder.Services.AddControllersWithViews();
1011

12+
// Steeltoe: Add Cloud Foundry Configuration Provider for Actuator integration (not required for connectors).
13+
builder.AddCloudFoundryConfiguration();
14+
1115
// Steeltoe: Add actuator endpoints.
12-
builder.AddAllActuators();
16+
builder.Services.AddAllActuators();
1317

1418
// Steeltoe: Setup MySQL options, connection factory and health checks.
1519
builder.AddMySql();

Connectors/src/MySqlEFCore/Program.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using Microsoft.EntityFrameworkCore.Infrastructure;
2+
using Steeltoe.Configuration.CloudFoundry;
23
using Steeltoe.Connectors.EntityFrameworkCore.MySql;
34
using Steeltoe.Connectors.MySql;
4-
using Steeltoe.Management.Endpoint;
5+
using Steeltoe.Management.Endpoint.Actuators.All;
56
using Steeltoe.Samples.MySqlEFCore;
67
using Steeltoe.Samples.MySqlEFCore.Data;
78

@@ -10,8 +11,11 @@
1011
// Add services to the container.
1112
builder.Services.AddControllersWithViews();
1213

14+
// Steeltoe: Add Cloud Foundry Configuration Provider for Actuator integration (not required for connectors).
15+
builder.AddCloudFoundryConfiguration();
16+
1317
// Steeltoe: Add actuator endpoints.
14-
builder.AddAllActuators();
18+
builder.Services.AddAllActuators();
1519

1620
// Steeltoe: Setup MySQL options, connection factory and health checks.
1721
builder.AddMySql();

Connectors/src/PostgreSql/Program.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
using Npgsql;
2+
using Steeltoe.Configuration.CloudFoundry;
23
using Steeltoe.Connectors.PostgreSql;
3-
using Steeltoe.Management.Endpoint;
4+
using Steeltoe.Management.Endpoint.Actuators.All;
45
using Steeltoe.Samples.PostgreSql;
56

67
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
78

89
// Add services to the container.
910
builder.Services.AddControllersWithViews();
1011

12+
// Steeltoe: Add Cloud Foundry Configuration Provider for Actuator integration (not required for connectors).
13+
builder.AddCloudFoundryConfiguration();
14+
1115
// Steeltoe: Add actuator endpoints.
12-
builder.AddAllActuators();
16+
builder.Services.AddAllActuators();
1317

1418
// Steeltoe: Setup PostgreSQL options, connection factory and health checks.
1519
builder.AddPostgreSql();

Connectors/src/PostgreSqlEFCore/Program.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using Npgsql;
22
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure;
3+
using Steeltoe.Configuration.CloudFoundry;
34
using Steeltoe.Connectors.EntityFrameworkCore.PostgreSql;
45
using Steeltoe.Connectors.PostgreSql;
5-
using Steeltoe.Management.Endpoint;
6+
using Steeltoe.Management.Endpoint.Actuators.All;
67
using Steeltoe.Samples.PostgreSqlEFCore;
78
using Steeltoe.Samples.PostgreSqlEFCore.Data;
89

@@ -11,8 +12,11 @@
1112
// Add services to the container.
1213
builder.Services.AddControllersWithViews();
1314

15+
// Steeltoe: Add Cloud Foundry Configuration Provider for Actuator integration (not required for connectors).
16+
builder.AddCloudFoundryConfiguration();
17+
1418
// Steeltoe: Add actuator endpoints.
15-
builder.AddAllActuators();
19+
builder.Services.AddAllActuators();
1620

1721
// Steeltoe: Setup PostgreSQL options, connection factory and health checks.
1822
builder.AddPostgreSql();

Connectors/src/RabbitMQ/Program.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
using Microsoft.Extensions.Options;
22
using RabbitMQ.Client;
3+
using Steeltoe.Configuration.CloudFoundry;
34
using Steeltoe.Connectors.RabbitMQ;
4-
using Steeltoe.Management.Endpoint;
5+
using Steeltoe.Management.Endpoint.Actuators.All;
56

67
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
78

89
// Add services to the container.
910
builder.Services.AddControllersWithViews();
1011

12+
// Steeltoe: Add Cloud Foundry Configuration Provider for Actuator integration (not required for connectors).
13+
builder.AddCloudFoundryConfiguration();
14+
1115
// Steeltoe: Add actuator endpoints.
12-
builder.AddAllActuators();
16+
builder.Services.AddAllActuators();
1317

1418
// Steeltoe: Setup RabbitMQ options, connection factory and health checks.
1519
builder.AddRabbitMQ(null, addOptions =>

0 commit comments

Comments
 (0)