https://github.com/phpple/php-dubbo-proxy
A dubbo's proxy for php developer, based on dubbo's telnet protocol.
https://github.com/phpple/php-dubbo-proxy
Last synced: 5 months ago
JSON representation
A dubbo's proxy for php developer, based on dubbo's telnet protocol.
- Host: GitHub
- URL: https://github.com/phpple/php-dubbo-proxy
- Owner: phpple
- Created: 2018-05-25T02:23:16.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-25T11:47:16.000Z (about 8 years ago)
- Last Synced: 2025-08-07T09:53:02.755Z (10 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
php-dubbo-proxy
================
This project is designed for call java service based on dubbo.The transport protocol is telnet.
Process
--------
1. Find the provider from zookeeper.
2. Build socket connect to the provider's host and port.
3. Call the telnet command invoke, such as `invoke com.phpple.service.FooService.bar('hello,world')\n`.
You can find the telnet commands at: [[English]](http://dubbo.apache.org/books/dubbo-user-book-en/references/telnet.html) [[中文]](http://dubbo.apache.org/books/dubbo-user-book/references/telnet.html)
4. Read from the socket's response, and parse it.
Requirement
-----------
* php [zookeeper extension](http://pecl.php.net/package/zookeeper)
Install
-------
```bash
composer require phpple/php-dubbo-proxy
```
Example
--------
```php
use \phpple\php_dubbo_proxy\Proxy;
$service = Proxy::getService('com.phpple.service.FooService', array(
'registry' => '127.0.0.1:2181',
'version' => '1.0.0'
));
$ret = $service->bar('hello,world');
var_dump($ret);
```