From 6be319dfa36062cab1246bca6960756d0c168222 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Thu, 9 Nov 2023 21:37:46 +0000 Subject: [PATCH] docs: Explicitly document underlying `BMQ_BROKER_URI` behavior (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `libbmq` supports a `BMQ_BROKER_URI` environment variable, which when set, [overrides any broker URI passed in through the `SessionOptions`][envvar]. As the Python SDK is a set of bindings on top of `libbmq`, we inherit this behavior as well. More specifically, setting `BMQ_BROKER_URI` overrides whatever value is passed in with the `broker` argument to the `blazingmq.Session` object. Our integration tests use the environment variable in this way, so it is important to document it correctly. This patch documents this behavior, which is stable and supported in `libbmq`, is exposed through the Python SDK, and is used by the Python SDK’s tests. [envvar]: https://bloomberg.github.io/blazingmq/docs/apidocs/cpp_apidocs/group__bmqa__session.html Signed-off-by: Patrick M. Niedzielski --- src/blazingmq/_session.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/blazingmq/_session.py b/src/blazingmq/_session.py index aed3619..efad6d0 100644 --- a/src/blazingmq/_session.py +++ b/src/blazingmq/_session.py @@ -220,7 +220,9 @@ class Session: received by the session. on_message: an optional callback to process `Message` objects received by the session. - broker: TCP address of the broker (default: 'tcp://localhost:30114') + broker: TCP address of the broker (default: 'tcp://localhost:30114'). + If the environment variable ``BMQ_BROKER_URI`` is set, its value + will override whatever broker address is passed via this argument. message_compression_algorithm: the type of compression to apply to messages being posted via this session object. timeout: maximum number of seconds to wait for requests on this