easyfrog commented on issue #717:
URL: 
https://github.com/apache/rocketmq-clients/issues/717#issuecomment-2029062357

   use this `docker-compose.yml`
   
   ```yml
   version: "3"
   services:
     #Service for nameserver
     rmqnamesrv:
       image: apache/rocketmq:5.1.3
       container_name: rmqnamesrv
       ports:
         - 9876:9876
       environment:
         JAVA_OPT_EXT: "-server -Xms512M -Xmx512M -Xmn128m"
       volumes:
         - ./data/namesrv/logs:/home/rocketmq/logs
       command: sh mqnamesrv
       restart: unless-stopped
   
     rmqbroker:
       image: apache/rocketmq:5.1.3
       container_name: rmqbroker
       depends_on:
         - rmqnamesrv
       ports:
         - 10909:10909
         - 10911:10911
         - 10912:10912
       environment:
         NAMESRV_ADDR: "rmqnamesrv:9876"
         JAVA_OPTS: " -Duser.home=/opt"
         JAVA_OPT_EXT: "-server -Xms512M -Xmx512M -Xmn128m"
       volumes:
         - ./data/broker/logs:/home/rocketmq/logs
         - ./data/broker/store:/home/rocketmq/store
         - ./conf/broker.conf:/opt/conf/broker.conf
       command: sh mqbroker autoCreateTopicEnable=true -c /opt/conf/broker.conf 
   
     rmqproxy:
       image: apache/rocketmq:5.1.3
       container_name: rmqproxy
       depends_on:
         - rmqnamesrv
       ports:
         - 8081:8081
       environment:
         NAMESRV_ADDR: "rmqnamesrv:9876"
         JAVA_OPTS: " -Duser.home=/opt"
         JAVA_OPT_EXT: "-server -Xms512M -Xmx512M -Xmn128m"
       volumes:
         - ./data/proxy/logs:/home/rocketmq/logs
         - ./data/proxy/store:/home/rocketmq/store
         - ./conf/proxy.conf:/opt/conf/proxy.conf
       command: sh mqbroker autoCreateTopicEnable=true -c /opt/conf/proxy.conf 
--enable-proxy
     
     dashbord:
       image: apacherocketmq/rocketmq-dashboard:1.0.0
       ports:
         - 18080:8080
       environment:
           JAVA_OPTS: "-Drocketmq.namesrv.addr=rmqnamesrv:9876 
-Dcom.rocketmq.sendMessageWithVIPChannel=false -Duser.timezone='Asia/Shanghai'"
       depends_on:
         - rmqnamesrv
   ```
   
   this consumer code:
   
   ```js
   import { SimpleConsumer } from "rocketmq-client-nodejs";
   
   async function main() {
       const simpleConsumer = new SimpleConsumer({
           consumerGroup: 'lanshan',
           endpoints: '192.168.1.8:8081',
           subscriptions: new Map().set('lanshan', 'gps'),
       });
       await simpleConsumer.startup();
   
       const messages = await simpleConsumer.receive(20);
       console.log('got %d messages', messages.length);
       for (const message of messages) {
           console.log(message);
           console.log('body=%o', message.body.toString());
           await simpleConsumer.ack(message);
       }
   }
   
   main().catch(err => console.error(err));
   ```
   GOT this error! 
   ```sh
   InternalErrorException: [request-id=undefined, response-code=50001] null. 
NullPointerException. 
org.apache.rocketmq.proxy.service.route.LocalTopicRouteService.toTopicRouteData(LocalTopicRouteService.java:102)
       at StatusChecker.check 
(D:\works\rocketmq-test\node_modules\rocketmq-client-nodejs\dist\exception\StatusChecker.js:83:23)
   
       at SimpleConsumer.receiveMessage 
(D:\works\rocketmq-test\node_modules\rocketmq-client-nodejs\dist\consumer\Consumer.js:64:35)
       at process.processTicksAndRejections 
(node:internal/process/task_queues:95:5)
       at async SimpleConsumer.receive 
(D:\works\rocketmq-test\node_modules\rocketmq-client-nodejs\dist\consumer\SimpleConsumer.js:95:16)
       at async main (file:///D:/works/rocketmq-test/index.js:11:22) {
     code: 50001
   }
   
   ```


-- 
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-unsubscr...@rocketmq.apache.org

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

Reply via email to