【问题标题】:Spring Cloud Data Flow java DSL: get logs for stream componentsSpring Cloud Data Flow java DSL:获取流组件的日志
【发布时间】:2020-11-11 12:46:49
【问题描述】:

我正在使用通过 docker-compose 在本地部署的 SCDF 2.5.1,我的软件通过 java DSL 向 SCDF 服务器发送命令。

假设我创建了一个流

file > :queue
:queue > ftp

fileftp 是 docker 部署的应用程序。

我的问题是,如何获取 fileftp 的日志?

到目前为止,我想出的最接近的东西是

Map<String, String> attributes = scdf.runtimeOperations().streamStatus(streamName).getContent()
                .stream().flatMap(stream -> stream.getApplications().getContent().stream()
                        .filter(app -> app.getName().equals(appName))
                        .flatMap(appStatus -> appStatus.getInstances().getContent().stream()
                                .map(AppInstanceStatusResource::getAttributes)))
                .findFirst().orElse(Collections.emptyMap());

String logLocation = attributes.get("stdout")

然后挂载logLocation 并将其作为文件读取。

有没有更优雅的解决方案?

【问题讨论】:

    标签: spring-cloud-dataflow


    【解决方案1】:

    Java DSL(以及随后的 SCDF REST 客户端)没有将 log 检索操作作为其 REST 操作的一部分。有一个REST endpoint你可以访问SCDF服务器来获取流的日志。

    如果你想贡献,你可以在这里提交提案/PR:https://github.com/spring-cloud/spring-cloud-dataflow/pulls

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-17
    • 1970-01-01
    • 2020-01-13
    • 1970-01-01
    • 2023-03-24
    相关资源
    最近更新 更多