如何使用Azure EventHub ProxyOptions

问题描述

在azure-java-sdk示例中,有一个示例-PublishEventsWithWebSocketsAndProxy.java

// By default,the AMQP port 5671 is used,but clients can use web sockets,port 443.
        // When using web sockets,developers can specify proxy options.
        // ProxyOptions.SYSTEM_DEFAULTS can be used if developers want to use the JVM configured proxy.
        ProxyOptions proxyOptions = new ProxyOptions(ProxyAuthenticationType.DIGEST,new Proxy(Proxy.Type.HTTP,InetSocketAddress.createUnresolved("10.13.1.3",9992)),"digest-user","digest-user-password");

        // Instantiate a client that will be used to call the service.
        EventHubProducerClient producer = new EventHubClientBuilder()
            .transportType(AmqpTransportType.AMQP_WEB_SOCKETS)
            .proxyOptions(proxyOptions)
            .connectionString(connectionString)
            .buildProducerClient();

但是我不理解参数值-10.13.1.3,摘要用户,摘要用户密码

任何人都可以告诉我,如果这是我必须使用的,如果组织具有Web App防火墙,可以连接到Azure

解决方法

您所引用的参数正在配置对代理服务器的访问。在这种情况下,Const StartRow As Byte=2 LastRow = Range("J" & Rows.count).End(xlUp).Row For i = StartRow To LastRow myValue = Range("B" & i).Value If myValue =Specialcells(xlCellTypeFormulas,xlErrors) Then Range("B" & i).Value = "=Today()" Next i 是要使用的代理服务器的地址,10.13.1.3是用于认证的用户名,而digest-user是其密码。之所以使用这组凭据,是因为示例中的选项使用digest-user-password

关于您的方案,通常需要解决如何配置客户端以使用组织的代理的问题。这将在很大程度上取决于您的组织如何配置环境,管理网络流以及应用安全实践。

我建议与您组织中的IT Ops代表联系以获取该信息;一旦有了这些,我们就可以帮助您解决将客户端配置为在该上下文中运行时遇到的任何问题。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...