RMI远程方法调用:适用于 客户端 调用 服务器 内的方法;(Kotlin 语言编写)

如果业务为二个服务器之间的通信,还是得用消息队列的形式,因为RMI 不适合 双向 调用

下面介绍RMI 的使用方法:

1,服务器端代码:

定义接口(此接口放入服务端和客户端公用的模块 或者打成jar给服务器/客户端使用)

 1 interface RmiService {
 2 
 3     /**
 4      * 订单发货
 5      * @param saleItemId  BTB订单项 itemId
 6      * @param shipmentName  物流公司名称
 7      * @param shipmentNumber  物流单号
 8      *
 9      */
10     fun shippedSale(saleItemId: Long, shipmentName: String, shipmentNumber: String): RestResponse<Any>
11 }
View Code

相关文章:

  • 2022-12-23
  • 2021-11-16
  • 2022-01-15
  • 2022-12-23
猜你喜欢
  • 2021-10-26
  • 2021-06-18
  • 2021-11-06
  • 2021-05-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案