Showing posts with label JMS. Show all posts
Showing posts with label JMS. Show all posts

Monday, October 14, 2019

JAVA JMS: RocketMQ NameServer Broker Cluster


Simple Note

After bind necessary ports
(see Connect to VirtualBox Guest Machine from Host OS with NAT Port Forwarding)

Creat Docker Image with Dockerfile
(see Create Dockerfile for Docker Image of RocketMQ NameServer)

Can give it a try finally...

Testing Video

https://youtu.be/mHuEyVh0eUk

The command for start broker is slightly different, add -c to use specific config and specify multiple nameServer address

e.g.

mqbroker.cmd -c ../conf/2m-2s-sync/broker-a.properties -n localhost:9487;localhost:9478 autoCreateTopicEnable=true


All files in the test project

RocketMQCluster


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/