java - 加装手柄 助焊剂返回型
问题描述
如何在改造中处理通量返回类型?
端点API
public interface DataEndPointApi {
@GET( "ap1/v3/data")
Flux<Data> getAllData(@Query( "dataType") String dataType);
}
RetroRestAdapter
@Autowired
private ObjectMapper objectMapper;
RestAdapter retrofit = new RestAdapter.Builder()
.setEndpoint( "http://localhost:8080" )
.setConverter( new JacksonConverter( this.objectMapper ) )
.build();
呼叫者
DatasourceEndPointApi datasourceEndPointApi;
Flux<Data> dataFlux = this.dataEndPointApi.getAllData( "GREETING" );
我得到以下错误
错误
retrofit.RetrofitError: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `reactor.core.publisher.Flux` (no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
at [Source: (retrofit.ExceptionCatchingTypedInput$ExceptionCatchingInputStream); line: 1, column: 1]
at retrofit.RetrofitError.conversionError(RetrofitError.java:33)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:383)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
at com.sun.proxy.$Proxy153.getAllDatasource(Unknown Source)
at
那么,如何在 Retrofit 中处理 Flux 返回类型?
解决方案
推荐阅读
- twitter - 配置单元表查看使用水槽流式传输的 avro 记录,块大小对于此实现无效或太大:-40
- python - scipy.optimize.fmin 错误:使用序列设置数组元素
- linux - 在 TeamCity Linux 代理上构建 F# Xamarin 项目:无法导入 Xamarin\Android\Xamarin.Android.FSharp.targets
- pipe - 如何通过管道将 yes 传递给 Dockerfile 中的 ./script 以安装 virtualbox
- mongodb - 在 ObjectId 字段上的两个集合之间进行 $lookup 查询
- python - 比较两个 csv 文件后,如何在特定列中打印不同的行。使用 python 或 Bash
- xpath - Google 电子表格 XPATH:无法提取没有数据/值的元素
- ffmpeg - ffmpeg 配置复杂过滤器时出错
- powerbi - 火狐上的 PowerBI api powerbi.js 错误
- django - 如何从数据库实现击键实时更新?