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

[EventHubs] user agent impl update #18040

Merged
merged 2 commits into from
Apr 15, 2021
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
6 changes: 6 additions & 0 deletions sdk/eventhub/azure-eventhub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 5.4.1 (Unreleased)

**Bug Fixes**

- Fixed bug that custom user agent string should be put in front of the built-in user agent string instead of being appended.

## 5.4.0 (2021-04-07)

This version follows from version 5.3.1, rather than 5.4.0b1 so that the preview idempotent producer feature is not included.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class EventHubConsumerClient(ClientBase):
:keyword bool logging_enable: Whether to output network trace logs to the logger. Default is `False`.
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
:keyword str user_agent: If specified, this will be added in front of the user agent string.
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
Default value is 3. The context of `retry_total` in receiving is special: The `receive` method is implemented
by a while-loop calling internal receive method in each iteration. In the `receive` case,
Expand Down Expand Up @@ -209,7 +209,7 @@ def from_connection_string(cls, conn_str, consumer_group, **kwargs):
Additionally the following keys may also be present: `'username', 'password'`.
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
:keyword str user_agent: If specified, this will be added in front of the user agent string.
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
Default value is 3. The context of `retry_total` in receiving is special: The `receive` method is implemented
by a while-loop calling internal receive method in each iteration. In the `receive` case,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class EventHubProducerClient(ClientBase):
:keyword bool logging_enable: Whether to output network trace logs to the logger. Default is `False`.
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
:keyword str user_agent: If specified, this will be added in front of the user agent string.
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs. Default
value is 3.
:keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection
Expand Down Expand Up @@ -171,7 +171,7 @@ def from_connection_string(cls, conn_str, **kwargs):
Additionally the following keys may also be present: `'username', 'password'`.
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
:keyword str user_agent: If specified, this will be added in front of the user agent string.
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
Default value is 3.
:keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/azure-eventhub/azure/eventhub/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def create_properties(user_agent=None):
USER_AGENT_PREFIX, VERSION, framework, platform_str
)
if user_agent:
final_user_agent = "{} {}".format(final_user_agent, user_agent)
final_user_agent = "{} {}".format(user_agent, final_user_agent)

if len(final_user_agent) > MAX_USER_AGENT_LENGTH:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/azure-eventhub/azure/eventhub/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Licensed under the MIT License.
# ------------------------------------

VERSION = "5.4.0"
VERSION = "5.4.1"
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class EventHubConsumerClient(ClientBaseAsync):
:keyword bool logging_enable: Whether to output network trace logs to the logger. Default is `False`.
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
:keyword str user_agent: If specified, this will be added in front of the user agent string.
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
Default value is 3. The context of `retry_total` in receiving is special: The `receive` method is implemented
by a while-loop calling internal receive method in each iteration. In the `receive` case,
Expand Down Expand Up @@ -229,7 +229,7 @@ def from_connection_string(
Additionally the following keys may also be present: `'username', 'password'`.
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
:keyword str user_agent: If specified, this will be added in front of the user agent string.
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
Default value is 3. The context of `retry_total` in receiving is special: The `receive` method is implemented
by a while-loop calling internal receive method in each iteration. In the `receive` case,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class EventHubProducerClient(ClientBaseAsync):
:keyword bool logging_enable: Whether to output network trace logs to the logger. Default is `False`.
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
:keyword str user_agent: If specified, this will be added in front of the user agent string.
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs. Default
value is 3.
:keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection
Expand Down Expand Up @@ -189,7 +189,7 @@ def from_connection_string(
Additionally the following keys may also be present: `'username', 'password'`.
:keyword float auth_timeout: The time in seconds to wait for a token to be authorized by the service.
The default value is 60 seconds. If set to 0, no timeout will be enforced from the client.
:keyword str user_agent: The user agent that should be appended to the built-in user agent string.
:keyword str user_agent: If specified, this will be added in front of the user agent string.
:keyword int retry_total: The total number of attempts to redo a failed operation when an error occurs.
Default value is 3.
:keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection
Expand Down