服务总线连接在本地控制台应用程序中不起作用

问题描述

我创建了一个 .net core 3.1 控制台应用程序,用于读取 azure 服务总线队列消息,并将 EXE 部署在客户端本地 VM 中。它最初可以工作,但现在不能从 VM 工作(现在也可以从本地机器工作)。在本地 VM 中执行 exe 时出现超时(套接字异常)。我正在使用共享访问策略连接串来连接服务总线。

异常: Azure.Messaging.ServiceBus.ServiceBusException:连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应而建立的连接失败。错误代码:超时(ServiceCommunicationProblem) ---> System.Net.sockets.socketException (10060): 连接尝试失败,因为连接方在一段时间后没有正确响应,或者因为连接的主机没有响应而建立连接失败。 在 Microsoft.Azure.Amqp.Transport.TransportStream.EndRead(IAsyncResult asyncResult) 在 Microsoft.Azure.Amqp.Transport.TransportStream.c__displayClass22_0.b__1(IAsyncResult a) 在 System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar,Func2 endFunction,Action1 endAction,Task1 promise,Boolean requiresSynchronization)

解决方法

企业环境中最常见的连接问题是 AMQP over TCP (5671/5672) 所需的端口未打开。通过 WebSocket 将传输更改为 AMQP 通常会有所帮助,因为它将使用端口 443,并且可能会在需要时通过代理进行路由。

可以在创建客户端时使用 def max_dist_heatmap(df,index,most_or_least): most_or_least= most_or_least.capitalize()# just a string to annotate the title,not important npz_loaded = np.load( get_val(df,"npz_file_path") ) normalized_npz = normalize_initial_distance_arr(npz_loaded['dist']) df_max_dist_npz = get_max_dist_arr_from_npz(normalized_npz) df_entropy_per_res =get_val(df,"entropy_per_res") df_seq = get_val(df,"sequence_x") protein_name = get_val(df,"name") pc1_val = get_val(df,"pc1") topology = protein_name.split('_')[0] caption = f"Max Distance Between Residues Within Protein {protein_name}(Rank = {index+1} {most_or_least} Stable {topology})\n{df_seq}\n pc1 ={pc1_val},entropy/res ={ df_entropy_per_res}" plt.figure(figsize=(8.5,5.9)) sns.set_context('paper',font_scale=1) max_dist_prod = sns.heatmap(df_max_dist_npz,cmap='Blues_r',linewidth=0.02,linecolor = 'Red',xticklabels=get_residue_code_seq_position_labels(df_seq),yticklabels=get_residue_code_seq_position_labels(df_seq) ) plt.title(caption) plt.xlabel('Index of Residue A') plt.ylabel('Index of Residue B') def call_max_dist_map(df,most_or_least): max_dist_map_getter = max_dist_heatmap(df,most_or_least) return max_dist_map_getter 指定传输和代理(如果需要):

ServiceBusClientOptions

有关详细信息,您可能需要查看 Service Bus troubleshooting guide

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...