diff --git a/Aspire.slnx b/Aspire.slnx
index efcf1d4ccff..25ffbc6ef47 100644
--- a/Aspire.slnx
+++ b/Aspire.slnx
@@ -26,7 +26,6 @@
-
@@ -37,7 +36,6 @@
-
@@ -528,7 +526,6 @@
-
@@ -539,7 +536,6 @@
-
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 4c69072792c..75fad2b42d9 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -86,7 +86,6 @@
-
diff --git a/playground/AspireWithMaui/AspireWithMaui.slnx b/playground/AspireWithMaui/AspireWithMaui.slnx
index d5f13969ee7..557e3c9add5 100644
--- a/playground/AspireWithMaui/AspireWithMaui.slnx
+++ b/playground/AspireWithMaui/AspireWithMaui.slnx
@@ -26,7 +26,6 @@
-
@@ -36,7 +35,6 @@
-
@@ -390,7 +388,6 @@
-
@@ -400,7 +397,6 @@
-
diff --git a/src/Components/Aspire.MongoDB.Driver.v2/Aspire.MongoDB.Driver.v2.csproj b/src/Components/Aspire.MongoDB.Driver.v2/Aspire.MongoDB.Driver.v2.csproj
deleted file mode 100644
index 11169f9be09..00000000000
--- a/src/Components/Aspire.MongoDB.Driver.v2/Aspire.MongoDB.Driver.v2.csproj
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
- $(AllTargetFrameworks)
- true
- $(ComponentDatabasePackageTags) MongoDB
- $(SharedDir)MongoDB_300px.png
- A generic MongoDB client (versions 2.x) that integrates with Aspire.
-
- $(NoWarn);CS8002
- $(DefineConstants);MONGODB_V2
-
-
- Aspire.MongoDB.Driver
-
- $(MSBuildProjectName)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Components/Aspire.MongoDB.Driver.v2/ConfigurationSchema.json b/src/Components/Aspire.MongoDB.Driver.v2/ConfigurationSchema.json
deleted file mode 100644
index 42f195ca68c..00000000000
--- a/src/Components/Aspire.MongoDB.Driver.v2/ConfigurationSchema.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
- "definitions": {
- "logLevel": {
- "properties": {
- "MongoDB": {
- "$ref": "#/definitions/logLevelThreshold"
- },
- "MongoDB.Command": {
- "$ref": "#/definitions/logLevelThreshold"
- },
- "MongoDB.Connection": {
- "$ref": "#/definitions/logLevelThreshold"
- },
- "MongoDB.Internal": {
- "$ref": "#/definitions/logLevelThreshold"
- },
- "MongoDB.SDAM": {
- "$ref": "#/definitions/logLevelThreshold"
- },
- "MongoDB.ServerSelection": {
- "$ref": "#/definitions/logLevelThreshold"
- }
- }
- }
- },
- "type": "object",
- "properties": {
- "Aspire": {
- "type": "object",
- "properties": {
- "MongoDB": {
- "type": "object",
- "properties": {
- "Driver": {
- "type": "object",
- "properties": {
- "ConnectionString": {
- "type": "string",
- "description": "Gets or sets the connection string of the MongoDB database to connect to."
- },
- "DisableHealthChecks": {
- "type": "boolean",
- "description": "Gets or sets a boolean value that indicates whether the MongoDB health check is disabled or not.",
- "default": false
- },
- "DisableTracing": {
- "type": "boolean",
- "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is disabled or not.",
- "default": false
- },
- "HealthCheckTimeout": {
- "type": "integer",
- "description": "Gets or sets a integer value that indicates the MongoDB health check timeout in milliseconds."
- }
- },
- "description": "Provides the client configuration settings for connecting to a MongoDB database using MongoDB driver."
- }
- }
- }
- }
- }
- }
-}
diff --git a/src/Components/Aspire.MongoDB.Driver.v2/api/Aspire.MongoDB.Driver.cs b/src/Components/Aspire.MongoDB.Driver.v2/api/Aspire.MongoDB.Driver.cs
deleted file mode 100644
index 9ed206727fc..00000000000
--- a/src/Components/Aspire.MongoDB.Driver.v2/api/Aspire.MongoDB.Driver.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-namespace Aspire.MongoDB.Driver
-{
- public sealed partial class MongoDBSettings
- {
- public string? ConnectionString { get { throw null; } set { } }
-
- public bool DisableHealthChecks { get { throw null; } set { } }
-
- public bool DisableTracing { get { throw null; } set { } }
-
- public int? HealthCheckTimeout { get { throw null; } set { } }
- }
-}
-
-namespace Microsoft.Extensions.Hosting
-{
- public static partial class AspireMongoDBDriverExtensions
- {
- public static void AddKeyedMongoDBClient(this IHostApplicationBuilder builder, string name, System.Action? configureSettings = null, System.Action? configureClientSettings = null) { }
-
- public static void AddMongoDBClient(this IHostApplicationBuilder builder, string connectionName, System.Action? configureSettings = null, System.Action? configureClientSettings = null) { }
- }
-}
\ No newline at end of file
diff --git a/src/Components/Aspire.MongoDB.Driver/AspireMongoDBDriverExtensions.cs b/src/Components/Aspire.MongoDB.Driver/AspireMongoDBDriverExtensions.cs
index 0bdbb4c7871..137edbe39a7 100644
--- a/src/Components/Aspire.MongoDB.Driver/AspireMongoDBDriverExtensions.cs
+++ b/src/Components/Aspire.MongoDB.Driver/AspireMongoDBDriverExtensions.cs
@@ -170,14 +170,10 @@ private static void AddHealthCheck(
builder.TryAddHealthCheck(
healthCheckName,
healthCheck => healthCheck.AddMongoDb(
-#if MONGODB_V2
- settings.ConnectionString,
-#else
serviceKey is null
? sp => sp.GetRequiredService()
: sp => sp.GetRequiredKeyedService(serviceKey),
_ => MongoUrl.Create(settings.ConnectionString).DatabaseName,
-#endif
healthCheckName,
null,
null,
diff --git a/src/Components/Aspire.RabbitMQ.Client.v6/Aspire.RabbitMQ.Client.v6.csproj b/src/Components/Aspire.RabbitMQ.Client.v6/Aspire.RabbitMQ.Client.v6.csproj
deleted file mode 100644
index f50b5003fe1..00000000000
--- a/src/Components/Aspire.RabbitMQ.Client.v6/Aspire.RabbitMQ.Client.v6.csproj
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
- $(AllTargetFrameworks)
- true
- $(ComponentDatabasePackageTags) rabbitmq amqp messaging eventing
- A RabbitMQ client (versions 6.x) that integrates with Aspire, including health checks, logging, and telemetry.
- $(NoWarn);SYSLIB1100;SYSLIB1101
- $(DefineConstants);RABBITMQ_V6
-
-
- Aspire.RabbitMQ.Client
-
- $(MSBuildProjectName)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Components/Aspire.RabbitMQ.Client.v6/ConfigurationSchema.json b/src/Components/Aspire.RabbitMQ.Client.v6/ConfigurationSchema.json
deleted file mode 100644
index ed0c4a41049..00000000000
--- a/src/Components/Aspire.RabbitMQ.Client.v6/ConfigurationSchema.json
+++ /dev/null
@@ -1,363 +0,0 @@
-{
- "definitions": {
- "logLevel": {
- "properties": {
- "RabbitMQ.Client": {
- "$ref": "#/definitions/logLevelThreshold"
- }
- }
- }
- },
- "type": "object",
- "properties": {
- "Aspire": {
- "type": "object",
- "properties": {
- "RabbitMQ": {
- "type": "object",
- "properties": {
- "Client": {
- "type": "object",
- "properties": {
- "ConnectionFactory": {
- "type": "object",
- "properties": {
- "AmqpUriSslProtocols": {
- "enum": [
- "None",
- "Ssl2",
- "Ssl3",
- "Tls",
- "Default",
- "Tls11",
- "Tls12",
- "Tls13"
- ],
- "description": "The AMQP URI SSL protocols."
- },
- "AutomaticRecoveryEnabled": {
- "type": "boolean",
- "description": "Set to false to disable automatic connection recovery. Defaults to true."
- },
- "ClientProvidedName": {
- "type": "string",
- "description": "Default client provided name to be used for connections."
- },
- "ConsumerDispatchConcurrency": {
- "type": "integer",
- "description": "Set to a value greater than one to enable concurrent processing. For a concurrency greater than one 'RabbitMQ.Client.IBasicConsumer' will be offloaded to the worker thread pool so it is important to choose the value for the concurrency wisely to avoid thread pool overloading. 'RabbitMQ.Client.IAsyncBasicConsumer' can handle concurrency much more efficiently due to the non-blocking nature of the consumer. Defaults to 1."
- },
- "ContinuationTimeout": {
- "type": "string",
- "pattern": "^-?(\\d{1,7}|((\\d{1,7}[\\.:])?(([01]?\\d|2[0-3]):[0-5]?\\d|([01]?\\d|2[0-3]):[0-5]?\\d:[0-5]?\\d)(\\.\\d{1,7})?))$",
- "description": "Amount of time protocol operations (e.g. queue.declare) are allowed to take before timing out."
- },
- "DefaultAddressFamily": {
- "enum": [
- "Unknown",
- "Unspecified",
- "Unix",
- "InterNetwork",
- "ImpLink",
- "Pup",
- "Chaos",
- "Ipx",
- "NS",
- "Iso",
- "Osi",
- "Ecma",
- "DataKit",
- "Ccitt",
- "Sna",
- "DecNet",
- "DataLink",
- "Lat",
- "HyperChannel",
- "AppleTalk",
- "NetBios",
- "VoiceView",
- "FireFox",
- "Banyan",
- "Atm",
- "InterNetworkV6",
- "Cluster",
- "Ieee12844",
- "Irda",
- "NetworkDesigners",
- "Max",
- "Packet",
- "ControllerAreaNetwork"
- ],
- "description": "Address family used by default. Use 'System.Net.Sockets.AddressFamily.InterNetwork' to force to IPv4. Use 'System.Net.Sockets.AddressFamily.InterNetworkV6' to force to IPv6. Or use 'System.Net.Sockets.AddressFamily.Unknown' to attempt both IPv6 and IPv4."
- },
- "DefaultAmqpUriSslProtocols": {
- "enum": [
- "None",
- "Ssl2",
- "Ssl3",
- "Tls",
- "Default",
- "Tls11",
- "Tls12",
- "Tls13"
- ],
- "description": "TLS versions enabled by default: TLSv1.2, v1.1, v1.0."
- },
- "DispatchConsumersAsync": {
- "type": "boolean",
- "description": "Set to true will enable a asynchronous consumer dispatcher which is compatible with 'RabbitMQ.Client.IAsyncBasicConsumer'. Defaults to false."
- },
- "Endpoint": {
- "type": "object",
- "properties": {
- "AddressFamily": {
- "enum": [
- "Unknown",
- "Unspecified",
- "Unix",
- "InterNetwork",
- "ImpLink",
- "Pup",
- "Chaos",
- "Ipx",
- "NS",
- "Iso",
- "Osi",
- "Ecma",
- "DataKit",
- "Ccitt",
- "Sna",
- "DecNet",
- "DataLink",
- "Lat",
- "HyperChannel",
- "AppleTalk",
- "NetBios",
- "VoiceView",
- "FireFox",
- "Banyan",
- "Atm",
- "InterNetworkV6",
- "Cluster",
- "Ieee12844",
- "Irda",
- "NetworkDesigners",
- "Max",
- "Packet",
- "ControllerAreaNetwork"
- ],
- "description": "Used to force the address family of the endpoint. Use 'System.Net.Sockets.AddressFamily.InterNetwork' to force to IPv4. Use 'System.Net.Sockets.AddressFamily.InterNetworkV6' to force to IPv6. Or use 'System.Net.Sockets.AddressFamily.Unknown' to attempt both IPv6 and IPv4."
- },
- "HostName": {
- "type": "string",
- "description": "Retrieve or set the hostname of this 'RabbitMQ.Client.AmqpTcpEndpoint'."
- },
- "Port": {
- "type": "integer",
- "description": "Retrieve or set the port number of this AmqpTcpEndpoint. A port number of -1 causes the default port number."
- },
- "Ssl": {
- "type": "object",
- "properties": {
- "AcceptablePolicyErrors": {
- "enum": [
- "None",
- "RemoteCertificateNotAvailable",
- "RemoteCertificateNameMismatch",
- "RemoteCertificateChainErrors"
- ],
- "description": "Retrieve or set the set of TLS policy (peer verification) errors that are deemed acceptable."
- },
- "CertPassphrase": {
- "type": "string",
- "description": "Retrieve or set the client certificate passphrase."
- },
- "CertPath": {
- "type": "string",
- "description": "Retrieve or set the path to client certificate."
- },
- "CheckCertificateRevocation": {
- "type": "boolean",
- "description": "Attempts to check certificate revocation status. Default is false. Set to true to check peer certificate for revocation."
- },
- "Enabled": {
- "type": "boolean",
- "description": "Controls if TLS should indeed be used. Set to false to disable TLS on the connection."
- },
- "ServerName": {
- "type": "string",
- "description": "Retrieve or set server's expected name. This MUST match the Subject Alternative Name (SAN) or CN on the peer's (server's) leaf certificate, otherwise the TLS connection will fail."
- },
- "Version": {
- "enum": [
- "None",
- "Ssl2",
- "Ssl3",
- "Tls",
- "Default",
- "Tls11",
- "Tls12",
- "Tls13"
- ],
- "description": "Retrieve or set the TLS protocol version. The client will let the OS pick a suitable version by using 'System.Security.Authentication.SslProtocols.None'. If this option is disabled, e.g.see via app context, the client will attempt to fall back to TLSv1.2."
- }
- },
- "description": "Retrieve the TLS options for this AmqpTcpEndpoint. If not set, null is returned."
- }
- },
- "description": "Connection endpoint."
- },
- "HandshakeContinuationTimeout": {
- "type": "string",
- "pattern": "^-?(\\d{1,7}|((\\d{1,7}[\\.:])?(([01]?\\d|2[0-3]):[0-5]?\\d|([01]?\\d|2[0-3]):[0-5]?\\d:[0-5]?\\d)(\\.\\d{1,7})?))$",
- "description": "Amount of time protocol handshake operations are allowed to take before timing out."
- },
- "HostName": {
- "type": "string",
- "description": "The host to connect to."
- },
- "MaxMessageSize": {
- "type": "integer",
- "description": "Maximum allowed message size, in bytes, from RabbitMQ. Corresponds to the rabbit.max_message_size setting."
- },
- "NetworkRecoveryInterval": {
- "type": "string",
- "pattern": "^-?(\\d{1,7}|((\\d{1,7}[\\.:])?(([01]?\\d|2[0-3]):[0-5]?\\d|([01]?\\d|2[0-3]):[0-5]?\\d:[0-5]?\\d)(\\.\\d{1,7})?))$",
- "description": "Amount of time client will wait for before re-trying to recover connection."
- },
- "Password": {
- "type": "string",
- "description": "Password to use when authenticating to the server."
- },
- "Port": {
- "type": "integer",
- "description": "The port to connect on. 'RabbitMQ.Client.AmqpTcpEndpoint.UseDefaultPort' indicates the default for the protocol should be used."
- },
- "RequestedChannelMax": {
- "type": "integer",
- "description": "Maximum channel number to ask for."
- },
- "RequestedConnectionTimeout": {
- "type": "string",
- "pattern": "^-?(\\d{1,7}|((\\d{1,7}[\\.:])?(([01]?\\d|2[0-3]):[0-5]?\\d|([01]?\\d|2[0-3]):[0-5]?\\d:[0-5]?\\d)(\\.\\d{1,7})?))$",
- "description": "Timeout setting for connection attempts."
- },
- "RequestedFrameMax": {
- "type": "integer",
- "description": "Frame-max parameter to ask for (in bytes)."
- },
- "RequestedHeartbeat": {
- "type": "string",
- "pattern": "^-?(\\d{1,7}|((\\d{1,7}[\\.:])?(([01]?\\d|2[0-3]):[0-5]?\\d|([01]?\\d|2[0-3]):[0-5]?\\d:[0-5]?\\d)(\\.\\d{1,7})?))$",
- "description": "Heartbeat timeout to use when negotiating with the server."
- },
- "SocketReadTimeout": {
- "type": "string",
- "pattern": "^-?(\\d{1,7}|((\\d{1,7}[\\.:])?(([01]?\\d|2[0-3]):[0-5]?\\d|([01]?\\d|2[0-3]):[0-5]?\\d:[0-5]?\\d)(\\.\\d{1,7})?))$",
- "description": "Timeout setting for socket read operations."
- },
- "SocketWriteTimeout": {
- "type": "string",
- "pattern": "^-?(\\d{1,7}|((\\d{1,7}[\\.:])?(([01]?\\d|2[0-3]):[0-5]?\\d|([01]?\\d|2[0-3]):[0-5]?\\d:[0-5]?\\d)(\\.\\d{1,7})?))$",
- "description": "Timeout setting for socket write operations."
- },
- "Ssl": {
- "type": "object",
- "properties": {
- "AcceptablePolicyErrors": {
- "enum": [
- "None",
- "RemoteCertificateNotAvailable",
- "RemoteCertificateNameMismatch",
- "RemoteCertificateChainErrors"
- ],
- "description": "Retrieve or set the set of TLS policy (peer verification) errors that are deemed acceptable."
- },
- "CertPassphrase": {
- "type": "string",
- "description": "Retrieve or set the client certificate passphrase."
- },
- "CertPath": {
- "type": "string",
- "description": "Retrieve or set the path to client certificate."
- },
- "CheckCertificateRevocation": {
- "type": "boolean",
- "description": "Attempts to check certificate revocation status. Default is false. Set to true to check peer certificate for revocation."
- },
- "Enabled": {
- "type": "boolean",
- "description": "Controls if TLS should indeed be used. Set to false to disable TLS on the connection."
- },
- "ServerName": {
- "type": "string",
- "description": "Retrieve or set server's expected name. This MUST match the Subject Alternative Name (SAN) or CN on the peer's (server's) leaf certificate, otherwise the TLS connection will fail."
- },
- "Version": {
- "enum": [
- "None",
- "Ssl2",
- "Ssl3",
- "Tls",
- "Default",
- "Tls11",
- "Tls12",
- "Tls13"
- ],
- "description": "Retrieve or set the TLS protocol version. The client will let the OS pick a suitable version by using 'System.Security.Authentication.SslProtocols.None'. If this option is disabled, e.g.see via app context, the client will attempt to fall back to TLSv1.2."
- }
- },
- "description": "TLS options setting."
- },
- "TopologyRecoveryEnabled": {
- "type": "boolean",
- "description": "Set to false to make automatic connection recovery not recover topology (exchanges, queues, bindings, etc). Defaults to true."
- },
- "Uri": {
- "type": "string",
- "format": "uri",
- "description": "The uri to use for the connection."
- },
- "UserName": {
- "type": "string",
- "description": "Username to use when authenticating to the server."
- },
- "VirtualHost": {
- "type": "string",
- "description": "Virtual host to access during this connection."
- }
- },
- "description": "Main entry point to the RabbitMQ .NET AMQP client API. Constructs 'RabbitMQ.Client.IConnection' instances."
- },
- "ConnectionString": {
- "type": "string",
- "description": "Gets or sets the connection string of the RabbitMQ server to connect to."
- },
- "DisableAutoActivation": {
- "type": "boolean",
- "description": "Gets or sets a boolean value that indicates whether auto activation is disabled or not.",
- "default": true
- },
- "DisableHealthChecks": {
- "type": "boolean",
- "description": "Gets or sets a boolean value that indicates whether the RabbitMQ health check is disabled or not.",
- "default": false
- },
- "DisableTracing": {
- "type": "boolean",
- "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is disabled or not.",
- "default": false
- },
- "MaxConnectRetryCount": {
- "type": "integer",
- "description": "Gets or sets the maximum number of connection retry attempts.\n\nDefault value is 5, set it to 0 to disable the retry mechanism."
- }
- },
- "description": "Provides the client configuration settings for connecting to a RabbitMQ message broker."
- }
- }
- }
- }
- }
- }
-}
diff --git a/src/Components/Aspire.RabbitMQ.Client.v6/api/Aspire.RabbitMQ.Client.cs b/src/Components/Aspire.RabbitMQ.Client.v6/api/Aspire.RabbitMQ.Client.cs
deleted file mode 100644
index f80169fd65b..00000000000
--- a/src/Components/Aspire.RabbitMQ.Client.v6/api/Aspire.RabbitMQ.Client.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-namespace Aspire.RabbitMQ.Client
-{
- public sealed partial class RabbitMQClientSettings
- {
- public string? ConnectionString { get { throw null; } set { } }
-
- public bool DisableAutoActivation { get { throw null; } set { } }
-
- public bool DisableHealthChecks { get { throw null; } set { } }
-
- public bool DisableTracing { get { throw null; } set { } }
-
- public int MaxConnectRetryCount { get { throw null; } set { } }
- }
-}
-
-namespace Microsoft.Extensions.Hosting
-{
- public static partial class AspireRabbitMQExtensions
- {
- public static void AddKeyedRabbitMQClient(this IHostApplicationBuilder builder, string name, System.Action? configureSettings = null, System.Action? configureConnectionFactory = null) { }
-
- public static void AddRabbitMQClient(this IHostApplicationBuilder builder, string connectionName, System.Action? configureSettings = null, System.Action? configureConnectionFactory = null) { }
- }
-}
\ No newline at end of file
diff --git a/src/Components/Aspire.RabbitMQ.Client/AspireRabbitMQExtensions.cs b/src/Components/Aspire.RabbitMQ.Client/AspireRabbitMQExtensions.cs
index 8d9ad7851e2..54cb38329de 100644
--- a/src/Components/Aspire.RabbitMQ.Client/AspireRabbitMQExtensions.cs
+++ b/src/Components/Aspire.RabbitMQ.Client/AspireRabbitMQExtensions.cs
@@ -139,11 +139,7 @@ IConnectionFactory CreateConnectionFactory(IServiceProvider sp)
.WithTracing(traceBuilder =>
traceBuilder
.AddSource(ActivitySourceName)
-#if RABBITMQ_V6
- // Note that RabbitMQ.Client v6.x doesn't have built-in support for tracing. See https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1261
-#else
.AddSource("RabbitMQ.Client.*")
-#endif
);
}
@@ -157,13 +153,7 @@ IConnectionFactory CreateConnectionFactory(IServiceProvider sp)
{
// if the IConnection can't be resolved, make a health check that will fail
var connection = serviceKey is null ? sp.GetRequiredService() : sp.GetRequiredKeyedService(serviceKey);
-#if RABBITMQ_V6
- var options = new RabbitMQHealthCheckOptions();
- options.Connection = connection;
- return new RabbitMQHealthCheck(options);
-#else
return new RabbitMQHealthCheck(connection);
-#endif
}
catch (Exception ex)
{
@@ -203,23 +193,6 @@ private static IConnection CreateConnection(IConnectionFactory factory, int retr
using var activity = s_activitySource.StartActivity("rabbitmq connect", ActivityKind.Client);
AddRabbitMQTags(activity, factory.Uri);
-#if RABBITMQ_V6
- return resiliencePipeline.Execute(static factory =>
- {
- using var connectAttemptActivity = s_activitySource.StartActivity("rabbitmq connect attempt", ActivityKind.Client);
- AddRabbitMQTags(connectAttemptActivity, factory.Uri, "connect");
-
- try
- {
- return factory.CreateConnection();
- }
- catch (Exception ex)
- {
- AddRabbitMQExceptionTags(connectAttemptActivity, ex);
- throw;
- }
- }, factory);
-#else
return resiliencePipeline.ExecuteAsync(static async (factory, cancellationToken) =>
{
using var connectAttemptActivity = s_activitySource.StartActivity("rabbitmq connect attempt", ActivityKind.Client);
@@ -235,7 +208,6 @@ private static IConnection CreateConnection(IConnectionFactory factory, int retr
throw;
}
}, factory).AsTask().GetAwaiter().GetResult(); // see https://github.com/microsoft/aspire/issues/565
-#endif
}
private static void AddRabbitMQTags(Activity? activity, Uri address, string? operation = null)
diff --git a/src/Components/README.md b/src/Components/README.md
index 1095f3baab6..36d6efb13fa 100644
--- a/src/Components/README.md
+++ b/src/Components/README.md
@@ -40,14 +40,16 @@ Aspire client integration packages will be serviced regularly, capturing the lat
In the situation that a client library associated with an Aspire client integration package releases an update with a breaking change, the nature of the change will be assessed to determine its impact severity on the associated Aspire client integration package and Aspire applications that depend on it. If it’s decided that the change has high enough impact such that it would constitute a breaking change necessary to address, the Aspire client integration package will be split into 2 packages to support both versions.
-To understand how this will work, an example of this is the `RabbitMQ.Client` library made many large breaking changes between version `6.8.1` and `7.0.0`. To handle this:
-
-1. For the current `Aspire.RabbitMQ.Client` package, we put a NuGet version limit on our dependency: `[6.8.1,7.0.0)`. This way people won't be able to update to the `7.0.0` version, which will break their app.
-2. When `RabbitMQ.Client` ships an official `7.0.0` stable package during the Aspire `8.x` lifetime, we can add a new, forked client integration named `Aspire.RabbitMQ.Client.v7` which will have a dependency on `7.0.0` and contain any updates so the Aspire client integration will work with v7. People who explicitly want to use v7 can opt into using this package.
-3. When Aspire 9 ships, we can "swap" the dependencies around.
- - The `Aspire.RabbitMQ.Client` package will be updated to depend on v7 of `RabbitMQ.Client`.
- - If `RabbitMQ.Client` v6 is still in support, we can create `Aspire.RabbitMQ.Client.v6` which has the dependency limit `[6.8.1, 7.0.0)` and works with the version 6 of RabbitMQ.Client.
- - `Aspire.RabbitMQ.Client.v7` will be dead-ended. We won't make new Aspire 9 versions of this package.
+As a historical example, the `RabbitMQ.Client` library made many large breaking changes between version `6.8.1` and `7.0.0`. The following scenario illustrates how versioned packages supported that transition during Aspire 8.x and 9; it does not describe the currently maintained packages:
+
+1. For the Aspire 8.x `Aspire.RabbitMQ.Client` package, we put a NuGet version limit on our dependency: `[6.8.1,7.0.0)`. This prevented applications from inadvertently updating to the breaking `7.0.0` version.
+2. When `RabbitMQ.Client` shipped an official `7.0.0` stable package during the Aspire `8.x` lifetime, we added a new, forked client integration named `Aspire.RabbitMQ.Client.v7` with a dependency on `7.0.0` and the updates needed to work with v7. This let people explicitly opt into using v7.
+3. When Aspire 9 shipped, we "swapped" the dependencies around.
+ - The `Aspire.RabbitMQ.Client` package was updated to depend on v7 of `RabbitMQ.Client`.
+ - We created `Aspire.RabbitMQ.Client.v6` with the dependency limit `[6.8.1, 7.0.0)` to continue supporting version 6 of RabbitMQ.Client.
+ - `Aspire.RabbitMQ.Client.v7` was dead-ended, with no new Aspire 9 versions of this package.
+
+The currently maintained integration is `Aspire.RabbitMQ.Client`, which uses RabbitMQ.Client 7.x. The version-suffixed packages in this historical example are no longer maintained in this repository.
## Icon
diff --git a/tests/Aspire.MongoDB.Driver.v2.Tests/Aspire.MongoDB.Driver.v2.Tests.csproj b/tests/Aspire.MongoDB.Driver.v2.Tests/Aspire.MongoDB.Driver.v2.Tests.csproj
deleted file mode 100644
index ccdf3bf8437..00000000000
--- a/tests/Aspire.MongoDB.Driver.v2.Tests/Aspire.MongoDB.Driver.v2.Tests.csproj
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- $(AllTargetFrameworks)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/Aspire.MongoDB.Driver.v2.Tests/SnappyCompressionTests.cs b/tests/Aspire.MongoDB.Driver.v2.Tests/SnappyCompressionTests.cs
deleted file mode 100644
index b1f4abf14fc..00000000000
--- a/tests/Aspire.MongoDB.Driver.v2.Tests/SnappyCompressionTests.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.IO.Compression;
-using MongoDB.Driver.Core.Compression;
-using Snappier;
-using Xunit;
-
-namespace Aspire.MongoDB.Driver.Tests;
-
-public class SnappyCompressionTests
-{
- [Theory]
- [InlineData(0, false)]
- [InlineData(1, false)]
- [InlineData(1024, false)]
- [InlineData(131072, false)]
- [InlineData(131072, true)]
- public void DriverCompressorRoundTrips(int length, bool randomize)
- {
- var data = new byte[length];
- if (randomize)
- {
- new Random(42).NextBytes(data);
- }
- else
- {
- Array.Fill(data, (byte)'a');
- }
-
- var compressor = CreateDriverCompressor();
- using var input = new MemoryStream(data);
- using var compressed = new MemoryStream();
- compressor.Compress(input, compressed);
-
- compressed.Position = 0;
- using var decompressed = new MemoryStream();
- compressor.Decompress(compressed, decompressed);
-
- Assert.Equal(data, decompressed.ToArray());
- }
-
- [Fact]
- public void DriverCompressorReadsRawSnappyBlock()
- {
- // Raw Snappy: uncompressed length 5, literal tag (5 - 1) << 2, then "hello".
- // MongoDB uses raw blocks, not the framed SnappyStream format.
- // https://github.com/google/snappy/blob/main/format_description.txt
- byte[] data = [0x05, 0x10, (byte)'h', (byte)'e', (byte)'l', (byte)'l', (byte)'o'];
- using var input = new MemoryStream(data);
- using var output = new MemoryStream();
-
- CreateDriverCompressor().Decompress(input, output);
-
- Assert.Equal("hello"u8.ToArray(), output.ToArray());
- }
-
- [Fact]
- public void FramedStreamRoundTrips()
- {
- var data = new byte[131072];
- new Random(42).NextBytes(data);
- using var compressed = new MemoryStream();
- using (var compressor = new SnappyStream(compressed, CompressionMode.Compress, leaveOpen: true))
- {
- compressor.Write(data);
- }
-
- compressed.Position = 0;
- using var decompressor = new SnappyStream(compressed, CompressionMode.Decompress);
- using var output = new MemoryStream();
- decompressor.CopyTo(output);
-
- Assert.Equal(data, output.ToArray());
- }
-
- [Fact]
- public async Task MalformedFramedStreamThrows()
- {
- // The advisory's 15-byte frame has a compressed chunk containing only a checksum.
- // Keep the test's wait bounded if the vulnerable non-terminating decoder is restored.
- // https://github.com/advisories/GHSA-pggp-6c3x-2xmx
- await Task.Run(() =>
- {
- byte[] data = [0x00, 0x04, 0x00, 0x00, 0x64, 0x4e, 0x6c, 0x71, 0x79, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64];
- using var input = new MemoryStream(data);
- using var decompressor = new SnappyStream(input, CompressionMode.Decompress);
- using var output = new MemoryStream();
-
- Assert.Throws(() => decompressor.CopyTo(output));
- }).WaitAsync(TimeSpan.FromSeconds(30), TestContext.Current.CancellationToken);
- }
-
- private static ICompressor CreateDriverCompressor()
- {
- // The v2 implementation is internal. Exercise the shipped driver binary, rather than
- // duplicating its Snappier calls, to catch binary incompatibility with the dependency.
- var type = typeof(ICompressor).Assembly.GetType("MongoDB.Driver.Core.Compression.SnappyCompressor", throwOnError: true)!;
-
- return Assert.IsAssignableFrom(Activator.CreateInstance(type));
- }
-}
diff --git a/tests/Aspire.RabbitMQ.Client.Tests/AspireRabbitMQLoggingTests.cs b/tests/Aspire.RabbitMQ.Client.Tests/AspireRabbitMQLoggingTests.cs
index d682e5ed06c..909d2fabb8b 100644
--- a/tests/Aspire.RabbitMQ.Client.Tests/AspireRabbitMQLoggingTests.cs
+++ b/tests/Aspire.RabbitMQ.Client.Tests/AspireRabbitMQLoggingTests.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Concurrent;
+using System.Reflection;
using Aspire.Components.Common.TestUtilities;
using Aspire.Hosting.RabbitMQ;
using Aspire.TestUtilities;
@@ -14,12 +15,6 @@
using Testcontainers.RabbitMq;
using Xunit;
-#if RABBITMQ_V6
-using RabbitMQ.Client.Logging;
-#else
-using System.Reflection;
-#endif
-
namespace Aspire.RabbitMQ.Client.Tests;
public class AspireRabbitMQLoggingTests
@@ -227,36 +222,22 @@ public void TestExceptionWithInnerException()
Assert.Equal($"{innerException.GetType()}: {innerException.Message}", errorEvent[3].Value?.ToString());
}
-#if !RABBITMQ_V6
private static readonly object s_log =
Type.GetType("RabbitMQ.Client.Logging.RabbitMqClientEventSource, RabbitMQ.Client")!
.GetField("Log", BindingFlags.Static | BindingFlags.Public)!
.GetValue(null)!;
-#endif
private static void LogInfo(string message)
{
-#if RABBITMQ_V6
- RabbitMqClientEventSource.Log.Info(message);
-#else
s_log.GetType().GetMethod("Info")!.Invoke(s_log, new object[] { message });
-#endif
}
private static void LogWarn(string message)
{
-#if RABBITMQ_V6
- RabbitMqClientEventSource.Log.Warn(message);
-#else
s_log.GetType().GetMethod("Warn")!.Invoke(s_log, new object[] { message });
-#endif
}
private static void LogError(string message, Exception ex)
{
-#if RABBITMQ_V6
- RabbitMqClientEventSource.Log.Error(message, ex);
-#else
s_log.GetType().GetMethod("Error", [typeof(string), typeof(Exception)])!.Invoke(s_log, new object[] { message, ex });
-#endif
}
private sealed class LoggerProvider(TestLogger logger) : ILoggerProvider
diff --git a/tests/Aspire.RabbitMQ.Client.Tests/ConformanceTests.cs b/tests/Aspire.RabbitMQ.Client.Tests/ConformanceTests.cs
index 3184a85935f..1c30481fd3e 100644
--- a/tests/Aspire.RabbitMQ.Client.Tests/ConformanceTests.cs
+++ b/tests/Aspire.RabbitMQ.Client.Tests/ConformanceTests.cs
@@ -1,19 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics;
using Aspire.TestUtilities;
using Aspire.Components.ConformanceTests;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
-using RabbitMQ.Client;
-using Xunit;
-
-#if !RABBITMQ_V6
-using System.Diagnostics;
using Microsoft.Extensions.Logging;
using OpenTelemetry.Trace;
-#endif
+using RabbitMQ.Client;
+using Xunit;
namespace Aspire.RabbitMQ.Client.Tests;
@@ -41,11 +38,7 @@ public ConformanceTests(RabbitMQContainerFixture? containerFixture, ITestOutputH
protected override RequiredLogCategory[] RequiredLogCategories => [];
-#if RABBITMQ_V6
- protected override string ActivitySourceName => "Aspire.RabbitMQ.Client";
-#else
protected override string ActivitySourceName => "RabbitMQ.Client.Publisher";
-#endif
protected override string? ConfigurationSectionName => "Aspire:RabbitMQ:Client";
@@ -115,15 +108,6 @@ protected override void SetMetrics(RabbitMQClientSettings options, bool enabled)
protected override void TriggerActivity(IConnection service)
{
-#if RABBITMQ_V6
- var channel = service.CreateModel();
- channel.QueueDeclare("test-queue");
- channel.BasicPublish(
- exchange: "",
- routingKey: "test-queue",
- basicProperties: null,
- body: "hello world"u8.ToArray());
-#else
Task.Run(async () =>
{
using var channel = await service.CreateChannelAsync();
@@ -133,7 +117,6 @@ await channel.BasicPublishAsync(
routingKey: "test-queue",
body: "hello world"u8.ToArray());
}).Wait();
-#endif
}
protected override void SetupConnectionInformationIsDelayValidated()
@@ -141,7 +124,6 @@ protected override void SetupConnectionInformationIsDelayValidated()
Assert.Skip("RabbitMQ connects to localhost by default if the connection information isn't available.");
}
-#if !RABBITMQ_V6
[Fact]
[RequiresFeature(TestFeature.Testcontainers)]
public void TracingEnablesTheRightActivitySource()
@@ -183,5 +165,4 @@ private void RunActivitySourceTest(string? key)
private static void RunWithConnectionString(string connectionString, Action test)
=> test(new ConformanceTests(null) { ConnectionString = connectionString });
-#endif
}
diff --git a/tests/Aspire.RabbitMQ.Client.v6.Tests/Aspire.RabbitMQ.Client.v6.Tests.csproj b/tests/Aspire.RabbitMQ.Client.v6.Tests/Aspire.RabbitMQ.Client.v6.Tests.csproj
deleted file mode 100644
index f6d85623ea6..00000000000
--- a/tests/Aspire.RabbitMQ.Client.v6.Tests/Aspire.RabbitMQ.Client.v6.Tests.csproj
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- $(AllTargetFrameworks)
- $(DefineConstants);RABBITMQ_V6
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-