Skip to content

Commit 093d793

Browse files
authored
Python 5.0.6 (#1004)
* Python 5.0.6
1 parent d355724 commit 093d793

File tree

7 files changed

+9
-7
lines changed

7 files changed

+9
-7
lines changed

python/rocketmq/v5/client/balancer/queue_selector.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def select_next_queue(self):
6868
def select_queue_by_hash_key(self, key):
6969
hash_object = hashlib.sha256(key.encode('utf-8'))
7070
hash_code = int.from_bytes(hash_object.digest(), byteorder='big')
71-
print(f"hashcode: {hash_code}")
7271
return self.__message_queues[hash_code % len(self.__message_queues)]
7372

7473
def all_queues(self):

python/rocketmq/v5/client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ def __schedule_update_setting(self):
227227
asyncio.set_event_loop(self._rpc_channel_io_loop())
228228
while True:
229229
if self.__client_thread_task_enabled is True:
230-
self.__sync_setting_scheduler_threading_event.wait(5)
231230
logger.debug(f"{self.__str__()} run update setting in scheduler.")
232231
try:
233232
all_endpoints = self.__get_all_endpoints().values()
@@ -238,6 +237,7 @@ def __schedule_update_setting(self):
238237
logger.error(
239238
f"{self.__str__()} scheduler set setting raise exception: {e}"
240239
)
240+
self.__sync_setting_scheduler_threading_event.wait(300)
241241
else:
242242
break
243243
logger.info(f"{self.__str__()} stop scheduler for update setting success.")
@@ -273,7 +273,7 @@ def __start_async_rpc_callback_handler(self):
273273
thread_name_prefix=f"client_callback_worker-{self.__client_id}")
274274
logger.info(f"{self.__str__()} start callback executor success. max_workers:{workers}")
275275
except Exception as e:
276-
print(f"{self.__str__()} start async rpc callback raise exception: {e}")
276+
logger.error(f"{self.__str__()} start async rpc callback raise exception: {e}")
277277
raise e
278278

279279
@staticmethod

python/rocketmq/v5/client/metrics/client_metrics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from rocketmq.v5.client.connection import RpcEndpoints
2929
from rocketmq.v5.log import logger
3030
from rocketmq.v5.model import HistogramEnum, MessageMetricType, MetricContext
31+
from rocketmq.v5.util import Signature
3132

3233

3334
class ClientMetrics:
@@ -142,6 +143,7 @@ def __meter_provider_start(self):
142143
endpoint=self.__endpoints.__str__(),
143144
insecure=True,
144145
timeout=ClientMetrics.METRIC_EXPORTER_RPC_TIMEOUT,
146+
headers=Signature.metadata(self.__client_configuration, self.__client_id)
145147
)
146148
# create a metric reader and set the export interval
147149
reader = PeriodicExportingMetricReader(

python/rocketmq/v5/consumer/simple_consumer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__(
4242
consumer_group,
4343
subscription: dict = None,
4444
await_duration=20,
45+
tls_enable=False
4546
):
4647
if consumer_group is None or consumer_group.strip() == "":
4748
raise IllegalArgumentException("consumerGroup should not be null")
@@ -56,6 +57,7 @@ def __init__(
5657
client_configuration,
5758
None if subscription is None else subscription.keys(),
5859
ClientType.SIMPLE_CONSUMER,
60+
tls_enable
5961
)
6062
self.__consumer_group = consumer_group
6163
self.__await_duration = await_duration # long polling timeout, seconds
@@ -98,7 +100,7 @@ def unsubscribe(self, topic):
98100
"unable to remove subscription because simple consumer is not running"
99101
)
100102

101-
if topic in self.__subscriptions:
103+
if self.__subscriptions.contains(topic):
102104
self.__subscriptions.remove(topic)
103105
self._remove_unused_topic_route_data(topic)
104106

python/rocketmq/v5/producer/producer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ def shutdown(self):
303303
def __send(self, message: Message, topic_queue, attempt=1) -> SendReceipt:
304304
req = self.__send_req(message)
305305
send_context = self.client_metrics.send_before(message.topic)
306-
print(f"{topic_queue}")
307306
send_message_future = self.rpc_client.send_message_async(
308307
topic_queue.endpoints,
309308
req,

python/rocketmq/v5/util/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Misc:
2929
__OS_NAME = None
3030
TOPIC_PATTERN = compile(r"^[%a-zA-Z0-9_-]+$")
3131
CONSUMER_GROUP_PATTERN = compile(r"^[%a-zA-Z0-9_-]+$")
32-
SDK_VERSION = "5.0.5"
32+
SDK_VERSION = "5.0.6"
3333

3434
@staticmethod
3535
def sdk_language():

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='rocketmq-python-client',
20-
version='5.0.5',
20+
version='5.0.6',
2121
packages=find_packages(),
2222
install_requires=[
2323
"grpcio>=1.5.0",

0 commit comments

Comments
 (0)