FreeBSD
V2EX  ›  Java

spring 中有没有 feign 转队列消息现成的库?

  •  
  •   FreeBSD · Apr 17, 2018 · 3435 views
    This topic created in 2948 days ago, the information mentioned may be changed or developed.

    需求

    A、B 两个系统。A 在内网内,B 在公网内。A 可以主动连 B,但是 B 不能主动连 A。现在的需求是:B 需要主动获取一些数据给 A

    想法

    1. B 旁边起一个消息中间件,B 想主动获取 A 的数据都走消息中间件。
    2. A 订阅相关的 topic,取出数据在发回队列。

    问题

    1. 简单说,B 想调用 A 提供的 REST API (由于 B 无法直接连接 A 因此绕道消息中间件),有没有可以把这种“ REST API ”调用简单化的现成工具库?类似 feign 一样
    2 replies    2018-04-17 12:59:21 +08:00
    cloud107202
        1
    cloud107202  
       Apr 17, 2018
    用 http long polling??

    A 永远跟 B 持有一个 http 连接,超时时间设到最大。B 有数据就触发 response 返回数据(可以通过 batch 优化) A 这边连接一旦 response 立刻发起一个新的 http 请求过去
    vncntd
        2
    vncntd  
       Apr 17, 2018
    spring integration
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1304 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 23:51 · PVG 07:51 · LAX 16:51 · JFK 19:51
    ♥ Do have faith in what you're doing.