You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "JarynXu (via GitHub)" <gi...@apache.org> on 2023/03/29 11:00:15 UTC

[GitHub] [rocketmq-clients] JarynXu opened a new issue, #430: 5.X是否支持自动创建TOPIC?

JarynXu opened a new issue, #430:
URL: https://github.com/apache/rocketmq-clients/issues/430

   我在 broker 中设置了 `autoCreateTopicEnable=true` 并且也通过命令和 console 查到这个属性运行时为  `true`,但是在发送消息时依旧会提示:
   `org.apache.rocketmq.client.java.exception.NotFoundException: [request-id=4d7136f1-a161-4d5e-b85d-ec99c7bfae0d, response-code=40402] CODE: 17  DESC: No topic route info in name server for the topic: test1`
   请问5.X应该如何配置才能使用自动创建TOPIC?


-- 
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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] fengcharly commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "fengcharly (via GitHub)" <gi...@apache.org>.
fengcharly commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489775772

   > > > > > ClientConfiguration
   > > > > 
   > > > > 
   > > > > 我是用k8s部署的rocketmq,然后这个是nodeport的端口号,对应pod的8081端口,发送消息没有问题,消费消息就超时了
   > > > 
   > > > 
   > > > 试试pushConsumer呢
   > > 
   > > 
   > > 还是一样的问题
   > 
   > K8S部的话除了映射proxy外,还要暴露brokerIP1为你可以从集群外访问的IP或域名
   
   我试了下,不是这个问题,用k8s部署的话brokerIP1应该是容器内的IP,不然k8s集群内部都没办法互通,然后5.0有proxy,直接连接proxy就可以,现在就是遇到连接proxy后发消息都是正常的,但是消费不了


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] JarynXu commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "JarynXu (via GitHub)" <gi...@apache.org>.
JarynXu commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489700534

   > > > > ClientConfiguration
   > > > 
   > > > 
   > > > 我是用k8s部署的rocketmq,然后这个是nodeport的端口号,对应pod的8081端口,发送消息没有问题,消费消息就超时了
   > > 
   > > 
   > > 试试pushConsumer呢
   > 
   > 还是一样的问题
   
   K8S部的话除了映射proxy外,还要暴露brokerIP1为你可以从集群外访问的IP或域名


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] JarynXu commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "JarynXu (via GitHub)" <gi...@apache.org>.
JarynXu commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489588135

   > > ClientConfiguration
   > 
   > 我是用k8s部署的rocketmq,然后这个是nodeport的端口号,对应pod的8081端口,发送消息没有问题,消费消息就超时了
   
   试试pushConsumer呢


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] JarynXu commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "JarynXu (via GitHub)" <gi...@apache.org>.
JarynXu commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489557517

   > io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 29.999577300s
   
   你的问题看起来是GRPC连接超时了,5.0客户端的ClientConfiguration里配置的是proxy的地址,你看看有没有配置错误或者防火墙之类的导致连接不上,试试telnet一下目标端口能不能通


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] fengcharly commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "fengcharly (via GitHub)" <gi...@apache.org>.
fengcharly commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489550691

   > > > 我目前用的客户端是: `org.apache.rocketmq:rocketmq-client-java:5.0.5`, 并且是通过 proxy:8081 来访问的MQ
   > > 
   > > 
   > > 我是通过手动创建Topic的方式解决的,但是在消费消息的时候有问题,不知道你是否有尝试过使用rocketmq-clients消费消息,如果能成功消费的话,希望与你交流
   > 
   > 我目前也是用手动创建的方式解决的,新client-java的消费目前没问题
   
   I used this code:
   
   `
   public class SimpleConsumerExample {
   private static final Logger log = LoggerFactory.getLogger(SimpleConsumerExample.class);
   
   private SimpleConsumerExample() {
   }
   
   @SuppressWarnings({"resource", "InfiniteLoopStatement"})
   public static void main(String[] args) throws ClientException {
       final ClientServiceProvider provider = ClientServiceProvider.loadService();
   
       // Credential provider is optional for client configuration.
       String accessKey = "rocketmq2";
       String secretKey = "12345678";
       SessionCredentialsProvider sessionCredentialsProvider =
           new StaticSessionCredentialsProvider(accessKey, secretKey);
   
       String endpoints ="10.15.25.4:30402";
       ClientConfiguration clientConfiguration = ClientConfiguration.newBuilder()
               .setRequestTimeout(Duration.ofSeconds(30))
           .setEndpoints(endpoints)
           .setCredentialProvider(sessionCredentialsProvider)
           .build();
       String consumerGroup = "yourConsumerGroup";
       Duration awaitDuration = Duration.ofSeconds(30);
       String tag = "yourMessageTagA";
       String topic = "testTopic";
       FilterExpression filterExpression = new FilterExpression(tag, FilterExpressionType.TAG);
       SimpleConsumer consumer = provider.newSimpleConsumerBuilder()
           .setClientConfiguration(clientConfiguration)
           // Set the consumer group name.
           .setConsumerGroup(consumerGroup)
           // set await duration for long-polling.
           .setAwaitDuration(awaitDuration)
           // Set the subscription for the consumer.
           .setSubscriptionExpressions(Collections.singletonMap(topic, filterExpression))
           .build();
       // Max message num for each long polling.
       int maxMessageNum = 16;
       // Set message invisible duration after it is received.
       Duration invisibleDuration = Duration.ofSeconds(15);
       // Receive message, multi-threading is more recommended.
       do {
           final List<MessageView> messages = consumer.receive(maxMessageNum, invisibleDuration);
           log.info("Received {} message(s)", messages.size());
           for (MessageView message : messages) {
               final MessageId messageId = message.getMessageId();
               try {
                   consumer.ack(message);
                   log.info("Message is acknowledged successfully, messageId={}", messageId);
               } catch (Throwable t) {
                   log.error("Message is failed to be acknowledged, messageId={}", messageId, t);
               }
           }
       } while (true);
       // Close the simple consumer when you don't need it anymore.
       // consumer.close();
   }
   }
   
   `
   
   Then error is:
   io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 29.999577300s. [remote_addr=/10.15.25.4:30402]
   at io.grpc.Status.asRuntimeException(Status.java:539)
   at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:544)
   at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
   at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
   at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
   at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:563)
   at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
   at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:744)
   at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:723)
   at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
   at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   at java.base/java.lang.Thread.run(Thread.java:834)
   
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] francisoliverlee commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "francisoliverlee (via GitHub)" <gi...@apache.org>.
francisoliverlee commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489593599

   目前proxy还不支持自动创建topic


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] fengcharly commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "fengcharly (via GitHub)" <gi...@apache.org>.
fengcharly commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489686675

   > > > ClientConfiguration
   > > 
   > > 
   > > 我是用k8s部署的rocketmq,然后这个是nodeport的端口号,对应pod的8081端口,发送消息没有问题,消费消息就超时了
   > 
   > 试试pushConsumer呢
   
   还是一样的问题


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] fengcharly commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "fengcharly (via GitHub)" <gi...@apache.org>.
fengcharly commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1488533144

   > 我目前用的客户端是: `org.apache.rocketmq:rocketmq-client-java:5.0.5`, 并且是通过 proxy:8081 来访问的MQ
   
   我是通过手动创建Topic的方式解决的,但是在消费消息的时候有问题,不知道你是否有尝试过使用rocketmq-clients消费消息,如果能成功消费的话,希望与你交流


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] aaron-ai closed issue #430: 5.X是否支持自动创建TOPIC?

