(in construction)
- zookeeper >= 3.4.10
- java >= 1.8
- maven >= 3.7.0
Tested with ubuntu 16.04
Two different ways
- Move to the folder where the repo is placed:
i.e.: cd ZookeeperMessaging
- Build the image with docker, be careful with the name (
zookeepermessaging
). The command should be similar to:sudo docker build -t zookeepermessaging .
- Execute the script zkapp.sh
./zkapp.sh
- The script will start docker, mount the folder in /home/dev, and will start the script inside-container.sh
- Access with the browser to the following url:
localhost:8080
- Download/clone/fork repository and move inside the folder.
- Compile project with maven
mvn clean install
- Launch zookeeper server: i.e.
/opt/zookeeper-3.4.9/bin/zkServer.sh start
- Launch kafka server: i.e.
/opt/kafka_2.12-1.0.0/bin/kafka-server-start.sh /opt/kafka_2.12-1.0.0/config/server.properties
- Launch master program: i.e.
mvn exec:java -Dexec.mainClass="com.company.Master"
- Two different modes:
- ZooKeeper Only => Launch workerfactory: i-e.
mvn exec:java -Dexec.mainClass="websocket.WorkerFactory"
- Zookeeper + Kafka streaming => Launch kafkaworkerfactory: i.e.
mvn exec:java -Dexec.mainClass="websocket.KafkaWorkerFactory"
- ZooKeeper Only => Launch workerfactory: i-e.
- Launch onlineuserkeepalive: i.e.
mvn exec:java -Dexec.mainClass="websocket.OnlineUserKeepAlive"
- Access with your favorite browser to the file index.html located in
src/main/java/websocket/index.html
- i.e.
firefox src/main/java/websocket/index.html
- i.e.
example code of chat using socketio java-server-javascript-client-websockets