motan-php's Issues
PHP通过go agent调用java服务BUG
go agent 需要通过版本等值组成的键查找服务是否存在:
version := "0.1"
if request.GetAttachment(mpro.MVersion) != "" {
version = request.GetAttachment(mpro.MVersion)
}
ck := getClusterKey(request.GetAttachment(mpro.MGroup), version, request.GetAttachment(mpro.MProxyProtocol), request.GetAttachment(mpro.MPath))
但是,我跟踪了下,通过php的doCall调用方法时,版本号根本就没有到agent这边来,是我用法错误吗?
超时问题
Connection.php中有个写死的1000000。
可以在ReadMe中说明.
遇到问题从服务端超时到代理超时挨个排查。
php客户端java服务序列化问题
服务提供方: java
服务调用方: php
两种情况: 1、服务提供方无法处理请求参数; 2、服务调用方无法解析返回结果
1:
java服务方法
public String sayHello(String name) {
System.out.println("name: " + name);
return "hello " + "GD" + " !";
}
php调用
$rs = $cx->sayHello(['name'=>'']);
异常:
{"errcode":400,"errmsg":"call fail over 3 times.Exception:process request fail. errmsg:error_message: SimpleSerialization not support type:class java.lang.String, status: 503, error_code: 10001,r=-2620754180148297728","errtype":1}Motan\Protocol\Header Object
(
[_magic:Motan\Protocol\Header:private] => 61937
[_msg_type:Motan\Protocol\Header:private] => 1
[_version_status:Motan\Protocol\Header:private] => 9
[_serialize:Motan\Protocol\Header:private] => 8
[_request_id:Motan\Protocol\Header:private] => 1.5825989893561E+19
)
Array
(
[M_e] => {"errcode":400,"errmsg":"call fail over 3 times.Exception:process request fail. errmsg:error_message: SimpleSerialization not support type:class java.lang.String, status: 503, error_code: 10001,r=-2620754180148297728","errtype":1}
)
2:
java服务方法
public String sayHello() {
return "hello GD !";
}
php调用同1,可以调用到服务,并返回结果,但是php无法解析
异常
PHP Fatal error: Uncaught Exception: Fail to Decode response body, got a no support type! in /home/wwwroot/zepra.com/motan/src/Motan/Serialize/Motan.php:104
Stack trace:
#0 /home/wwwroot/zepra.com/motan/src/Motan/Endpointer.php(96): Motan\Serialize\Motan->deserialize(NULL, '\nhello GD !')
#1 /home/wwwroot/zepra.com/motan/src/Motan/Client.php(102): Motan\Endpointer->call()
#2 /home/wwwroot/zepra.com/motan/test.php(13): Motan\Client->__call('sayHello', Array)
#3 {main}
thrown in /home/wwwroot/zepra.com/motan/src/Motan/Serialize/Motan.php on line 104
Motan.php 104行 type为10
\Motan\Client的_call方法BUG
$request_id = $request_args = $request_header = NULL;
isset($arguments[0]) && !empty($arguments[0]) && $request_args = $arguments[0];
$request = new \Motan\Request($this->_url_obj->getService(),
$name, ...[$request_args]);
isset($arguments[1]) && !empty($arguments[1]) && $request->addHeaders($arguments[1]);
isset($arguments[2]) && !empty($arguments[2]) && $request->setRequestId($arguments[2]);
$request->setGroup($this->_url_obj->getGroup());
$http_params = $this->_url_obj->getParams();
这上面的写法决定了通过_call调用某个远程方法时,只能支持一个参数吧?
...[$request_args],这个地方是否还要判断下?
php用motan2协议调用,序列化不支持java对象 集合?
Serialize/Motan.php line 104
Fail to Decode response body, got a no support type!
Error to read header_buffer
目前走的motan-go代理访问JAVA服务,
JAVA服务后面会同步对接一个较耗时的服务(1~4秒处理时长)
motan-go配置的6秒超时,如果JAVA服务耗时短则motan-php正常接收返回结果,但是如果耗时长,motan-php这边基本在2秒左右,报Error to read header_buffer异常,
这个异常是什么场景下会报
结合motan-go应该如何配置motan-php的超时时长?
Wrong definition
motan-php/src/Motan/Endpointer.php
Lines 78 to 95 in 0b5e5e6
Definition
$request_obj
in line 78 is useless.$req_obj
is not defined in line 93, it might be $req_obj_data
defined in line 92 ?composer安装,包没找到
composer require motan/motan-php
Could not find a matching version of package motan/motan-php. Check the package spelling, your version constraint a
nd that the package is available in a stability which matches your minimum-stability (dev).
yar协议通过http调用,demo中的motan2使用后提示超出允许内存
Allowed memory size of 134217728 bytes exhausted (tried to allocate 1113678912 bytes)
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.