Friday, October 4, 2019

JAVA JMS: RocketMQ Getting Started


Simple Notes

1. Download NameServer and Broker
  Go to archive.apache.org
  Download release zip file
  (I choose 4.5.2/rocketmq-all-4.5.2-bin-release.zip)

2. Extract it
  Assume I extract it to
  D:\things\Downloads\rocketmq\rocketmq-all-4.5.2-bin-release

3. Start NameServer
  Open cmd, run commands below
  cd D:\things\Downloads\rocketmq\rocketmq-all-4.5.2-bin-release\bin
  D:
  set JAVA_HOME=D:\things\programs\Java\jdk1.8.0_221
  set ROCKETMQ_HOME=D:\things\Downloads\rocketmq\rocketmq-all-4.5.2-bin-release\
  mqnamesrv.cmd -n localhost:9876


4. Start Broker
  Open cmd, run commands below
  cd D:\things\Downloads\rocketmq\rocketmq-all-4.5.2-bin-release\bin
  D:
  set JAVA_HOME=D:\things\programs\Java\jdk1.8.0_221
  set ROCKETMQ_HOME=D:\things\Downloads\rocketmq\rocketmq-all-4.5.2-bin-release\
  mqbroker.cmd -n localhost:9876 autoCreateTopicEnable=true


5. Write Consumer and Producer for test

  TestConsumer.java ; TestProducer.java ; and this is a maven project, so pom.xml
  Run TestConsumer and TestProducer, you will see something in the console.

References

Quick Start
https://rocketmq.apache.org/docs/quick-start/

Simple Message Example
https://rocketmq.apache.org/docs/simple-example/

No comments:

Post a Comment