You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/08/24 11:44:12 UTC
[GitHub] [rocketmq] loyili opened a new issue #3288: Producer always fails while sending first message.
loyili opened a new issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288
**BUG REPORT**
1. Please describe the issue you observed:
Producer always fails while sending first message.
2. How to reproduce it :
Running the official examples:
``
.\bin\tools.sh org.apache.rocketmq.example.quickstart.Producer
``
2. Please tell us about your environment:
- java version 1.8.0_271
- macos 10.13.1
- rocketmq 4.9.0
3. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
I noticed that there has been several issues linked to this bug: [#1113](https://github.com/apache/rocketmq/issues/1113) , [#1651](https://github.com/apache/rocketmq/issues/1651). However, i have a simple sulution to solve them. As we know, MessageClientIDSetter would call **UtilAll.getPid** in class loading, that's the main reason producer timeouts. Actually, **producer.start** have already called **UtilAll.getPid** , we could cache the result to avoid duplicate calls.
```
public class UtilAll {
.......
.......
final static String HOST_NAME = ManagementFactory.getRuntimeMXBean().getName(); // format: "pid@hostname"
public static int getPid() {
try {
return Integer.parseInt(HOST_NAME.substring(0, HOST_NAME.indexOf('@')));
} catch (Exception e) {
return -1;
}
}
}
```
I have test it , and it works well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] loyili commented on issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
loyili commented on issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288#issuecomment-906027766
@lizhiboo how do you think the approach ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] kim709394 commented on issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
kim709394 commented on issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288#issuecomment-912381111
and ... how should i reslove this problem?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] loyili closed issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
loyili closed issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] yuz10 commented on issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
yuz10 commented on issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288#issuecomment-927452937
@loyili perfect solution, could you submit a pr to resolve the problem?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] loyili closed issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
loyili closed issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] lizhiboo commented on issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
lizhiboo commented on issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288#issuecomment-904582948
> **BUG REPORT**
>
> 1. Please describe the issue you observed:
> Producer always fails while sending first message.
> 2. How to reproduce it :
> Running the official examples:
> `.\bin\tools.sh org.apache.rocketmq.example.quickstart.Producer`
> 3. Please tell us about your environment:
>
> * java version 1.8.0_271
> * macos 10.13.1
> * rocketmq 4.9.0
>
> 1. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
> I noticed that there has been several issues linked to this bug: [#1113](https://github.com/apache/rocketmq/issues/1113) , [#1651](https://github.com/apache/rocketmq/issues/1651). However, i have a simple sulution to solve them. As we know, MessageClientIDSetter would call **UtilAll.getPid** in class loading, that's the main reason producer timeouts. Actually, **producer.start** have already called **UtilAll.getPid** , we could cache the result to avoid duplicate calls.
>
> ```
> public class UtilAll {
> .......
> .......
> final static String HOST_NAME = ManagementFactory.getRuntimeMXBean().getName(); // format: "pid@hostname"
>
> public static int getPid() {
> try {
> return Integer.parseInt(HOST_NAME.substring(0, HOST_NAME.indexOf('@')));
> } catch (Exception e) {
> return -1;
> }
> }
> }
> ```
>
> I have test it , and it works well.
Is the error timeout ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] vongosling commented on issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
vongosling commented on issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288#issuecomment-904587676
https://github.com/apache/rocketmq/issues/1113 @lizhiboo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] loyili commented on issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
loyili commented on issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288#issuecomment-927458735
Yes, i will submit it later. @yuz10
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] loyili commented on issue #3288: Producer always fails while sending first message.
Posted by GitBox <gi...@apache.org>.
loyili commented on issue #3288:
URL: https://github.com/apache/rocketmq/issues/3288#issuecomment-905116438
@vongosling Yes, below is the stack trace:
```
2021-08-24 14:31:26,182 WARN RocketmqClient - sendKernelImpl exception, resend at once, InvokeID: 8782646440420463667, RT: 5017ms, Broker: MessageQueue [topic=TopicTest, brokerName=bot.local, queueId=2]
org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException: sendKernelImpl call timeout
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendKernelImpl(DefaultMQProducerImpl.java:861)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:593)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1384)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1328)
at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:330)
at org.apache.rocketmq.example.quickstart.Producer.main(Producer.java:68)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org