Skip to content

Commit 8a143e1

Browse files
authored
[EventHubs] user agent impl update (Azure#18040)
* user agent impl update * fix typo
1 parent 0629108 commit 8a143e1

File tree

7 files changed

+16
-10
lines changed

7 files changed

+16
-10
lines changed

sdk/eventhub/azure-eventhub/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 5.4.1 (Unreleased)
4+
5+
**Bug Fixes**
6+
7+
- Fixed bug that custom user agent string should be put in front of the built-in user agent string instead of being appended.
8+
39
## 5.4.0 (2021-04-07)
410

511
This version follows from version 5.3.1, rather than 5.4.0b1 so that the preview idempotent producer feature is not included.

sdk/eventhub/azure-eventhub/azure/eventhub/_consumer_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class EventHubConsumerClient(ClientBase):
6262
:keyword bool logging_enable: Whether to output network trace logs to the logger. Default is `False`.
6363
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
6464
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
65-
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
65+
:keyword str user_agent: If specified, this will be added in front of the user agent string.
6666
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
6767
Default value is 3. The context of `retry_total` in receiving is special: The `receive` method is implemented
6868
by a while-loop calling internal receive method in each iteration. In the `receive` case,
@@ -209,7 +209,7 @@ def from_connection_string(cls, conn_str, consumer_group, **kwargs):
209209
Additionally the following keys may also be present: `'username', 'password'`.
210210
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
211211
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
212-
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
212+
:keyword str user_agent: If specified, this will be added in front of the user agent string.
213213
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
214214
Default value is 3. The context of `retry_total` in receiving is special: The `receive` method is implemented
215215
by a while-loop calling internal receive method in each iteration. In the `receive` case,

sdk/eventhub/azure-eventhub/azure/eventhub/_producer_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class EventHubProducerClient(ClientBase):
3636
:keyword bool logging_enable: Whether to output network trace logs to the logger. Default is `False`.
3737
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
3838
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
39-
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
39+
:keyword str user_agent: If specified, this will be added in front of the user agent string.
4040
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs. Default
4141
value is 3.
4242
:keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection
@@ -171,7 +171,7 @@ def from_connection_string(cls, conn_str, **kwargs):
171171
Additionally the following keys may also be present: `'username', 'password'`.
172172
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
173173
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
174-
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
174+
:keyword str user_agent: If specified, this will be added in front of the user agent string.
175175
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
176176
Default value is 3.
177177
:keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection

sdk/eventhub/azure-eventhub/azure/eventhub/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def create_properties(user_agent=None):
9191
USER_AGENT_PREFIX, VERSION, framework, platform_str
9292
)
9393
if user_agent:
94-
final_user_agent = "{} {}".format(final_user_agent, user_agent)
94+
final_user_agent = "{} {}".format(user_agent, final_user_agent)
9595

9696
if len(final_user_agent) > MAX_USER_AGENT_LENGTH:
9797
raise ValueError(

sdk/eventhub/azure-eventhub/azure/eventhub/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Licensed under the MIT License.
44
# ------------------------------------
55

6-
VERSION = "5.4.0"
6+
VERSION = "5.4.1"

sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_client_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class EventHubConsumerClient(ClientBaseAsync):
6969
:keyword bool logging_enable: Whether to output network trace logs to the logger. Default is `False`.
7070
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
7171
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
72-
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
72+
:keyword str user_agent: If specified, this will be added in front of the user agent string.
7373
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
7474
Default value is 3. The context of `retry_total` in receiving is special: The `receive` method is implemented
7575
by a while-loop calling internal receive method in each iteration. In the `receive` case,
@@ -229,7 +229,7 @@ def from_connection_string(
229229
Additionally the following keys may also be present: `'username', 'password'`.
230230
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
231231
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
232-
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
232+
:keyword str user_agent: If specified, this will be added in front of the user agent string.
233233
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
234234
Default value is 3. The context of `retry_total` in receiving is special: The `receive` method is implemented
235235
by a while-loop calling internal receive method in each iteration. In the `receive` case,

sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_client_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class EventHubProducerClient(ClientBaseAsync):
3939
:keyword bool logging_enable: Whether to output network trace logs to the logger. Default is `False`.
4040
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
4141
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
42-
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
42+
:keyword str user_agent: If specified, this will be added in front of the user agent string.
4343
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs. Default
4444
value is 3.
4545
:keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection
@@ -189,7 +189,7 @@ def from_connection_string(
189189
Additionally the following keys may also be present: `'username', 'password'`.
190190
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
191191
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
192-
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
192+
:keyword str user_agent: If specified, this will be added in front of the user agent string.
193193
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
194194
Default value is 3.
195195
:keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection

0 commit comments

Comments
 (0)