Skip to content

Commit

Permalink
feat: add protocol name on rpc server url (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
gxcsoccer committed Jan 17, 2019
1 parent 1d74fd2 commit 0d7428a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class RpcServer extends Base {
accepts: 100000,
language: 'nodejs',
rpcVer: '50400',
protocol: this.protocol.name,
};
return obj;
}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"await-first": "^1.0.0",
"byte": "^2.0.0",
"cluster-client": "^2.1.2",
"debug": "^4.1.0",
"debug": "^4.1.1",
"easy-table": "^1.1.1",
"graceful": "^1.0.2",
"is-type-of": "^1.2.1",
Expand All @@ -52,11 +52,11 @@
"antpb": "^1.0.0",
"autod": "^3.0.1",
"await-event": "^2.1.0",
"coffee": "^5.1.0",
"coffee": "^5.2.1",
"contributors": "^0.5.1",
"dubbo-remoting": "^2.1.3",
"egg-bin": "^4.9.0",
"eslint": "^5.10.0",
"egg-bin": "^4.10.0",
"eslint": "^5.12.0",
"eslint-config-egg": "^7.1.0",
"mm": "^2.4.1",
"node-zookeeper-client": "^0.2.2",
Expand Down
4 changes: 2 additions & 2 deletions test/server/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('test/server.test.js', () => {
logger,
codecType: 'protobuf',
});
assert(server.url.endsWith('dynamic=true&appName=test&timeout=3000&serialization=protobuf&weight=100&accepts=100000&language=nodejs&rpcVer=50400'));
assert(server.url.endsWith('dynamic=true&appName=test&timeout=3000&serialization=protobuf&weight=100&accepts=100000&language=nodejs&rpcVer=50400&protocol='));
await server.close();
});

Expand All @@ -56,7 +56,7 @@ describe('test/server.test.js', () => {
codecType: 'hessian2',
});
assert(server.url.startsWith('dubbo://'));
assert(server.url.endsWith('dynamic=true&appName=test&timeout=3000&serialization=hessian2&weight=100&accepts=100000&language=nodejs&rpcVer=50400'));
assert(server.url.endsWith('dynamic=true&appName=test&timeout=3000&serialization=hessian2&weight=100&accepts=100000&language=nodejs&rpcVer=50400&protocol=dubbo'));
await server.close();
});

Expand Down

0 comments on commit 0d7428a

Please sign in to comment.