Skip to content

Commit f45262f

Browse files
committed
full edit connector topics (2)
1 parent 35e6328 commit f45262f

File tree

7 files changed

+89
-79
lines changed

7 files changed

+89
-79
lines changed

api/v4/connectors/cosmosdb.md

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
This connector simplifies accessing [Azure CosmosDB](https://azure.microsoft.com/products/cosmos-db/) databases.
44
It supports the following .NET drivers:
5-
- [Microsoft.Azure.Cosmos](https://www.nuget.org/packages/Microsoft.Azure.Cosmos), which provides a `CosmosClient`.
65

7-
The remainder of this page assumes you're familiar with the [basic concepts of Steeltoe Connectors](./usage.md).
6+
- [Microsoft.Azure.Cosmos](https://www.nuget.org/packages/Microsoft.Azure.Cosmos), which provides a `CosmosClient`
87

9-
## Usage
8+
The remainder of this topic assumes that you are familiar with the basic concepts of Steeltoe Connectors. See [Overview](./usage.md) for more information.
9+
10+
## Using the CosmosDB connector
1011

1112
To use this connector:
1213

@@ -24,7 +25,7 @@ Also add a NuGet reference to one of the .NET drivers listed above, as you would
2425

2526
### Configure connection string
2627

27-
The CosmosDB connection string can be obtained as described [here](https://learn.microsoft.com/azure/cosmos-db/nosql/how-to-dotnet-get-started#retrieve-your-account-connection-string).
28+
The CosmosDB connection string can be obtained as described in the [Microsoft documentation](https://learn.microsoft.com/azure/cosmos-db/nosql/how-to-dotnet-get-started#retrieve-your-account-connection-string).
2829

2930
The following example `appsettings.json` uses the emulator:
3031

@@ -43,12 +44,12 @@ The following example `appsettings.json` uses the emulator:
4344
}
4445
```
4546

46-
Notice this configuration file contains the database name, in addition to the connection string. This value is exposed
47+
Notice that this configuration file contains the database name, in addition to the connection string. This value is exposed
4748
as `CosmosDbOptions.Database`.
4849

4950
### Initialize Steeltoe Connector
5051

51-
Update your `Program.cs` as below to initialize the Connector:
52+
Update your `Program.cs` to initialize the Connector:
5253

5354
```csharp
5455
using Steeltoe.Connectors.CosmosDb;
@@ -59,71 +60,75 @@ builder.AddCosmosDb();
5960

6061
### Use CosmosClient
6162

62-
Start by defining a class that contains container data:
63-
```csharp
64-
using Newtonsoft.Json;
63+
Follow this procedure:
6564

66-
public class SampleObject
67-
{
68-
[JsonProperty(PropertyName = "id")]
69-
public string Id { get; set; }
65+
1. Define a class that contains container data:
7066

71-
public string? Text { get; set; }
72-
}
73-
```
67+
```csharp
68+
using Newtonsoft.Json;
7469

75-
To obtain a `CosmosClient` instance in your application, inject the Steeltoe factory in a controller or view:
70+
public class SampleObject
71+
{
72+
[JsonProperty(PropertyName = "id")]
73+
public string Id { get; set; }
7674

77-
```csharp
78-
using Microsoft.AspNetCore.Mvc;
79-
using Microsoft.Azure.Cosmos;
80-
using Microsoft.Azure.Cosmos.Linq;
81-
using Steeltoe.Connectors;
82-
using Steeltoe.Connectors.CosmosDb;
75+
public string? Text { get; set; }
76+
}
77+
```
8378

84-
public class HomeController : Controller
85-
{
86-
public async Task<IActionResult> Index(
87-
[FromServices] ConnectorFactory<CosmosDbOptions, CosmosClient> connectorFactory)
88-
{
89-
var connector = connectorFactory.Get();
90-
CosmosClient client = connector.GetConnection();
79+
1. To obtain a `CosmosClient` instance in your application, inject the Steeltoe factory in a controller or view:
9180

92-
Container container = client.GetContainer(connector.Options.Database, "TestContainer");
93-
List<SampleObject> sampleObjects = new();
81+
```csharp
82+
using Microsoft.AspNetCore.Mvc;
83+
using Microsoft.Azure.Cosmos;
84+
using Microsoft.Azure.Cosmos.Linq;
85+
using Steeltoe.Connectors;
86+
using Steeltoe.Connectors.CosmosDb;
9487

95-
await foreach (SampleObject sampleObject in GetAllAsync(container))
88+
public class HomeController : Controller
89+
{
90+
public async Task<IActionResult> Index(
91+
[FromServices] ConnectorFactory<CosmosDbOptions, CosmosClient> connectorFactory)
9692
{
97-
sampleObjects.Add(sampleObject);
98-
}
93+
var connector = connectorFactory.Get();
94+
CosmosClient client = connector.GetConnection();
9995

100-
return View(sampleObjects);
101-
}
96+
Container container = client.GetContainer(connector.Options.Database, "TestContainer");
97+
List<SampleObject> sampleObjects = new();
10298

103-
private async IAsyncEnumerable<SampleObject> GetAllAsync(Container container)
104-
{
105-
using FeedIterator<SampleObject> iterator =
106-
container.GetItemLinqQueryable<SampleObject>().ToFeedIterator();
99+
await foreach (SampleObject sampleObject in GetAllAsync(container))
100+
{
101+
sampleObjects.Add(sampleObject);
102+
}
107103

108-
while (iterator.HasMoreResults)
104+
return View(sampleObjects);
105+
}
106+
107+
private async IAsyncEnumerable<SampleObject> GetAllAsync(Container container)
109108
{
110-
FeedResponse<SampleObject> response = await iterator.ReadNextAsync();
109+
using FeedIterator<SampleObject> iterator =
110+
container.GetItemLinqQueryable<SampleObject>().ToFeedIterator();
111111

112-
foreach (SampleObject sampleObject in response)
112+
while (iterator.HasMoreResults)
113113
{
114-
yield return sampleObject;
114+
FeedResponse<SampleObject> response = await iterator.ReadNextAsync();
115+
116+
foreach (SampleObject sampleObject in response)
117+
{
118+
yield return sampleObject;
119+
}
115120
}
116121
}
117122
}
118-
}
119-
```
123+
```
120124

121125
A complete sample app that uses `CosmosClient` is provided at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/CosmosDb.
122126
123127
## Cloud Foundry
124128

125129
This Connector supports the following service brokers:
126-
- [VMware Tanzu Cloud Service Broker for Azure](https://docs.vmware.com/en/Tanzu-Cloud-Service-Broker-for-Azure/1.4/csb-azure/GUID-index.html)
130+
131+
- [VMware Tanzu Cloud Service Broker for Azure](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform-services/tanzu-cloud-service-broker-for-microsoft-azure/1-12/csb-azure/index.html)
127132
128133
You can create and bind an instance to your application by using the Cloud Foundry CLI:
129134

api/v4/connectors/mongodb.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
This connector simplifies accessing [MongoDB](https://www.mongodb.com/) databases.
44
It supports the following .NET drivers:
5-
- [MongoDB.Driver](https://www.nuget.org/packages/MongoDB.Driver), which provides an `IMongoClient`.
65

7-
The remainder of this page assumes you're familiar with the [basic concepts of Steeltoe Connectors](./usage.md).
6+
- [MongoDB.Driver](https://www.nuget.org/packages/MongoDB.Driver), which provides an `IMongoClient`
87

9-
## Usage
8+
The remainder of this topic assumes that you are familiar with the basic concepts of Steeltoe Connectors. See [Overview](./usage.md) for more information.
9+
10+
## Using the MongoDB connector
1011

1112
To use this connector:
1213

@@ -24,9 +25,9 @@ Also add a NuGet reference to one of the .NET drivers listed above, as you would
2425

2526
### Configure connection string
2627

27-
The available connection string parameters for MongoDB are documented [here](https://www.mongodb.com/docs/manual/reference/connection-string/).
28+
The available connection string parameters for MongoDB are described in the [MongoDB documentation](https://www.mongodb.com/docs/manual/reference/connection-string/).
2829

29-
The following example `appsettings.json` uses the docker container from above:
30+
The following example `appsettings.json` uses the docker container used earlier:
3031

3132
```json
3233
{
@@ -43,12 +44,12 @@ The following example `appsettings.json` uses the docker container from above:
4344
}
4445
```
4546

46-
Notice this configuration file contains the database name, in addition to the connection string. This value is exposed
47+
Notice that this configuration file contains the database name, in addition to the connection string. This value is exposed
4748
as `MongoDbOptions.Database`.
4849

4950
### Initialize Steeltoe Connector
5051

51-
Update your `Program.cs` as below to initialize the Connector:
52+
Update your `Program.cs` to initialize the Connector:
5253

5354
```csharp
5455
using Steeltoe.Connectors.MongoDb;
@@ -101,7 +102,8 @@ A complete sample app that uses `IMongoClient` is provided at https://github.com
101102
## Cloud Foundry
102103

103104
This Connector supports the following service brokers:
104-
- [VMware Tanzu Cloud Service Broker for Azure](https://docs.vmware.com/en/Tanzu-Cloud-Service-Broker-for-Azure/1.4/csb-azure/GUID-index.html)
105+
106+
- [VMware Tanzu Cloud Service Broker for Azure](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform-services/tanzu-cloud-service-broker-for-microsoft-azure/1-12/csb-azure/index.html)
105107

106108
You can create and bind an instance to your application by using the Cloud Foundry CLI:
107109

@@ -119,6 +121,6 @@ cf restage myApp
119121
## Kubernetes
120122

121123
This Connector supports the [Service Binding Specification for Kubernetes](https://github.com/servicebinding/spec).
122-
It can be used through the Bitnami [Services Toolkit](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/services-toolkit-install-services-toolkit.html).
124+
It can be used through the [Services Toolkit](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/services-toolkit-install-services-toolkit.html).
123125

124-
For details on how to use this, see the instructions at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/MongoDb#running-on-tanzu-application-platform-tap.
126+
For details on how to use this, see the instructions at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/MongoDb#running-on-tanzu-platform-for-kubernetes.

api/v4/connectors/mysql.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It supports the following .NET drivers:
88
- [Pomelo.EntityFrameworkCore.MySql](https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySql), which provides [Entity Framework Core](https://learn.microsoft.com/ef/core) support
99
- [MySql.EntityFrameworkCore](https://www.nuget.org/packages/MySql.EntityFrameworkCore), which provides [Entity Framework Core](https://learn.microsoft.com/ef/core) support
1010

11-
The remainder of this page assumes that you are familiar with the basic concepts of Steeltoe Connectors. See [Overview](./usage.md).
11+
The remainder of this topic assumes that you are familiar with the basic concepts of Steeltoe Connectors. See [Overview](./usage.md).
1212

1313
## Using the MySQL connector
1414

@@ -152,6 +152,7 @@ A complete sample app that uses Entity Framework Core with MySQL is provided at
152152
## Cloud Foundry
153153

154154
This Connector supports the following service brokers:
155+
155156
- [VMware Tanzu for MySQL on Cloud Foundry](https://techdocs.broadcom.com/us/en/vmware-tanzu/data-solutions/tanzu-for-mysql-on-cloud-foundry/3-3/mysql-for-tpcf/about_mysql_vms.html)
156157
- [VMware Tanzu Cloud Service Broker for Azure](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform-services/tanzu-cloud-service-broker-for-gcp/1-8/csb-gcp/index.html)
157158
- [VMware Tanzu Cloud Service Broker for GCP](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform-services/tanzu-cloud-service-broker-for-gcp/1-8/csb-gcp/index.html)
@@ -172,6 +173,6 @@ cf restage myApp
172173
## Kubernetes
173174

174175
This Connector supports the [Service Binding Specification for Kubernetes](https://github.com/servicebinding/spec).
175-
It can be used through the Bitnami [Services Toolkit](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/services-toolkit-install-services-toolkit.html).
176+
It can be used through the [Services Toolkit](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/services-toolkit-install-services-toolkit.html).
176177
177178
For details on how to use this, see the instructions at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/MySql#running-on-tanzu-platform-for-kubernetes.

api/v4/connectors/postgresql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It supports the following .NET drivers:
77

88
The remainder of this page assumes you're familiar with the [basic concepts of Steeltoe Connectors](./usage.md).
99

10-
## Usage
10+
## Using the PostgreSQL connector
1111

1212
To use this connector:
1313

@@ -165,6 +165,6 @@ cf restage myApp
165165
## Kubernetes
166166

167167
This Connector supports the [Service Binding Specification for Kubernetes](https://github.com/servicebinding/spec).
168-
It can be used through the Bitnami [Services Toolkit](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/services-toolkit-install-services-toolkit.html).
168+
It can be used through the [Services Toolkit](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/services-toolkit-install-services-toolkit.html).
169169
170170
For details on how to use this, see the instructions at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/PostgreSql#running-on-tanzu-platform-for-kubernetes.

api/v4/connectors/rabbitmq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ It supports the following .NET drivers:
55

66
- [RabbitMQ.Client](https://www.nuget.org/packages/RabbitMQ.Client), which provides an `IConnection`.
77

8-
The remainder of this page assumes that you are familiar with the basic concepts of Steeltoe Connectors. See [Overview](./usage.md) for more information.
8+
The remainder of this topic assumes that you are familiar with the basic concepts of Steeltoe Connectors. See [Overview](./usage.md) for more information.
99

1010
## Using the RabbitMQ connector
1111

@@ -107,6 +107,6 @@ cf restage myApp
107107
## Kubernetes
108108

109109
This Connector supports the [Service Binding Specification for Kubernetes](https://github.com/servicebinding/spec).
110-
It can be used through the Bitnami [Services Toolkit](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/services-toolkit-install-services-toolkit.html).
110+
It can be used through the [Services Toolkit](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/services-toolkit-install-services-toolkit.html).
111111

112112
For details on how to use this, see the instructions at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/RabbitMQ#running-on-tanzu-platform-for-kubernetes.

api/v4/connectors/redis.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ This connector simplifies accessing [Redis](https://redis.io/) databases.
77
88
It supports the following .NET drivers:
99

10-
- [StackExchange.Redis](https://www.nuget.org/packages/StackExchange.Redis), which provides an `IConnectionMultiplexer`.
11-
- [Microsoft.Extensions.Caching.StackExchangeRedis](https://www.nuget.org/packages/Microsoft.Extensions.Caching.StackExchangeRedis), which provides an `IDistributedCache`.
10+
- [StackExchange.Redis](https://www.nuget.org/packages/StackExchange.Redis), which provides an `IConnectionMultiplexer`
11+
- [Microsoft.Extensions.Caching.StackExchangeRedis](https://www.nuget.org/packages/Microsoft.Extensions.Caching.StackExchangeRedis), which provides an `IDistributedCache`
1212

13-
The remainder of this page assumes you're familiar with the [basic concepts of Steeltoe Connectors](./usage.md).
13+
The remainder of this topic assumes that you are familiar with the basic concepts of Steeltoe Connectors. See [Overview](./usage.md) for more information.
1414

15-
## Usage
15+
## Using the Redis Connector
1616

1717
To use this connector:
1818

@@ -30,9 +30,9 @@ Also add a NuGet reference to one of the .NET drivers listed above, as you would
3030

3131
### Configure connection string
3232

33-
The available connection string parameters for Redis are documented [here](https://stackexchange.github.io/StackExchange.Redis/Configuration.html).
33+
The available connection string parameters for Redis are described in [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/Configuration.html).
3434

35-
The following example `appsettings.json` uses the docker container from above:
35+
The following example `appsettings.json` uses the docker container used earlier:
3636

3737
```json
3838
{
@@ -50,7 +50,7 @@ The following example `appsettings.json` uses the docker container from above:
5050

5151
### Initialize Steeltoe Connector
5252

53-
Update your `Program.cs` as below to initialize the Connector:
53+
Update your `Program.cs` to initialize the Connector:
5454

5555
```csharp
5656
using Steeltoe.Connectors.Redis;
@@ -86,7 +86,7 @@ public class HomeController : Controller
8686
}
8787
```
8888

89-
A complete sample app that uses `IConnectionMultiplexer` is provided at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/Redis.
89+
For a complete sample app that uses `IConnectionMultiplexer`, see https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/Redis.
9090

9191
### Use IDistributedCache
9292

@@ -114,14 +114,16 @@ public class HomeController : Controller
114114
}
115115
```
116116

117-
A complete sample app that uses `IDistributedCache` is provided at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/Redis.
117+
For a complete sample app that uses `IDistributedCache`, see https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/Redis.
118118

119119
## Cloud Foundry
120120

121121
This Connector supports the following service brokers:
122-
- [Redis for VMware Tanzu Application Service](https://docs.vmware.com/en/Redis-for-VMware-Tanzu-Application-Service/3.1/redis-tanzu-application-service/GUID-index.html)
123-
- [VMware Tanzu Cloud Service Broker for Azure](https://docs.vmware.com/en/Tanzu-Cloud-Service-Broker-for-Azure/1.4/csb-azure/GUID-index.html)
124-
- [VMware Tanzu Cloud Service Broker for GCP](https://docs.vmware.com/en/Tanzu-Cloud-Service-Broker-for-GCP/1.2/csb-gcp/GUID-index.html)
122+
123+
- [Redis for VMware Tanzu Application Service](https://techdocs.broadcom.com/us/en/vmware-tanzu/data-solutions/redis-for-tanzu-application-service/3-5/redis-for-tas/index.html)
124+
- [Tanzu for Valkey on Cloud Foundry](https://techdocs.broadcom.com/us/en/vmware-tanzu/data-solutions/tanzu-for-valkey-on-cloud-foundry/4-0/valkey-on-cf/index.html)
125+
- [VMware Tanzu Cloud Service Broker for Azure](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform-services/tanzu-cloud-service-broker-for-gcp/1-8/csb-gcp/index.html)
126+
- [VMware Tanzu Cloud Service Broker for GCP](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform-services/tanzu-cloud-service-broker-for-gcp/1-8/csb-gcp/index.html)
125127

126128
You can create and bind an instance to your application by using the Cloud Foundry CLI:
127129

@@ -139,6 +141,6 @@ cf restage myApp
139141
## Kubernetes
140142

141143
This Connector supports the [Service Binding Specification for Kubernetes](https://github.com/servicebinding/spec).
142-
It can be used through the Bitnami [Services Toolkit](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/services-toolkit-install-services-toolkit.html).
144+
It can be used through the [Services Toolkit](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/services-toolkit-install-services-toolkit.html).
143145

144-
For details on how to use this, see the instructions at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/Redis#running-on-tanzu-application-platform-tap.
146+
For details on how to use this, see the instructions at https://github.com/SteeltoeOSS/Samples/tree/main/Connectors/src/Redis#running-on-tanzu-platform-for-kubernetes.

api/v4/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
- topicHref: connectors/cosmosdb.md
125125
name: CosmosDB
126126
- topicHref: connectors/redis.md
127-
name: Redis
127+
name: Redis/Valkey
128128
- name: Service Discovery
129129
topicHref: discovery/
130130
items:

0 commit comments

Comments
 (0)