hank-cp / sbp

Plugin framework for Spring Boot based on pf4j.
Apache License 2.0
205 stars 67 forks source link

Can i use dubbo in this framework? #35

Closed Maclaon closed 2 years ago

Maclaon commented 2 years ago

i want to use dubbo as a service into a plugin, can i use this framework to do it?

hank-cp commented 2 years ago

Sure you can. Sbp is play a "application level solution" role in Spring stack. If you are using Spring Boot, you could always use Sbp to extend your project.

In our real world micro-service project, we use Spring Cloud infrastructures, and Spring Boot to provide service. But, there are a lot of work to handle real-time registration/unregistration. You could refer to my another project skr. It's not maintained quite well.

Maclaon commented 2 years ago

Sure you can. Sbp is play a "application level solution" role in Spring stack. If you are using Spring Boot, you could always use Sbp to extend your project.

In our real world micro-service project, we use Spring Cloud infrastructures, and Spring Boot to provide service. But, there are a lot of work to handle real-time registration/unregistration. You could refer to my another project skr. It's not maintained quite well.

老兄,能给一个例子吗?我们现在加载dubbo一直加载不进去,这是一个不带Dubbo的Maven的工程,以及项目有多个ClassLoad时使用dubbo出错的例子,所以能否给一个基于Dubbo的例子,以及最终 sbp-core > 0.1.5 以上版本的 插件的目录结构(jar或者zip的目录)?

hank-cp commented 2 years ago

你方便建一个工程吗? 或者把log贴上来看看

Maclaon commented 2 years ago

你方便建一个工程吗? 或者把log贴上来看看

哦,我们已经搞通了,老兄,等整理差不多了,我给你上个demo,另外能告知一下sbp-core > 0.1.5 以上版本的 插件的目录结构(jar或者zip的目录)?我们用maven进行打包,一直打包后不成功!非常感谢~

hank-cp commented 2 years ago

打包的问题看这里. 目前只有gradle的例子, 没精力搞maven的, 道理应该是一样的

Maclaon commented 2 years ago

打包的问题看这里. 目前只有gradle的例子, 没精力搞maven的, 道理应该是一样的

哦,对Gradle了解不多的,所以能否把用gradle打包后的jar或者zip的目录结构(只要一个目录结构即可,图片或者树结构都行),展示一下即可,我对maven了解较多,这样就可以依葫芦画瓢,搞一个maven的实例,放在你的工程上。

hank-cp commented 2 years ago
Maclaon commented 2 years ago
  • 如果插件没有依赖第三方库, 使用标准的jar打包就可以了, 参考文档中的gradle例子, 填写manifest.
  • 如果依赖第三方库, 需要把第三方库jar解包, 再整体打包进jar, 即下面这段代码的作用
  task buildPlugin(type: Jar) {
      ......
      from configurations.localLibs.asFileTree.files.collect { zipTree(it) }
      ......
  }

好的,我先尝试一下,有问题在来叨扰你~

hank-cp commented 2 years ago

有问题可以联系我邮箱, github的通知我都关了, 要是忘记上来看就不能及时回复了