Example Microservices using Kafka 3.3.1 and WebSockets with Netty 5.0.0-alpha2 with both React/Typescript and HTML/JavaScript UIs
./maclocal_run.sh
or ./linuxlocal_run.sh
or wsllocal_run.sh
cd src/main/ui
yarn start
sudo apt install maven
. Note that this will also install OpenJDK 11.sudo apt install openjdk-8-jdk
sudo update-alternatives --config java
. This works nicely on WSL. For my Ubuntu VM I had to usesudo apt-get install galternatives
./maclocal_run.sh
(or sudo ./linuxlocal_run.sh
or sudo ./wsllocal_run.sh
)NOTE
: This will REMOVE ANY EXISTING KAFKA INSTALLATION
located at /Applications/kafka and /Applications/kafka_2.13-3.0.0 (or /opt/kafka and /opt/kafka_2.13-3.0.0 for linux)
along with ALL
data in /tmp/zookeeper and /tmp/kafka-logs!./maclocal_kill.sh
(or sudo ./linuxlocal_kill.sh
or sudo ./wsllocal_kill.sh
)NOTE
: It will also REMOVE
the Kafka logs and Zookeeper data in /tmp/zookeeper and /tmp/kafka-logs!!!Here's a screenshot:
To get the React site running:
from the root whirlpool directory, cd src/main/ui
if you don't have Node installed, use nvm to easily control Node versions
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
install Node nvm install 16.17.0
install yarn npm install --global yarn
install node modules yarn install
start dev server yarn start
Be patient after adding a new subscription. I set the timers at 30 seconds so I'm not hitting any sites too often. If you're really impatient, you can refresh the page after adding a subscription, which will end the WebSocket, use the cookie to re-login, then cause an out-of-band refresh command to be sent, which should get the data fairly quickly.
Subscriptions survive page refresh (with the same userid) because they are stored with each service in memory. A "real" system would of course use a database. Logging out cleans up all subscriptions for a user. A cookie is set upon login so reloading the page automatically logs you back in. The cookie is expired upon logout.
The previous UI still works. Here's a screenshot: