This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k
stars
1.99k
forks
source link
[FEATURE REQ] Make each Azure Spring Identifier only used in one place. #26197
Now some Azure Spring Identifier be used in more than one place.
az-sp-kv-ct be used in AzureKeyVaultCertificateAutoConfiguration and azure-security-keyvault-jca-user-agent-value-prefix.txt.
az-sp-eh be used in AzureBlobCheckpointStoreConfiguration, AzureEventHubsClientBuilderConfiguration, DedicatedConsumerConnectionConfiguration, AzureEventHubsProcessorClientConfiguration, AzureEventHubsClientBuilderConfiguration
az-sp-bus be used in PremiumServiceBusJmsAutoConfiguration, AzureServiceBusClientBuilderConfiguration, NoneSessionConsumerClientConfiguration, SessionConsumerClientConfiguration, NoneSessionProcessorClientConfiguration, SessionProcessorClientConfiguration, AzureServiceBusProducerClientConfiguration
az-si-sb be used in DefaultServiceBusNamespaceProcessorFactory(2 places), DefaultServiceBusNamespaceProducerFactory.
az-si-eh be used in DefaultEventHubsNamespaceProcessorFactory, DefaultEventHubsNamespaceProducerFactory.
Solution
Design new identifier for every usage scenario.
Identifier max length
Because ClientOptions#MAX_APPLICATION_ID_LENGTH=24, and we may have version like 4.0.0.beta-1 which length is 12. The remaining length is 24 - 12 = 12.
Identifier format.
Identifier prefix.
About identifier prefix, 2 options come into mind:
Option 1: Keep same with version 3.x. Use az-sp- as prefix.
Here is the identifiers used in version 3.x:
ApplicationId
Description
az-se-kv-jca
Azure Security KeyVault JCA
az-sp-kv-ct
Azure Spring KeyVault Certificates
az-sp-kv
Azure Spring KeyVault Secrets
az-sp-bus
Azure Spring Service Bus
az-sp-sb
Azure Spring Storage Blob
az-sp-sf
Azure Spring Storage Files
az-sp-aad
Azure Spring Active Directory
az-sp-b2c
Azure Spring Active Directory B2C
Pros:
Keep same with previous version.
az-sp- is not easy to have conflict with other User-Agent.
Cons:
The length of az-sp- is 6, there will be only 12-6=6 left. It may not enough to encode all identifiers.
Option 2: Use as- as prefix.
Pros:
There will be 12-3=9 left.
Cons:
The possibility of conflicting with other User-Agent is much higher.
Not same with previous version. Which means we need more efforts to maintain the logic of BI.
I decide to choose option 1: Use az-sp- as prefix.
Identifier suffix
In version 3.x, we already have identifier like az-sp-kv-ct, which means Azure Spring KeyVault Certificate. We can continue this style: Use abbreviation as suffix.
But Some services have many scenarios, for example, Now there are 10 identifiers about ServiceBus.
We can use az-sp-sb-nc for Azure Spring ServiceBus Namespace No Sessioon Processor Client. and az-sp-sb-sc for Azure Spring ServiceBus Namespace Sender Client Builder Factory. But after we use abbreviations like this, it's hard to know what does az-sp-sb-nc mean.
And after the project continue developing, there maybe more identifiers come up. It's hard to manage these abbreviations.
Here is one solution: Use number instead of abbreviations. For example: az-sp-sb-01 means Azure Spring ServiceBus Client Builder Factory, and az-sp-sb-02 means Azure Spring ServiceBus Namespace No Session Processor Client.
If we add new identifiers for ServiceBus in the future, we just need to increase number: 01 -> 02 -> 03 -> ... -> 99 -> 00 (10 10 = 100 in total). If we still have more identifiers, we can use aa -> ab -> ac -> zz (26 26 in total), I think that's enough.
Identifier table.
Identifier value and description
NO
Identifer value
Description
1
az-se-kv-jc
Azure Seciruty KeyVault Jca
2
az-sp-ac-01
Azure Spring App Configuration Client Builder Factory
3
az-sp-ad-01
Azure Spring Azure Active Directory Authorization Code Grant Request
4
az-sp-bc-01
Azure Spring Azure Active Directory B2C Authorization Code Grant Request
5
az-sp-bs-01
Azure Spring BlobService Client Builder Factory
6
az-sp-bs-02
Azure Spring Blog Service Eveht Hub Processor Blob Service Client Builder Factory
7
az-sp-cs-01
Azure Spring Cosmos Client Builder Factory
8
az-sp-eh-01
Azure Spring EventHubs Client Builder Factory
9
az-sp-eh-02
Azure Spring EventHubs Client Builder Factory for Consumer
10
az-sp-eh-03
Azure Spring EventHubs Client Builder Factory for Processor
11
az-sp-eh-04
Azure Spring EventHubs Client Builder Factory for Produder
12
az-sp-eh-05
Azure Spring EventHubs Namespace Processor Client Builder Factory
13
az-sp-eh-06
Azure Spring EventHubs Namespace Producer Client Builder Factory
14
az-sp-kv-01
Azure Spring KeyVault Certificate Client Builder Factory
15
az-sp-kv-02
Azure Spring KeyVault Certificate JCA
16
az-sp-kv-03
Azure Spring KeyVault Secret Client Fuilder Factory
17
az-sp-qs-01
Azure Spring QueueService Client Builder Factory
18
az-sp-sb-01
Azure Spring ServiceBus Client Builder Factory
19
az-sp-sb-02
Azure Spring ServiceBus Namespace No Session Processor Client
20
az-sp-sb-03
Azure Spring ServiceBus Namespace Sender Client Builder Factory
21
az-sp-sb-04
Azure Spring ServiceBus Namespace Session Processor Client
22
az-sp-sb-05
Azure Spring ServiceBus No Session Processor Client Builder Factory
23
az-sp-sb-06
Azure Spring ServiceBus No Session Receiver Client Builder Factory
24
az-sp-sb-07
Azure Spring ServiceBus Premium Connection Factory
25
az-sp-sb-08
Azure Spring ServiceBus Sender Client Builder Factory
26
az-sp-sb-09
Azure Spring ServiceBus Session Processor Client Builder Factory
27
az-sp-sb-10
Azure Spring ServiceBus Session Receiver Client Builder Factory
Current problem
Now some Azure Spring Identifier be used in more than one place.
az-sp-kv-ct
be used in AzureKeyVaultCertificateAutoConfiguration and azure-security-keyvault-jca-user-agent-value-prefix.txt.az-sp-eh
be used in AzureBlobCheckpointStoreConfiguration, AzureEventHubsClientBuilderConfiguration, DedicatedConsumerConnectionConfiguration, AzureEventHubsProcessorClientConfiguration, AzureEventHubsClientBuilderConfigurationaz-sp-bus
be used in PremiumServiceBusJmsAutoConfiguration, AzureServiceBusClientBuilderConfiguration, NoneSessionConsumerClientConfiguration, SessionConsumerClientConfiguration, NoneSessionProcessorClientConfiguration, SessionProcessorClientConfiguration, AzureServiceBusProducerClientConfigurationaz-si-sb
be used in DefaultServiceBusNamespaceProcessorFactory(2 places), DefaultServiceBusNamespaceProducerFactory.az-si-eh
be used in DefaultEventHubsNamespaceProcessorFactory, DefaultEventHubsNamespaceProducerFactory.Solution
Design new identifier for every usage scenario.
Identifier max length
Because ClientOptions#MAX_APPLICATION_ID_LENGTH=24, and we may have version like
4.0.0.beta-1
which length is 12. The remaining length is 24 - 12 = 12.Identifier format.
Identifier prefix.
About identifier prefix, 2 options come into mind:
Option 1: Keep same with version 3.x. Use
az-sp-
as prefix.Here is the identifiers used in version 3.x:
Pros:
az-sp-
is not easy to have conflict with other User-Agent.Cons:
az-sp-
is 6, there will be only 12-6=6 left. It may not enough to encode all identifiers.Option 2: Use
as-
as prefix.Pros:
Cons:
I decide to choose option 1: Use
az-sp-
as prefix.Identifier suffix
In version 3.x, we already have identifier like
az-sp-kv-ct
, which means Azure Spring KeyVault Certificate. We can continue this style: Use abbreviation as suffix.But Some services have many scenarios, for example, Now there are 10 identifiers about ServiceBus.
We can use
az-sp-sb-nc
forAzure Spring ServiceBus Namespace No Sessioon Processor Client
. andaz-sp-sb-sc
forAzure Spring ServiceBus Namespace Sender Client Builder Factory
. But after we use abbreviations like this, it's hard to know what doesaz-sp-sb-nc
mean.And after the project continue developing, there maybe more identifiers come up. It's hard to manage these abbreviations.
Here is one solution: Use number instead of abbreviations. For example:
az-sp-sb-01
meansAzure Spring ServiceBus Client Builder Factory
, andaz-sp-sb-02
meansAzure Spring ServiceBus Namespace No Session Processor Client
.If we add new identifiers for ServiceBus in the future, we just need to increase number:
01
->02
->03
-> ... ->99
->00
(10 10 = 100 in total). If we still have more identifiers, we can useaa
->ab
->ac
->zz
(26 26 in total), I think that's enough.Identifier table.
Identifier value and description
Identifier value and usage
Tasks