Posted by "aaron-ai (via GitHub)" <gi...@apache.org>.
aaron-ai closed issue #430: 5.X是否支持自动创建TOPIC?
URL: https://github.com/apache/rocketmq-clients/issues/430


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 5.X是否支持自动创建TOPIC? [rocketmq-clients]

Posted by "JarynXu (via GitHub)" <gi...@apache.org>.
JarynXu commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1877990840

   > 目前proxy还不支持自动创建topic 目前proxy还不支持自动创建topic
   
   请问现在支持自动创建 topic 了吗?


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] fengcharly commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "fengcharly (via GitHub)" <gi...@apache.org>.
fengcharly commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489572863

   > ClientConfiguration
   
   我是用k8s部署的rocketmq,然后这个是nodeport的端口号,对应pod的8081端口,发送消息没有问题,消费消息就超时了


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] fengcharly commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "fengcharly (via GitHub)" <gi...@apache.org>.
fengcharly commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1490143551

   > > > > > > ClientConfiguration
   > > > > > 
   > > > > > 
   > > > > > 我是用k8s部署的rocketmq,然后这个是nodeport的端口号,对应pod的8081端口,发送消息没有问题,消费消息就超时了
   > > > > 
   > > > > 
   > > > > 试试pushConsumer呢
   > > > 
   > > > 
   > > > 还是一样的问题
   > > 
   > > 
   > > K8S部的话除了映射proxy外,还要暴露brokerIP1为你可以从集群外访问的IP或域名
   > 
   > 我试了下,不是这个问题,用k8s部署的话brokerIP1应该是容器内的IP,不然k8s集群内部都没办法互通,然后5.0有proxy,直接连接proxy就可以,现在就是遇到连接proxy后发消息都是正常的,但是消费不了
   
   这个问题是我用高版本JDK(java11)编译,低版本Jdk(java8)运行造成的,有些方法缺失造成的bug,换成JDK8编译后部署就可以了


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] JarynXu commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "JarynXu (via GitHub)" <gi...@apache.org>.
JarynXu commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1488385479

   我目前用的客户端是: `org.apache.rocketmq:rocketmq-client-java:5.0.5`, 并且是通过 proxy:8081 来访问的MQ


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] JarynXu commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "JarynXu (via GitHub)" <gi...@apache.org>.
JarynXu commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489542018

   > > 我目前用的客户端是: `org.apache.rocketmq:rocketmq-client-java:5.0.5`, 并且是通过 proxy:8081 来访问的MQ
   > 
   > 我是通过手动创建Topic的方式解决的,但是在消费消息的时候有问题,不知道你是否有尝试过使用rocketmq-clients消费消息,如果能成功消费的话,希望与你交流
   
   我目前也是用手动创建的方式解决的,新client-java的消费目前没问题


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-clients] JarynXu commented on issue #430: 5.X是否支持自动创建TOPIC?

Posted by "JarynXu (via GitHub)" <gi...@apache.org>.
JarynXu commented on issue #430:
URL: https://github.com/apache/rocketmq-clients/issues/430#issuecomment-1489701836

   > 目前proxy还不支持自动创建topic
   
   多谢,那这部分功能目前有规划吗?


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org