背景
我将Mule运行时用作在单独服务器上运行的基础结构组件。我想确定在我的应用程序中实现Mule客户端的最佳实践。
问题
我遇到各种问题,试图在Spring Boot rest应用程序中使用MuleClient(通过org.mule.modules/mule-module-client/3.8.1
maven依赖项):
1)ule子(log4j)中的记录子系统与默认的Spring Boot(logback)冲突。这可以通过将Spring Boot切换到log4j(https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html)来解决。
2)Mule Client引入了对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
批注,则在另一个依赖项注入中也会出现相同的错误: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,所有这些文档都很好地记录在案并且易于使用。