Skip to content

Commit 31d800d

Browse files
authored
Merge pull request #6837 from Particular/postgres-in-sc
Add information about Postgres for SC
2 parents 09c626e + 8408fcc commit 31d800d

File tree

8 files changed

+53
-1
lines changed

8 files changed

+53
-1
lines changed

Snippets/PostgreSqlTransport/PostgreSqlTransport_8/MultiSchema.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ async Task OtherEndpointConnectionParamsPull(EndpointConfiguration endpointConfi
3737
endpointConfiguration.SendFailedMessagesTo("myerror");
3838

3939
#endregion
40+
41+
#region postgresql-multischema-config-for-queue-heartbeats
42+
43+
endpointConfiguration.SendHeartbeatTo("\"Particular.ServiceControl\"");
44+
45+
#endregion
4046
}
4147

4248
void ConfigureCustomSchemaForEndpoint(EndpointConfiguration endpointConfiguration)

Snippets/PostgreSqlTransport/PostgreSqlTransport_8/PostgreSqlTransport_8.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="Azure.Identity" Version="1.12.0" />
99
<PackageReference Include="NServiceBus.Transport.PostgreSql" Version="8.*" />
10+
<PackageReference Include="NServiceBus.Heartbeat" Version="5.*" />
1011
<PackageReference Include="NUnit" Version="4.*" />
1112
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" />
1213
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />

servicecontrol/monitoring-instances/configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ If running multiple setups of the Platform Tools (i.e. multiple versions of Serv
201201

202202
If using [MSMQ transport](/transports/msmq) and the monitoring instance is installed on a different machine to the ServiceControl error instance, then only the monitoring instance setting needs to be modified to include the machine name of the error instance in the queue address.
203203

204+
If using [PostgreSQL transport](/transports/postgresql/), and a schema other than `public` is required, then the schema name needs to be included in the `Monitoring/ServiceControlThroughputDataQueue` setting
205+
204206
| Context | Name |
205207
| --- | --- |
206208
| **Environment variable** | `MONITORING_SERVICECONTROLTHROUGHPUTDATAQUEUE` |

servicecontrol/servicecontrol-instances/configuration.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,23 @@ Specifies any additional databases on the same server that also contain NService
754754
| --- | --- |
755755
| string | |
756756

757+
## Usage Reporting when using the PostgreSQL transport
758+
759+
### LicensingComponent/PostgreSQL/ConnectionString
760+
761+
Version: 5.10.0+
762+
763+
The connection string that will provide at least read access to all queue tables.
764+
765+
| Context | Name |
766+
| --- | --- |
767+
| **Environment variable** | `LICENSINGCOMPONENT_POSTGRESQL_CONNECTIONSTRING` |
768+
| **App config key** | `LicensingComponent/PostgreSQL/ConnectionString` |
769+
770+
| Type | Default value |
771+
| --- | --- |
772+
| string | obtained from ServiceControl |
773+
757774
## Plugin-specific
758775

759776
### ServiceControl/HeartbeatGracePeriod

servicecontrol/transports.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The value for the `TransportType` settings can be any of the following:
1919
| [Amazon Simple Queue Service (SQS)](#amazon-sqs) | `AmazonSQS` |
2020
| [RabbitMQ](#rabbitmq)<br/><i>See topology options below.</i> | `RabbitMQ.QuorumConventionalRouting`<br/>`RabbitMQ.ClassicConventionalRouting`<br/>`RabbitMQ.QuorumDirectRouting`<br/>`RabbitMQ.ClassicDirectRouting` |
2121
| [SQL Server](#sql) | `SQLServer` |
22+
| [PostgreSQL](#postgresql) | `PostgreSQL` |
2223
| [Microsoft Message Queuing (MSMQ)](#msmq) | `MSMQ` |
2324

2425
Follow the link for each transport for additional information on configuration options for that transport lower on this page.
@@ -74,6 +75,16 @@ In addition to the [connection string options of the transport](/transports/sql/
7475
* *Optional* `Subscriptions Table=<subscription_table_name>@<schema>` - to specify the schema.
7576
* *Optional* `Subscriptions Table=<subscription_table_name>@<schema>@<catalog>` - to specify the schema and catalog.
7677

78+
## PostgreSQL
79+
80+
In addition to the [connection string options of the transport](/transports/postgresql/connection-settings.md#connection-configuration) the following ServiceControl specific options are available in versions 5.10 and above:
81+
82+
* `Queue Schema=<schema_name>` - Specifies a custom schema for the ServiceControl input queue.
83+
* `Subscriptions Table=<subscription_table_name>` - Specifies PostgreSQL subscription table name.
84+
* *Optional* `Subscriptions Table=schema.tablename` - to specify the schema with simple table name.
85+
* *Optional* `Subscriptions Table=schema.multi.table.name` - to specify the schema with a table name containing `.`.
86+
* *Optional* `Subscriptions Table==&quot;multi.table.name=&quot;` - to specify a table name containing `.` without a schema. In this case, `Queue Schema` will be used if specified, otherwise the default schema (`public`) will be used.
87+
7788
## Amazon SQS
7889

7990
The following ServiceControl connection string options are available:

servicepulse/usage-config.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ Refer to the [Usage Reporting when using the SqlServer transport](/servicecontro
101101

102102
User with rights to query [INFORMATION_SCHEMA].[COLUMNS] table.
103103

104+
### PostgreSQL
105+
106+
#### Settings
107+
108+
Refer to the [Usage Reporting when using the PostgreSQL transport](/servicecontrol/servicecontrol-instances/configuration.md#usage-reporting-when-using-the-postgresql-transport) section of the ServiceControl config file for an explanation of the PostgreSQL Server-specific settings.
109+
110+
#### Minimum Permissions
111+
112+
User with rights to query [INFORMATION_SCHEMA].[COLUMNS] table.
113+
104114
### RabbitMQ
105115

106116
#### Settings

transports/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ Initially, it's challenging to decide which queuing technology may be best for a
2424
- [Amazon SQS](/transports/sqs/)
2525
- [RabbitMQ](/transports/rabbitmq/)
2626
- [SQL Server](/transports/sql/)
27+
- [PostgreSQL](/transports/postgresql/)
2728
- [MSMQ](/transports/msmq)
2829
- [Learning](/transports/learning/)

transports/postgresql/addressing.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ snippet: postgresql-multischema-config-for-queue-send
4242

4343
snippet: postgresql-multischema-config-for-queue-error
4444

45+
> [!NOTE]
46+
> If the queue name contains a "." and the first part is not a schema name, enclose the queue name in quotes.
47+
48+
snippet: postgresql-multischema-config-for-queue-heartbeats
49+
4550
The entire algorithm for calculating the schema is the following:
4651

4752
* If the schema is configured for a given queue via `UseSchemaForQueue`, the configured value is used.
4853
* If [logical routing](/nservicebus/messaging/routing.md#command-routing) is used and schema is configured for a given endpoint via `UseSchemaForEndpoint`, the configured schema is used.
4954
* If destination address contains a schema, the schema from address is used.
5055
* If default schema is configured via `DefaultSchema`, the configured value is used.
5156
* Otherwise, `public` is used as a default schema.
52-

0 commit comments

Comments
 (0)