A Pub/Sub based HTTP communication method in complex network environments

In a complex distributed system that consists of internal and external networks, i.e., internet and intranet, it is very challenging to ensure communication among various components across different networks. Typically, components in distributed system communicate via REST calls.  However, in the complex network environment, direct REST communication doesn’t work sometimes, since the inbound connections are not allowed in particular situations without network tunnel.


The above figure is an example of the complex network environment, where Network A and Network B’s sub network 2 don’t allow any inbound connections.

a Pub/Sub method to enable HTTP communication among various components in a complex network environment, without changing the original service provider and service consumer in the HTTP based RESTful communication model.
In this method, each existing HTTP request/response is wrapped in message stream, transmitted in the Pub/Sub message bus, and then is recovered for request/response consumer. This approach solves the communicate problems in specific network environment with limited efforts while still keeping the REST mode with sync HTTP calls.


HTTP transmission contains core components of our idea. By using it, clients can communicate with services using HTTP calls even in network environments where clients cannot fetch responses from services directly with HTTP calls.
Besides the message bus, there’re two important components in the HTTP transmission component: Message router and Message handler.
Workflow of the Message router:
Intercept HTTP requests from the client.
Transform the HTTP request to a Pub message, and transmit the message to the message bus. The Pub message contains the target service’s endpoint, the resource that is requested, and a UUID generated for this request.
Subscribe the request’s UUID by transmitting a Sub message to the message bus.
Listen to and get corresponding response from the message bus. 
Return the response to the client.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值