Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information about Postgres for SC #6837

Merged
merged 9 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ async Task OtherEndpointConnectionParamsPull(EndpointConfiguration endpointConfi
endpointConfiguration.SendFailedMessagesTo("myerror");

#endregion

#region postgresql-multischema-config-for-queue-heartbeats

endpointConfiguration.SendHeartbeatTo("\"Particular.ServiceControl\"");

#endregion
}

void ConfigureCustomSchemaForEndpoint(EndpointConfiguration endpointConfiguration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="NServiceBus.Transport.PostgreSql" Version="8.*" />
<PackageReference Include="NServiceBus.Heartbeat" Version="5.*" />
<PackageReference Include="NUnit" Version="4.*" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
Expand Down
2 changes: 2 additions & 0 deletions servicecontrol/monitoring-instances/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ If running multiple setups of the Platform Tools (i.e. multiple versions of Serv

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.

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

| Context | Name |
| --- | --- |
| **Environment variable** | `MONITORING_SERVICECONTROLTHROUGHPUTDATAQUEUE` |
Expand Down
17 changes: 17 additions & 0 deletions servicecontrol/servicecontrol-instances/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,23 @@ Specifies any additional databases on the same server that also contain NService
| --- | --- |
| string | |
jpalac marked this conversation as resolved.
Show resolved Hide resolved

## Usage Reporting when using the PostgreSQL transport

### LicensingComponent/PostgreSQL/ConnectionString

Version: 5.10.0+

The connection string that will provide at least read access to all queue tables.

| Context | Name |
| --- | --- |
| **Environment variable** | `LICENSINGCOMPONENT_POSTGRESQL_CONNECTIONSTRING` |
| **App config key** | `LicensingComponent/PostgreSQL/ConnectionString` |

| Type | Default value |
| --- | --- |
| string | obtained from ServiceControl |

## Plugin-specific

### ServiceControl/HeartbeatGracePeriod
Expand Down
11 changes: 11 additions & 0 deletions servicecontrol/transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The value for the `TransportType` settings can be any of the following:
| [Amazon Simple Queue Service (SQS)](#amazon-sqs) | `AmazonSQS` |
| [RabbitMQ](#rabbitmq)<br/><i>See topology options below.</i> | `RabbitMQ.QuorumConventionalRouting`<br/>`RabbitMQ.ClassicConventionalRouting`<br/>`RabbitMQ.QuorumDirectRouting`<br/>`RabbitMQ.ClassicDirectRouting` |
| [SQL Server](#sql) | `SQLServer` |
| [PostgreSQL](#postgresql) | `PostgreSQL` |
| [Microsoft Message Queuing (MSMQ)](#msmq) | `MSMQ` |

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

## PostgreSQL

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:

* `Queue Schema=<schema_name>` - Specifies a custom schema for the ServiceControl input queue.
* `Subscriptions Table=<subscription_table_name>` - Specifies PostgreSQL subscription table name.
* *Optional* `Subscriptions Table=schema.tablename` - to specify the schema with simple table name.
* *Optional* `Subscriptions Table=schema.multi.table.name` - to specify the schema with a table name containing `.`.
* *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.

## Amazon SQS

The following ServiceControl connection string options are available:
Expand Down
10 changes: 10 additions & 0 deletions servicepulse/usage-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ Refer to the [Usage Reporting when using the SqlServer transport](/servicecontro

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

### PostgreSQL

#### Settings

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.

#### Minimum Permissions

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

### RabbitMQ

#### Settings
Expand Down
1 change: 1 addition & 0 deletions transports/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ Initially, it's challenging to decide which queuing technology may be best for a
- [Amazon SQS](/transports/sqs/)
- [RabbitMQ](/transports/rabbitmq/)
- [SQL Server](/transports/sql/)
- [PostgreSQL](/transports/postgresql/)
- [MSMQ](/transports/msmq)
- [Learning](/transports/learning/)
6 changes: 5 additions & 1 deletion transports/postgresql/addressing.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ snippet: postgresql-multischema-config-for-queue-send

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

> [!NOTE]
> If the queue name contains a "." and the first part is not a schema name, enclose the queue name in quotes.

snippet: postgresql-multischema-config-for-queue-heartbeats

The entire algorithm for calculating the schema is the following:

* If the schema is configured for a given queue via `UseSchemaForQueue`, the configured value is used.
* 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.
* If destination address contains a schema, the schema from address is used.
* If default schema is configured via `DefaultSchema`, the configured value is used.
* Otherwise, `public` is used as a default schema.