java - 在 Spring Boot 应用程序中使用 MuleClient

标签 java spring spring-boot mule

背景

我使用 Mule 运行时作为在单独服务器上运行的基础架构组件。我想确定在我的应用程序中实现 Mule 客户端的最佳实践。

问题

我在尝试在 Spring Boot Rest 应用程序中使用 MuleClient 时遇到了各种问题(通过 org.mule.modules/mule-module-client/3.8.1 maven 依赖项):

1) mule (log4j) 中的日志子系统与 Spring Boot (logback) 的默认值冲突。这可以通过将 Spring Boot 切换到 log4j 来解决(https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html)

2) Mule 客户端引入了对 org.jgrapht/jgrapht-jdk1.5/0.7.3 的依赖启动时产生错误 Ignoring Class-Path entry lib/jgraph.jar found in ...

3) 最重要的是 Spring Boot 应用程序无法启动,并出现以下错误:

Description:

Parameter 0 of method cacheManagerCustomizers in 
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration required a bean of type 'org.springframework.beans.factory.ObjectProvider' that could not be found.


Action:

Consider defining a bean of type 
'org.springframework.beans.factory.ObjectProvider' in your configuration.

如果我删除 @EnableCaching来自应用程序的注释,相同的错误在另一个依赖项注入(inject)中显现出来:

Parameter 1 of constructor in 
org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration required a bean of type 'org.springframework.beans.factory.ObjectProvider' that could not be found.

问题

1) 对于解决这些错误有什么想法吗?
2) 是否值得在我的应用程序中使用 MuleClient(并有权访问消息、事件、流等),或者我应该回退到普通的 HTTP REST 客户端?

谢谢!

最佳答案

恕我直言,如果您使用 MuleClient,那么您就违背了 Mule 等集成平台的目的。如果需要集成另一个应用程序(不是基于 Java 的)怎么办?您使用 MuleClient 所做的所有工作都需要重做。

我强烈建议您通过 REST API 访问您的 MuleApplication,并且不要使用 MuleClient,因为您在最后一点中已经提到了这一点。这就是微服务架构的全部内容,并且意味着任何其他应用程序仍然可以通过 REST API 进行集成,由于 RAML,这些应用程序都将有很好的文档记录并且易于使用。

关于java - 在 Spring Boot 应用程序中使用 MuleClient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44296508/

相关文章:

java - 如何在 DOCX4J 中保存 word 文档中的图像

java - Box2D 在碰撞后阻止动态物体移动

java - 如何在android中调整捕获图像的大小

java - Spring data redis (with lettuce) 创建包装库的优势

java - Spring Boot : How to use custom logback. xml 取决于当前环境或 spring 配置文件

java - Spring Boot - 找不到放心的方法

java - 没有 fragment 显示的选项卡

java - 应用@EnableCircuitBreaker后获取异常java.lang.ArrayStoreException : sun. Reflect.annotation.TypeNotPresentExceptionProxy

java - 创建线程部署在 Tomcat 中的 Web 应用程序

java - Spring Boot Admin 日志中重复出现 AsyncRequestTimeoutException