rh-messaging / cli-java

cli-java is a collection of commandline messaging clients suitable for interacting with Message Oriented Middleware such as ActiveMQ Artemis broker or Qpid Dispatch router.
Apache License 2.0
8 stars 7 forks source link
amqp amqp10 messaging openwire

cli-java

Build Status Code Coverage Coverity Scan Status Codacy Badge Code Climate

cli-java is a collection of commandline messaging clients suitable for interacting with Message Oriented Middleware.

Requirements

Getting started

mvn clean package  # compile without executing external tests (tests that require broker)
java -jar cli-qpid-jms/target/cli-qpid-jms-*.jar sender -b amqp://127.0.0.1:5672 -a myQ --log-msgs dict

IntelliJ notes

Open an existing Maven project.

Common issues

When using IntelliJ IDEA Ultimate Edition, select "Open" (not "Import Project") option to open project and delete OSGi facets in File >> Project Structure >> Project Settings >> Facets.

The class is generated by the Dagger annotation processor. Run mvn compile on the command line so that Maven generates what is needed.

The IDE action on the Maven tab to generate sources does not actually generate what is needed for Kotlin tests, because of a missing feature.

IntelliJ is happy to run failsafe tests without doing the (equivalent of) mvn package first. This means that the jars used in the *ITCase tests may be nonexistent (or out of date). Run mvn package -DskipTests yourself to fix this.

Run tests

mvn test -Ptests

mvn test -Pcoverage,tests  # collect coverage using JaCoCo

mvn clean test -Dmaven.test.failure.ignore
find -wholename "*/surefire-reports/TEST-*.xml" | zip -j@ test_results.zip

Update dependencies

 mvn versions:display-dependency-updates
 mvn versions:display-plugin-updates

Update versions

mvn versions:set -DgenerateBackupPoms=false -DnewVersion=2017.07

Build docker

Uses podman. Needs sudo to hook qemu.

mvn clean
bash build_java.sh
bash build_docker.sh

Date-based versioning of image tags, use

bash build_docker.sh $(date '+%Y-%m-%d')

List of Java clis

maven module messaging library protocol (JMS version) notes
cli-activemq activemq-client OpenWire (JMS v1.1) javax.jms API
cli-activemq-jmx artemis-core-client JMX management
cli-artemis-jms artemis-jms-client Artemis Core javax.jms API
cli-paho-java eclipse.paho.client.mqttv3 MQTT v3
cli-protonj2 protonj2-client AMQP 1.0 "imperative API"
cli-qpid-jms qpid-jms-client AMQP 1.0 (JMS v2.0) jakarta.jms API

Additional maven modules

maven module
parent common maven configuration for child modules, parent of all other modules
bom contains dependencyManagement pom section with dependency versions
broker embedded artemis-server broker for use in selftests
tests test dependency of cli-* projects, contains shared test code
lib shared code that does not depend on JMS
jmslib shared code that depends on javax.jms API
jakartalib shared code that depends on jakarta.jmx API
cli the ClientListener interface for use in client selftests (messages as Maps)

Directories

directory
.github GitHub Actions CI configurations, dependabot.yml file
image helper scripts for Dockerfile/Containerfile to build image
scripts helper scripts for CI jobs

Related projects