|
@@ -55,7 +55,8 @@ class AliyunRocketMQQueueBackend(MessageQueueBackend):
|
|
has_consumer: bool = False, has_producer: bool = False,
|
|
has_consumer: bool = False, has_producer: bool = False,
|
|
group_id: Optional[str] = None,
|
|
group_id: Optional[str] = None,
|
|
ak:Optional[str] = None, sk: Optional[str] = None,
|
|
ak:Optional[str] = None, sk: Optional[str] = None,
|
|
- topic_type: Optional[str] = None):
|
|
|
|
|
|
+ topic_type: Optional[str] = None,
|
|
|
|
+ await_duration: int = 20):
|
|
if not has_consumer and not has_producer:
|
|
if not has_consumer and not has_producer:
|
|
raise ValueError("At least one of has_consumer or has_producer must be True.")
|
|
raise ValueError("At least one of has_consumer or has_producer must be True.")
|
|
self.has_consumer = has_consumer
|
|
self.has_consumer = has_consumer
|
|
@@ -66,7 +67,7 @@ class AliyunRocketMQQueueBackend(MessageQueueBackend):
|
|
self.topic = topic
|
|
self.topic = topic
|
|
self.group_id = group_id
|
|
self.group_id = group_id
|
|
if has_consumer:
|
|
if has_consumer:
|
|
- self.consumer = SimpleConsumer(mq_config, group_id)
|
|
|
|
|
|
+ self.consumer = SimpleConsumer(mq_config, group_id, await_duration=await_duration)
|
|
self.consumer.startup()
|
|
self.consumer.startup()
|
|
self.consumer.subscribe(self.topic)
|
|
self.consumer.subscribe(self.topic)
|
|
if has_producer:
|
|
if has_producer:
|