Spring Cloud Contract 是否支持 JavaScript 和 JMS?

Does Spring Cloud Contract support JavaScript and JMS?

我想开始使用 Spring Cloud Contract 框架进行合同测试。但是 Spring Cloud Contract 支持 JavaScript 和 JMS 吗?

我还没有找到任何相关信息。

至于 JMS,我们通过 spring-integrationApache Camel 支持它。您也可以编写自己的 JMS 支持。注册几个bean就够了

至于Java脚本和非jvm语言。没有开箱即用的支持,但我们有一个流程。此处描述了工作流程(在这些情况下,消费者是 Java 应用程序,但在下一节中我将描述流程有何不同)- https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_common_repo_with_contracts or https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_step_by_step_guide_to_cdc。我们将尝试明显地简化流程,但目前有一堆手动任务需要完成(虽然不是很乏味)。

消费者可以非常轻松地下载和 运行 存根。只需克隆 https://github.com/spring-cloud-samples/stub-runner-boot,构建它并将 fat jar 推送到您的 Nexus/Artifactory。消费者将使用此应用程序在本地自动下载存根和 运行 它们。作为消费者,您可以调用 java -jar stub-runner-boot --stubrunner.ids="com.example.groupid:artifactid:classifier:version:8090" --stubrunner.repositoryRoot="http://localhost:8081/artifactory/libs-release-local" 。这样应用程序就会启动,从您的工件所在的给定地址下载提供的带有存根的 jar。现在您的前端应用程序可以在 localhost:8090.

调用生产者的存根

当然,我们会尝试简化克隆和推送过程 (https://github.com/spring-cloud/spring-cloud-contract/issues/37) 等,但现在您必须手动执行这两个步骤。

更新:

我们通过这篇文章 https://spring.io/blog/2018/02/13/spring-cloud-contract-in-a-polyglot-world 介绍了一种在多语言环境中工作的方法。使用提供的 docker 图像来 运行 针对 运行ning 应用程序和 运行 存根 运行 人员进行合同测试就足够了。