You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "kexianjun (GitHub)" <gi...@apache.org> on 2018/12/11 14:10:34 UTC
[GitHub] [incubator-dubbo-website] kexianjun opened pull request #200: Modify the documentation of the Telnet command to match the code impl…
…ementation
## What is the purpose of the change
Modify the documentation of the Telnet command to match the code implementation
## Brief changelog
XXXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Make sure there is a [GITHUB_issue](https://github.com/apache/incubator-dubbo-website/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Format the pull request title like `Fix UnknownException when host config not exist #XXX`. Each commit in the pull request should have a meaningful subject line and body.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Test your code locally by running `docsite start`, and make sure it works as expected.
- [ ] Make sure no files under build directory is added.
- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/incubator-dubbo/wiki/Software-donation-guide).
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-website] ralf0131 commented on pull request #200: Modify the documentation about the Telnet command to match the code impl…
Posted by "ralf0131 (GitHub)" <gi...@apache.org>.
Hi, sorry for the late reply, I am going to try it out in next few days.
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-website] kexianjun commented on pull request #200: Modify the documentation about the Telnet command to match the code impl…
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
> I ran the following command on latest 2.7.x branch and got following error
>
> ```
> dubbo>invoke org.apache.dubbo.demo.DemoService.sayHello("hello") -p java.lang.String
> Invalid parameters, format: service.method(args)
> ```
> It looks like `-p java.lang.String` does not work. How did you get it to work?
I have made more test on the latest master branch.My test is as the following:
```
package org.apache.dubbo.demo;
public class Student {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
```
```
package org.apache.dubbo.demo;
public interface DemoService {
String sayHello(String name);
String sayHello(Long name);
String sayHello(Integer age);
String sayHello(Student student);
String sayHello(String name, Integer age);
}
```
```
package org.apache.dubbo.demo.provider;
import org.apache.dubbo.demo.DemoService;
import org.apache.dubbo.demo.Student;
import org.apache.dubbo.rpc.RpcContext;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DemoServiceImpl implements DemoService {
@Override
public String sayHello(String name) {
System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] Hello " + name + ", request from consumer: " + RpcContext.getContext().getRemoteAddress());
return "Hello " + name + ", response from provider: " + RpcContext.getContext().getLocalAddress();
}
@Override
public String sayHello(Long name) {
return "Long from sayHello " + name;
}
@Override
public String sayHello(Integer age) {
return "int from sayHello " + age;
}
@Override
public String sayHello(Student student) {
return "Student from sayHello ,name:" + student.getName() + ",age:" + student.getAge();
}
@Override
public String sayHello(String name, Integer age) {
return "name and age from sayHello,name:" + name + ",age" + age;
}
}
```
here is my result:
![image](https://user-images.githubusercontent.com/12162539/50355916-291efb00-058b-11e9-9163-d06ccffcb2b7.png)
![image](https://user-images.githubusercontent.com/12162539/50355940-3d62f800-058b-11e9-8a7d-5e6e2d4ca01b.png)
And based on your result,the error message from org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java:158
```
if (i < 0 || !message.endsWith(")")) {
return "Invalid parameters, format: service.method(args)";
}
```
it may indicate something wrong with the input parentheses or the following class
> org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java
different from the master branch
.Would you maind to take a look at this and provide more detail about your test?
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-website] kexianjun commented on issue #200: Modify the documentation of the Telnet command to match the code impl…
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
@beiwei30 would you mind to review this pr?
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-website] kexianjun commented on issue #200: Modify the documentation about the Telnet command to match the code impl…
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
close since the -p feature has beed removed in this pr [Refactor telnet invoke command](https://github.com/apache/incubator-dubbo/pull/3210)
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-website] kexianjun commented on pull request #200: Modify the documentation about the Telnet command to match the code impl…
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
> I ran the following command on latest 2.7.x branch and got following error
>
> ```
> dubbo>invoke org.apache.dubbo.demo.DemoService.sayHello("hello") -p java.lang.String
> Invalid parameters, format: service.method(args)
> ```
> It looks like `-p java.lang.String` does not work. How did you get it to work?
I have made more test on the latest master branch.My test is as the following:
```
package org.apache.dubbo.demo;
public class Student {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
```
```
package org.apache.dubbo.demo;
public interface DemoService {
String sayHello(String name);
String sayHello(Long name);
String sayHello(Integer age);
String sayHello(Student student);
String sayHello(String name, Integer age);
}
```
```
package org.apache.dubbo.demo.provider;
import org.apache.dubbo.demo.DemoService;
import org.apache.dubbo.demo.Student;
import org.apache.dubbo.rpc.RpcContext;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DemoServiceImpl implements DemoService {
@Override
public String sayHello(String name) {
System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] Hello " + name + ", request from consumer: " + RpcContext.getContext().getRemoteAddress());
return "Hello " + name + ", response from provider: " + RpcContext.getContext().getLocalAddress();
}
@Override
public String sayHello(Long name) {
return "Long from sayHello " + name;
}
@Override
public String sayHello(Integer age) {
return "int from sayHello " + age;
}
@Override
public String sayHello(Student student) {
return "Student from sayHello ,name:" + student.getName() + ",age:" + student.getAge();
}
@Override
public String sayHello(String name, Integer age) {
return "name and age from sayHello,name:" + name + ",age" + age;
}
}
```
here is my result:
![image](https://user-images.githubusercontent.com/12162539/50355916-291efb00-058b-11e9-9163-d06ccffcb2b7.png)
![image](https://user-images.githubusercontent.com/12162539/50355940-3d62f800-058b-11e9-8a7d-5e6e2d4ca01b.png)
And based on your result,the error message from org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java:158
```
if (i < 0 || !message.endsWith(")")) {
return "Invalid parameters, format: service.method(args)";
}
```
it may indicate something wrong with the input parentheses or the following class
> org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java
different from the master branch
.Would you maind to take a look at this and provide more detail about your test?
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-website] kexianjun closed pull request #200: Modify the documentation about the Telnet command to match the code impl…
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
[ pull request closed by kexianjun ]
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-website] kexianjun commented on pull request #200: Modify the documentation about the Telnet command to match the code impl…
Posted by "kexianjun (GitHub)" <gi...@apache.org>.
> I ran the following command on latest 2.7.x branch and got following error
>
> ```
> dubbo>invoke org.apache.dubbo.demo.DemoService.sayHello("hello") -p java.lang.String
> Invalid parameters, format: service.method(args)
> ```
> It looks like `-p java.lang.String` does not work. How did you get it to work?
I have made more test on the latest master branch.My test is as the following:
```
package org.apache.dubbo.demo;
public class Student {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
```
```
package org.apache.dubbo.demo;
public interface DemoService {
String sayHello(String name);
String sayHello(Long name);
String sayHello(Integer age);
String sayHello(Student student);
String sayHello(String name, Integer age);
}
```
```
package org.apache.dubbo.demo.provider;
import org.apache.dubbo.demo.DemoService;
import org.apache.dubbo.demo.Student;
import org.apache.dubbo.rpc.RpcContext;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DemoServiceImpl implements DemoService {
@Override
public String sayHello(String name) {
System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] Hello " + name + ", request from consumer: " + RpcContext.getContext().getRemoteAddress());
return "Hello " + name + ", response from provider: " + RpcContext.getContext().getLocalAddress();
}
@Override
public String sayHello(Long name) {
return "Long from sayHello " + name;
}
@Override
public String sayHello(Integer age) {
return "int from sayHello " + age;
}
@Override
public String sayHello(Student student) {
return "Student from sayHello ,name:" + student.getName() + ",age:" + student.getAge();
}
@Override
public String sayHello(String name, Integer age) {
return "name and age from sayHello,name:" + name + ",age" + age;
}
}
```
here is my result:
![image](https://user-images.githubusercontent.com/12162539/50355916-291efb00-058b-11e9-9163-d06ccffcb2b7.png)
![image](https://user-images.githubusercontent.com/12162539/50355940-3d62f800-058b-11e9-8a7d-5e6e2d4ca01b.png)
And based on your result,the error message from org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java:158
```
if (i < 0 || !message.endsWith(")")) {
return "Invalid parameters, format: service.method(args)";
}
```
it may indicate something wrong with the input parentheses.Would you maind to take a look at this and provide more detail about your test?
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-website] ralf0131 commented on pull request #200: Modify the documentation about the Telnet command to match the code impl…
Posted by "ralf0131 (GitHub)" <gi...@apache.org>.
I ran the following command on latest 2.7.x branch and got following error
```
dubbo>invoke org.apache.dubbo.demo.DemoService.sayHello("hello") -p java.lang.String
Invalid parameters, format: service.method(args)
```
It looks like `-p java.lang.String` does not work. How did you get it to work?
[ Full content available at: https://github.com/apache/incubator-dubbo-website/pull/200 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org