apache / rocketmq-mqtt

Apache rocketmq
https://rocketmq.apache.org/
Apache License 2.0
182 stars 65 forks source link

请问如果topic不存在,会自动创建吗? #278

Closed shi3623704 closed 5 months ago

shi3623704 commented 6 months ago

Topic不存在的时候日志有如下报错

2024-05-15 17:17:03:633 ERROR [AbstractUpstreamHook] org.apache.rocketmq.mqtt.ds.meta.TopicNotExistException: test-topic1 NotExist at org.apache.rocketmq.mqtt.ds.meta.FirstTopicManager.checkFirstTopicIfCreated(FirstTopicManager.java:95) at org.apache.rocketmq.mqtt.ds.upstream.processor.PublishProcessor.process(PublishProcessor.java:75) at org.apache.rocketmq.mqtt.ds.upstream.UpstreamProcessorManager.processMqttMessage(UpstreamProcessorManager.java:73) at org.apache.rocketmq.mqtt.common.hook.AbstractUpstreamHook.doHook(AbstractUpstreamHook.java:44) at org.apache.rocketmq.mqtt.common.hook.AbstractUpstreamHook.lambda$doHook$0(AbstractUpstreamHook.java:54) at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:952) at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:926) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1595) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

ChangingFond commented 6 months ago

No,you need to create first topic in RocketMQ.