Skip to content

Repository files navigation

cli-java

Build StatusCode CoverageCoverity Scan StatusCodacy BadgeCode Climate

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

Requirements

  • Java 11+
  • Maven 3
  • for tcnative dynamic library, outdated openssl 1.0 is required
    • on Fedora 37, execute sudo dnf install -y apr https://kojipkgs.fedoraproject.org//packages/compat-openssl10/1.0.2o/11.fc33/x86_64/compat-openssl10-1.0.2o-11.fc33.x86_64.rpm
    • or, enable use of BoringSSL static library instead of the dynamic one, with -P tcnative-boringssl-static profile to maven

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

  • OSGi problems (don't remember what those actually were)

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.

  • Unresolved reference: DaggerFakeClient, or anything else with Dagger in it

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.

  • Error: Unable to access jarfile [...]/target/cli-qpid-jms-1.2.2-SNAPSHOT-2.2.0.jar

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 modulemessaging libraryprotocol (JMS version)notes
cli-activemqactivemq-clientOpenWire (JMS v1.1)javax.jms API
cli-activemq-jmxartemis-core-clientJMX management
cli-artemis-jmsartemis-jms-clientArtemis Corejavax.jms API
cli-paho-javaeclipse.paho.client.mqttv3MQTT v3
cli-protonj2protonj2-clientAMQP 1.0"imperative API"
cli-qpid-jmsqpid-jms-clientAMQP 1.0 (JMS v2.0)jakarta.jms API

Additional maven modules

maven module
parentcommon maven configuration for child modules, parent of all other modules
bomcontains dependencyManagement pom section with dependency versions
brokerembedded artemis-server broker for use in selftests
teststest dependency of cli-* projects, contains shared test code
libshared code that does not depend on JMS
jmslibshared code that depends on javax.jms API
jakartalibshared code that depends on jakarta.jmx API
clithe ClientListener interface for use in client selftests (messages as Maps)

Directories

directory
.githubGitHub Actions CI configurations, dependabot.yml file
imagehelper scripts for Dockerfile/Containerfile to build image
scriptshelper scripts for CI jobs

Related projects

About

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.

Topics

Resources

Stars

8 stars

Watchers

20 watching

Forks

Releases

Packages

Used by

Contributors

Languages