在蔚蓝的服务优化面料HTTP服务调用 [英] Optimized http service invocation with in azure service fabric

查看:256
本文介绍了在蔚蓝的服务优化面料HTTP服务调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个应用程序(A1和A2)在蔚蓝的服务托管面料,具有自身无状态的可靠的微服务(S1和S2)每个应用程序。该应用程序A1取决于S1和应用A2取决于S2。此外,S2服务依赖于S1。 S2和S1是owin托管REST API服务。当A2请求在S2中结束了,我需要从S2与S1的呼叫。我试图找出这样做的优化的方式。

I have 2 applications (A1 and A2) hosted in azure service fabric, each application with its own stateless reliable micro-service (S1 and S2). The app A1 depends on S1 and app A2 depends on S2. In addition, S2 service depends on S1. Both S2 and S1 are owin hosted REST api services. When the request for A2 ends up in S2, I need to make a call from S2 to S1. I am trying to figure out the optimized way of doing this.

1)我应该使用的HttpClient在S2中调用S1?我如何在S2的一侧S1的分辨率?难道是刚刚出版的URI S1和织物就会知道如何优化这些电话?
2)我应该实现S1(一个HTTP端点2侦听器A1的客户和一个服务远程端点的接口从S2调用)?又如何地址的解析工作的?

1) Should I use HttpClient in S2 to call S1? How do I get the resolution for S1 in side of S2? Is it just published uri for S1 and fabric will know how to optimize those calls? 2) Should I implement 2 listeners in S1 (one http endpoint for A1 clients and one service remoting endpoint with an interface to call from S2)? Again how does address resolution work?

在这两种情况下,短期code样品将是巨大的帮助。

In either case, short code samples would be of immense help.

感谢。
Raghu / ..

Thanks. Raghu/..

推荐答案

是S2可以使用的HttpClient调用S1。首先S2需要解析地址为S1。服务织物具有该API的。下面是一些文档,让你这是如何工作的概述:

Yes S2 can use HttpClient to call S1. First S2 needs to resolve an address for S1. Service Fabric has APIs for that. Here's some documentation that gives you an overview of how this works:

<一个href=\"https://azure.microsoft.com/en-us/documentation/articles/service-fabric-connect-and-communicate-with-services/\" rel=\"nofollow\">https://azure.microsoft.com/en-us/documentation/articles/service-fabric-connect-and-communicate-with-services/

<一个href=\"https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-communication/\" rel=\"nofollow\">https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-communication/

和具有一个服务,解决了第二个服务的地址一个简单的示例应用程序(它解析状态服务,但它的工作方式相同的无状态)

And a simple sample application that has one service that resolves the address of a second service (it's resolving a stateful service but it works the same way for stateless)

<一个href=\"https://github.com/Azure-Samples/service-fabric-dotnet-getting-started/tree/master/Services/WordCount/WordCount.WebService\" rel=\"nofollow\">https://github.com/Azure-Samples/service-fabric-dotnet-getting-started/tree/master/Services/WordCount/WordCount.WebService

这篇关于在蔚蓝的服务优化面料HTTP服务调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