<p>我不太确定,但是使用python,这里是打开连接的方法</p>
<pre><code>def open(self):
"""
Open the Sender using the supplied conneciton.
If the handler has previously been redirected, the redirect
context will be used to create a new handler before opening it.
:param connection: The underlying client shared connection.
:type: connection: ~uamqp.connection.Connection
"""
self.running = True
if self.redirected:
self.target = self.redirected.address
self._handler = SendClient(
self.target,
auth=self.client.get_auth(),
debug=self.client.debug,
msg_timeout=self.timeout,
error_policy=self.retry_policy,
keep_alive_interval=self.keep_alive,
client_name=self.name,
properties=self.client.create_properties())
self._handler.open()
while not self._handler.client_ready():
time.sleep(0.05)
</code></pre>
<p>这是<strong>初始化</strong></p>
^{pr2}$
<p>我相信,下面的函数行只会创建一个分区发送器</p>
<pre><code>if partition:
self.target += "/Partitions/" + partition
self.name += "-partition{}".format(partition)
</code></pre>
<p><strong>参考</strong></p>
<p><a href="https://github.com/Azure/azure-event-hubs-python/blob/master/azure/eventhub/sender.py" rel="nofollow noreferrer">https://github.com/Azure/azure-event-hubs-python/blob/master/azure/eventhub/sender.py</a></p>
<p>希望有帮助。在</p>