Skip to content

Commit 209a7b1

Browse files
Fix transport encoding header obsoletion (#1208)
* Fix obsoletion warning for SendTransportEncodingHeader to indicate we will no longer be sending this header in the next version to align it with the transport extension * Remove DoNotSendTransportEncodingHeader APIs since they have never been shipped (only as alpha to MT connector) --------- Co-authored-by: Daniel Marbach <[email protected]>
1 parent b06aff6 commit 209a7b1

File tree

3 files changed

+4
-32
lines changed

3 files changed

+4
-32
lines changed

src/Tests/ApprovalFiles/APIApprovals.Approve.approved.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@ namespace NServiceBus
1616
"ersion 6.0.0.", true)]
1717
public AzureServiceBusTransport(string fullyQualifiedNamespace, Azure.Core.TokenCredential tokenCredential) { }
1818
public AzureServiceBusTransport(string fullyQualifiedNamespace, Azure.Core.TokenCredential tokenCredential, NServiceBus.TopicTopology topology) { }
19-
[System.Obsolete(@"The transport by default no longer sends the transport encoding header for wire compatibility with NServiceBus.AzureServiceBus, requiring an opt-in for the header to be sent. Use `SendTransportEncodingHeader` instead. The member currently throws a NotImplementedException. Will be removed in version 6.0.0.", true)]
20-
public bool DoNotSendTransportEncodingHeader { get; set; }
2119
public bool EnablePartitioning { get; set; }
2220
public int EntityMaximumSize { get; set; }
2321
public System.TimeSpan? MaxAutoLockRenewalDuration { get; set; }
2422
public System.Action<NServiceBus.Transport.IOutgoingTransportOperation, Azure.Messaging.ServiceBus.ServiceBusMessage>? OutgoingNativeMessageCustomization { get; set; }
2523
public int? PrefetchCount { get; set; }
2624
public int PrefetchMultiplier { get; set; }
2725
public Azure.Messaging.ServiceBus.ServiceBusRetryOptions? RetryPolicyOptions { get; set; }
28-
[System.Obsolete("Next versions of the transport will by default no longer send the transport encod" +
29-
"ing header for wire compatibility, requiring an opt-in for the header to be sent" +
30-
". Will be treated as an error from version 6.0.0. Will be removed in version 7.0" +
31-
".0.", false)]
26+
[System.Obsolete("Next versions of the transport will no longer support sending the transport encod" +
27+
"ing header. Will be treated as an error from version 6.0.0. Will be removed in v" +
28+
"ersion 7.0.0.", false)]
3229
public bool SendTransportEncodingHeader { get; set; }
3330
[System.Obsolete("Setting the subscription name is accessible via the topology. Use `OverrideSubscr" +
3431
"iptionNameFor` instead. The member currently throws a NotImplementedException. W" +
@@ -61,8 +58,6 @@ namespace NServiceBus
6158
"viceBusTransport or via UseTransport<AzureServiceBusTransport> method. Will be r" +
6259
"emoved in version 6.0.0.", true)]
6360
public static NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> CustomTokenCredential(this NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> transportExtensions, string fullyQualifiedNamespace, Azure.Core.TokenCredential tokenCredential) { }
64-
[System.Obsolete(@"The transport by default no longer sends the transport encoding header for wire compatibility with NServiceBus.AzureServiceBus, requiring an opt-in for the header to be sent. Use `SendTransportEncodingHeader(this TransportExtensions<AzureServiceBusTransport> transportExtensions)` instead. Will be treated as an error from version 6.0.0. The member currently throws a NotImplementedException. Will be removed in version 7.0.0.", false)]
65-
public static NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> DoNotSendTransportEncodingHeader(this NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> transportExtensions) { }
6661
public static NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> EnablePartitioning(this NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> transportExtensions) { }
6762
public static NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> EntityMaximumSize(this NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> transportExtensions, int maximumSizeInGB) { }
6863
public static NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> MaxAutoLockRenewalDuration(this NServiceBus.TransportExtensions<NServiceBus.AzureServiceBusTransport> transportExtensions, System.TimeSpan maximumAutoLockRenewalDuration) { }

src/Transport/AzureServiceBusTransport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public IWebProxy? WebProxy
310310
/// <summary>
311311
/// When set will add `NServiceBus.Transport.Encoding` header for wire compatibility with NServiceBus.AzureServiceBus. The default value is <c>false</c>.
312312
/// </summary>
313-
[ObsoleteEx(Message = "Next versions of the transport will by default no longer send the transport encoding header for wire compatibility, requiring an opt-in for the header to be sent.",
313+
[ObsoleteEx(Message = "Next versions of the transport will no longer support sending the transport encoding header.",
314314
TreatAsErrorFromVersion = "6",
315315
RemoveInVersion = "7")]
316316
public bool SendTransportEncodingHeader

src/Transport/obsoletes-v5.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,6 @@ public Func<Type, string> SubscriptionRuleNamingConvention
4949
get => throw new NotImplementedException();
5050
set => throw new NotImplementedException();
5151
}
52-
53-
[ObsoleteEx(
54-
Message =
55-
"The transport by default no longer sends the transport encoding header for wire compatibility with NServiceBus.AzureServiceBus, requiring an opt-in for the header to be sent.",
56-
TreatAsErrorFromVersion = "5",
57-
RemoveInVersion = "6",
58-
ReplacementTypeOrMember = "SendTransportEncodingHeader")]
59-
public bool DoNotSendTransportEncodingHeader
60-
{
61-
get => throw new NotImplementedException();
62-
set => throw new NotImplementedException();
63-
}
6452
}
6553

6654
public static partial class AzureServiceBusTransportSettingsExtensions
@@ -95,17 +83,6 @@ public static TransportExtensions<AzureServiceBusTransport> SubscriptionNamingCo
9583
public static TransportExtensions<AzureServiceBusTransport> SubscriptionRuleNamingConvention(
9684
this TransportExtensions<AzureServiceBusTransport> transportExtensions,
9785
Func<Type, string> subscriptionRuleNamingConvention) => throw new NotImplementedException();
98-
99-
[ObsoleteEx(
100-
Message =
101-
"The transport by default no longer sends the transport encoding header for wire compatibility with NServiceBus.AzureServiceBus, requiring an opt-in for the header to be sent.",
102-
TreatAsErrorFromVersion = "6",
103-
RemoveInVersion = "7",
104-
ReplacementTypeOrMember =
105-
"SendTransportEncodingHeader(this TransportExtensions<AzureServiceBusTransport> transportExtensions)")]
106-
public static TransportExtensions<AzureServiceBusTransport> DoNotSendTransportEncodingHeader(
107-
this TransportExtensions<AzureServiceBusTransport> transportExtensions) =>
108-
throw new NotImplementedException();
10986
}
11087

11188
public abstract partial class TopicTopology

0 commit comments

Comments
 (0)