问题标签 [reactive-feign-client]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
113 浏览

java - 当我使用 feign-reactive 从另一个微服务调用它时,我的微服务没有从请求标头接收“授权”

我有 2 个微服务,ProductStoreInvoiceStore

我希望ProductStore通过APIInvoiceStore提供产品信息来调用that API以从ProductStore获取产品信息。但是ProductStore需要Authorization检查信息,user authentication因此我将@RequestHeader("Authorization") String auth其用作我的参数变量FeignAPI将其发送到ProductStoreAuthorization但是它报告说我测试它时他没有收到数据。

@RequestHeader这样使用是因为我在feign-reactive all 功能的示例中看到了它

我不知道是我在某处做错了什么还是我误解了@RequestHeader.

请帮帮我!这是我的代码。

我的ProductStore提供了能够获取产品信息的 API。

我的InvoiceStorefeign-reactive使用WebReactiveFeign调用该 API 。

我按照Playtika feign-reactive的自述文件中的说明将其应用到我的项目中,如下所示

首先,我写 FeignAPI

然后,我建立客户端IvoiceService

然后,我创建了一个 API

最后,我发出GET请求,localhost:8083/invoice/test但出现错误

告诉我我哪里做错了,拜托!!!谢谢你为我做的一切。