Python SDK中服务总线Queu的scheduled queue属性

2024-10-04 01:34:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我们在开发中使用Azure服务总线,需要使用服务总线的schedulequeue属性。我们找到了如何使用C实现它,但是,我们如何使用Python SDK中的属性来实现服务总线队列?你知道吗


Tags: 属性队列sdkazure总线schedulequeue
1条回答
网友
1楼 · 发布于 2024-10-04 01:34:46

查看文档:

This section describes how to use Broker and User properties defined here: Message Headers and Properties

sent_msg = Message(b'This is the third message',
               broker_properties={'Label': 'M3'},
               custom_properties={'Priority': 'Medium',
                                  'Customer': 'ABC'}
       )

在引用的链接中,可以找到代理消息的ScheduledEnqueueTimeUtc属性,因此可以这样设置:

sent_msg = Message(b'This is the third message',
               broker_properties={'ScheduledEnqueueTimeUtc': datetime(2011, 12, 14)}
       )

相关问题 更多 >