docs/examples/JDBC/consumer-demo/readme.md
TDengine's Consumer demo project is organized in a Maven way so that users can easily compile, package and run the project. If you don't have Maven on your server, you may install it using
sudo apt-get install maven
Make sure you have already installed a tdengine client on your current develop environment.
Download the tdengine package on our website: https://www.taosdata.com/cn/all-downloads/ and install the client.
run command:
mvn clean compile exec:java -Dexec.mainClass="com.taosdata.ConsumerDemo"
# the host of TDengine server
export TAOS_HOST="127.0.0.1"
# the port of TDengine server
export TAOS_PORT="6041"
# the consumer type, can be "ws" or "jni"
export TAOS_TYPE="ws"
# the number of consumers
export TAOS_JDBC_CONSUMER_NUM="1"
# the number of processors to consume
export TAOS_JDBC_PROCESSOR_NUM="2"
# the number of records to be consumed per processor per second
export TAOS_JDBC_RATE_PER_PROCESSOR="1000"
# poll wait time in ms
export TAOS_JDBC_POLL_SLEEP="100"
To compile the demo project, go to the source directory TDengine/tests/examples/JDBC/consumer-demo and execute
mvn clean package assembly:single
To run ConsumerDemo.jar, go to TDengine/tests/examples/JDBC/consumer-demo and execute
java -jar target/ConsumerDemo-jar-with-dependencies.jar