spring - 如何比较 Mono、Flux 中的相似数据
问题描述
我是响应 webclient 的新手,我有两个请求同时进行,但我需要比较两个响应数据。有任何想法吗?
解决方案
根据您的评论,我假设您想在 s 上使用某种zip
运算符Mono
。ReactorzipWith
可以通过以下方式使用:
targetApex.zipWith(sourceApex).subscribe(apex-> {
// apex is type of Tuple2 which has getT1 and getT2 methods
int result = apex.getT1().compare(apex.getT2());
// do something with the result
});
推荐阅读
- react-native - React native - eslintrc - prettierrc:如何防止移除 JSX 中一个元素周围的括号
- c# - Caliburn.Micro 检测带有修饰符的文本框输入
- java - 如何在具有不同键的外部 hashMap 中传递具有相同键的内部 hashMap?
- julia - 如何向现有字典添加新的键值对?
- java - 可在室内流动
- html - CSS中两个div容器的交替换行符
- android - 如何在菜单顶部显示工具栏的标题
- android - Kotlin:如何使用 RecycleView + ViewAdapter 让不同的用户得到不同的 ViewHolders?
- python - Python“全部”执行
- cordova - cordova-plugin-qrscanner 相机未显示