小编Avi*_*and的帖子

如何将值的数组作为env变量提供给typesafe / lightbend配置?

如何提供数组/值列表作为typesafe / lightbend配置的环境变量?

application.conf

default-buckets = [
      10,
      30,
      100,
      300,
      1000,
      3000,
      10000,
      30000,
      100000
    ]
default-buckets = [${?DEFAULT_BUCKETS}]
Run Code Online (Sandbox Code Playgroud)

因此,我想将这样的内容作为环境变量传递,以便能够覆盖默认值:

DEFAULT_BUCKETS=1000,3000
Run Code Online (Sandbox Code Playgroud)

但是,出现以下错误:

com.typesafe.config.ConfigException$WrongType: env variables: buckets.default-buckets has type list of STRING rather than list of NUMBER

这有可能不需要我的应用程序代码通过调用来处理split(',')吗?

scala typesafe typesafe-config

5
推荐指数
1
解决办法
739
查看次数

用反应堆开火就忘

我的 Spring boot 应用程序中有一个如下所示的方法。

public Flux<Data> search(SearchRequest request) {
  Flux<Data> result = searchService.search(request);//this returns Flux<Data>
  Mono<List<Data>> listOfData = result.collectList();
//  doThisAsync() // here I want to pass this list and run some processing on it
// the processing should happen async and the search method should return immediately.
  return result;
}

//this method uses the complete List<Data> returned by above method
public void doThisAsync(List<Data> data) {
  //do some processing here
}

Run Code Online (Sandbox Code Playgroud)

目前,我正在使用带@Async注释的服务类doThisAsync,但不知道如何传递List<Data>,因为我不想调用block. …

spring reactive-programming spring-boot project-reactor spring-webflux

3
推荐指数
1
解决办法
4432
查看次数