Comments (9)
没明白你的意思,RPC服务是生产者/消费者 模式,api接口是两者之间的契约;实际开发中服务提供者的项目结构如下:
| - demo
| - | - demo-api
| - | - demo-biz
其中:
- demo-api 只提供简单的api接口定义,demo-api 一般没有其他依赖;
- demo-biz 是服务具体实现,依赖 demo-api,实现了demo-api中定义的所以服务接口,一般以jar/war包形式独立部署;
开发中,都是将 demo-api deploy到公司的私服上 供 服务消费者依赖;将demo-biz 打包部署到线上服务器供消费者调用。
服务消费者 不需要知晓 服务提供者的内部实现、部署在哪儿,只管调用;不知道我的解释你明白了没有。
from rpc-framework-tutorials.
我的意思是 如果 我把 demo-api删了 , 把 里面的 实体 和接口 分别在 服务者和消费者中 重新创建和demo-api一样的接口和实体,行吗? 我刚才测试的我这样做不行
from rpc-framework-tutorials.
可能是我测试的方式错了吧,我刚才测试的时候 直接把那个 api -demo这个删掉了 ,然后 把里面的实体类 还有声明的接口分别复制到了 消费者和生产者项目里面 ,在测试服务端没问题 ,就是 消费者出问题了
from rpc-framework-tutorials.
这肯定是不行的,具体的你可以去看看 RPC框架内部实现原理:http://blog.jobbole.com/92290/
from rpc-framework-tutorials.
我以为 那个api-demo 是可以不要的
from rpc-framework-tutorials.
demo-api 是服务接口定义,相当于 生产者和消费者 之间的 契约,两者都需要依赖demo-api。
from rpc-framework-tutorials.
哦 ,那我 生产者和消费者两个项目里面都定义了相同的接口不就行了嘛,还要依赖,我觉得不能理解
from rpc-framework-tutorials.
还在吗 ,我看了你这个发的这个文章 我感觉应该是没有解决我的问题 , 虽然在发送的时候会发送出调用的接口是什么 ,但是 我只是把同样的接口放在了 服务和消费者项目里面了 ,如果安卓文章这么说的话 ,我想我这样做应该是没有问题的 可否 来个 qq 私聊下?
from rpc-framework-tutorials.
大致懂了 多谢
from rpc-framework-tutorials.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpc-framework-tutorials.