SpringCloud学习(十五)---Spring Cloud Function

本次系列的目标就是三轮, 第一轮知道spring官网的cloud部分都有啥,都能干啥, 第二轮是针对有用的部分做文档阅读,第三轮是横向对比.所以文档是一节节的更新的.而且这玩意主要是让我自己做笔记的.所以不接受吐槽.

Spring Cloud Function是一个具有以下高级目标的项目:

通过功能促进业务逻辑的实现。

将业务逻辑的开发生命周期与任何特定的运行时目标脱钩,以便相同的代码可以作为Web终结点,流处理器或任务运行。

支持跨无服务器提供程序的统一编程模型,以及独立运行(本地或在PaaS中)的能力。

在无服务器提供程序上启用Spring Boot功能(自动配置,依赖项注入,指标)。

它抽象出了所有传输细节和基础结构,使开发人员可以保留所有熟悉的工具和流程,并专注于业务逻辑。

Features

Spring Cloud Function features:

  • Choice of programming styles - reactive, imperative or hybrid.

  • Function composition and adaptation (e.g., composing imperative functions with reactive).

  • Support for reactive function with multiple inputs and outputs allowing merging, joining and other complex streaming operation to be handled by functions.

  • Transparent type conversion of inputs and outputs.

  • Packaging functions for deployments, specific to the target platform (e.g., Project Riff, AWS Lambda and more)

  • Adapters to expose function to the outside world as HTTP endpoints etc.

  • Deploying a JAR file containing such an application context with an isolated classloader, so that you can pack them together in a single JVM.

  • Compiling strings which are Java function bodies into bytecode, and then turning them into @Beans that can be wrapped as above.

  • Adapters for AWS LambdaMicrosoft AzureApache OpenWhisk and possibly other "serverless" service providers.

Here’s a complete, executable, testable Spring Boot application (implementing a simple string manipulation):

@SpringBootApplication
public class Application {
  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }

  @Bean
  public Function<Flux<String>, Flux<String>> uppercase() {
    return flux -> flux.map(value -> value.toUpperCase());
  }
}

看到Flux和function我就知道我猜的八九不离十, 流式布局和函数式编程.

https://blog.csdn.net/zhulier1124/article/details/100133932

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值