Python Java 交叉通信服务器
+-------------------+ +-------------------+
| Wowza | | Django |
|-------------------| |-------------------| +-------------+
| | | | | |
| | | +-------> Database |
| Java | | Python | | |
| | | | +-------------+
| | v1,v2 | |
| A +-------------------------------------> X |
| | | |
| | u1,u2 | |
| B <-------------------------------------+ Y |
| | | |
| | | |
| | | |
| | | |
+-------------------+ +-------------------+
假设A、B是Wowza服务器中的函数,它是纯Java的。变量 v1,v2 是函数 A 私有的。
函数 X,Y 是使用 Django/Twisted 服务器实现的 python 函数。变量 u1,u2 是 Y 私有的。我想听听您对解决两个问题的宝贵意见。
- java函数“A”执行时,我想使用A中的变量v1,v2运行Python函数“X”。
- 当Python函数“Y”执行时,我想使用“Y”中的变量u1,u2运行Java函数B
一个简单例子是。当有人通过 wowza 播放视频时,我想用用户的客户端 ID 通知 django。当管理员生成 django 信号时,Wowza 必须了解它并相应地..
是否可以使用 DjangoAMF、JSON-RPC 或任何其他消息协议?或者可以使用一些中间件吗?
+-------------------+ +-------------------+
| Wowza | | Django |
|-------------------| |-------------------| +-------------+
| | | | | |
| | | +-------> Database |
| Java | | Python | | |
| | | | +-------------+
| | v1,v2 | |
| A +-------------------------------------> X |
| | | |
| | u1,u2 | |
| B <-------------------------------------+ Y |
| | | |
| | | |
| | | |
| | | |
+-------------------+ +-------------------+
Suppose A, B are functions in Wowza server, which is purely in Java. variables v1,v2 are private to function A.
Functions X,Y which are python functions implemented with Django/Twisted server. variables u1,u2 are private to Y. I would like your valuable opinion on solving two problems.
- java function "A" executed, I want to run Python function "X" with variables v1,v2 from A.
- When Python function "Y" executed, I want to run Java function B with variables u1,u2 from "Y"
A simple example is. When some one play a video via wowza, I want to inform django about that with user's client id. When the administrator generate a django signal, Wowza must know about it and accordingly..
Is it possible with DjangoAMF, JSON-RPC or any other Message protocols? or is it possible with some middleware?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何RPC都可以为您解决以上问题。我没有使用过 DjangoAMF 所以无法对此发表评论。为此,您还可以在两台服务器上公开某种 REST API。
Any RPC will be able to solve the above for you. I have not used DjangoAMF so can't comment on that. You can also expose some sort of REST API on both servers for this purpose.