Skip to content

Commit 9027985

Browse files
committed
fix typo, indentation, deprecated method
Change-Id: Ib0fcf35f367c3292ab415bcf46cfd4105c57248a
1 parent be45708 commit 9027985

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

kombu/transport/rocketmq.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
CID-{queue} as consumer group of queues. When configuring multiple queues, be sure to maintain
6060
consistency of the `subscription relationship <https://rocketmq.apache.org/docs/domainModel/09subscription>`_.
6161
62-
* Queues are implicitly durable, ant they do not support features such as reply_to or
62+
* Queues are implicitly durable, and they do not support features such as reply_to or
6363
exclusive queues.
6464
6565
Transport Options
@@ -83,18 +83,18 @@
8383
with Connection('rocketmq://ak:sk@endpoint:port//') as conn:
8484
# or
8585
with Connection('rocketmq://ak:sk@endpoint:port//', transport_options={
86-
'backoff_policy': [30, 60, 90, 120, 240, 300],
87-
'consumer_options': {
88-
'global_group_id': 'CID-ALL-IN-ONE',
89-
'group_format': 'CID-{}',
90-
'topic_config': {
91-
'topic_xx': {
92-
'group_id': 'CID-xx',
93-
'filter_exp': 'exp'
94-
}
95-
}
96-
}
97-
}) as conn:
86+
'backoff_policy': [30, 60, 90, 120, 240, 300],
87+
'consumer_options': {
88+
'global_group_id': 'CID-ALL-IN-ONE',
89+
'group_format': 'CID-{}',
90+
'topic_config': {
91+
'topic_xx': {
92+
'group_id': 'CID-xx',
93+
'filter_exp': 'exp'
94+
}
95+
}
96+
}
97+
}) as conn:
9898
# The group_format and global_group_id are exclusive, and global_group_id has higher priority.
9999
# If topic config exists, use its specified group, and others use global or formatted one.
100100
@@ -245,7 +245,7 @@ def reject(self, delivery_tag, requeue=False):
245245
:raises Exception: if operation fails
246246
"""
247247
if delivery_tag not in self._not_yet_acked:
248-
logger.warn(f'reject message not found. {delivery_tag}')
248+
logger.warning(f'reject message not found. {delivery_tag}')
249249
return
250250
if requeue:
251251
message = self._not_yet_acked.pop(delivery_tag)
@@ -607,9 +607,6 @@ def _get_bulk(self, queue, callback=None):
607607
max_retries=1, interval_start=2, interval_step=0, timeout=self.await_duration * 2 + 3
608608
)
609609

610-
if not messages:
611-
pass
612-
613610
for message in messages:
614611
if message.topic in self._auto_ack_topics:
615612
_ack_rocketmq_message(consumer, message, False)
@@ -846,7 +843,7 @@ def _ack_rocketmq_message(consumer: SimpleConsumer, message: RocketmqMessage,
846843
:raises KombuError: If acknowledgment fails and `raise_exception` is True.
847844
"""
848845
if not consumer or not consumer.is_running:
849-
logger.warn(f'unexpected condition: consumer is None or not running. {message}')
846+
logger.warning(f'unexpected condition: consumer is None or not running. {message}')
850847
return
851848
try:
852849
retry_over_time(

0 commit comments

Comments
 (0)