Skip to content
Nuvyntra Labs

Documentation

Client samples

Commands for every language sample. Each program opens the data port and runs demo, ping, stream, consume, exchange, or admin.

Overview

These programs are how an application integrates with an installed NuvexaMQ broker. They open the data port directly. They are not AMQP, MQTT, or Kafka clients.

NUVEXA_HOST defaults to 127.0.0.1 and NUVEXA_PORT to 5761. Management samples also use NUVEXA_HEALTH_PORT (5762), NUVEXA_MANAGEMENT_PORT (5763), and NUVEXA_MANAGEMENT_HTTPS_PORT (5764). Guest credentials and vhost / are the defaults. Set NUVEXA_TOKEN when the broker requires a cluster token.

demo publishes hello from <language> on clients.created, then fetches and acks it. The other programs use a language-specific resource name so they can run on one broker together:

ProgramWhat it exercises
pingHello, including the token field, then ping/pong
streamPartitions, retention, max message bytes, headers, and unkeyed round-robin
consumeFilter, ack, nack and redelivery, reset, ephemeral tail, start-at-offset, release
exchangedirect, fanout, topic, headers, queue TTL, max length, dead letter, bind arguments, default exchange, purge, delete
admin/health, /metrics, management reads, vhost, user, permission, policy, and the HTTPS listener

SQL cannot open the TCP port. sql/ledger.sql is a receipt table for the line each sample prints.

AreaLanguagesSample
WebJavaScript, TypeScript, PHP, Python, Ruby, C#below
MobileKotlin, Swift, Dart, C#CLI programs that send the same frames an app would
BackendJava, C#, Python, Go, Rust, TypeScriptbelow
AI / DataPython, R, Juliabelow
SystemsC, C++, Rust, Gobelow
EnterpriseJava, C#, Python, TypeScriptbelow
DatabaseSQLsql/ledger.sql
Game developmentC++, C#, Luabelow
Cloud / DevOpsGo, Python, Bash, Rustbelow

Every language except SQL has ping, stream, consume, exchange, and admin in addition to demo. SQL cannot open the data port.

LanguageRun
JavaScriptnode javascript/demo.mjs and the same folder's ping.mjs, stream.mjs, consume.mjs, exchange.mjs, admin.mjs
TypeScriptnode --experimental-strip-types typescript/demo.ts and ping.ts, stream.ts, consume.ts, exchange.ts, admin.ts
PHPphp php/demo.php and ping.php, stream.php, consume.php, exchange.php, admin.php
Pythonpython3 python/demo.py and ping.py, stream.py, consume.py, exchange.py, admin.py
Rubyruby ruby/demo.rb and ping.rb, stream.rb, consume.rb, exchange.rb, admin.rb
C#dotnet run --project csharp/csharp.csproj -- demo and ping, stream, consume, exchange, admin
Kotlinkotlinc kotlin/Demo.kt -include-runtime -d /tmp/nuvexa-kotlin.jar && java -jar /tmp/nuvexa-kotlin.jar. Features: kotlinc kotlin/Feature.kt -include-runtime -d /tmp/nuvexa-kotlin-feature.jar && java -jar /tmp/nuvexa-kotlin-feature.jar ping
Swiftswift swift/demo.swift. Features: swift swift/feature.swift ping
Dartdart run dart/demo.dart. Features: dart run dart/feature.dart ping
Javajavac -d /tmp/nuvexa-java java/Demo.java && java -cp /tmp/nuvexa-java Demo. Feature classes: Client.java with Ping, Stream, Consume, Exchange, Admin
Gogo run . from go/, or go run . ping, stream, consume, exchange, admin
Rustcargo run from rust/. Features: cargo run --bin feature -- ping
RRscript r/demo.R. Features: Rscript r/feature.R ping
Juliajulia julia/demo.jl. Features: julia julia/feature.jl ping
Ccc -O2 -o /tmp/nuvexa-c-demo c/demo.c && /tmp/nuvexa-c-demo. Features: cc -O2 -o /tmp/nuvexa-c-feature c/feature.c && /tmp/nuvexa-c-feature ping
C++c++ -O2 -std=c++17 -o /tmp/nuvexa-cpp-demo cpp/demo.cpp && /tmp/nuvexa-cpp-demo. Features: c++ -O2 -std=c++17 -o /tmp/nuvexa-cpp-feature cpp/feature.cpp && /tmp/nuvexa-cpp-feature ping
Lualuarocks install luasocket then lua lua/demo.lua. Features: lua lua/feature.lua ping
Bashbash bash/demo.sh. Features: bash bash/feature.sh ping
SQLload sql/ledger.sql in the database that should keep receipts

Discussion

Comment on NuvexaMQ. The thread lives on this component's GitHub repository (nuvyntralabs/NuvexaMQ). Sign in with GitHub — Giscus uses Discussions, Utterances uses Issues.