Skip to content

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.

License

Notifications You must be signed in to change notification settings

rh-messaging/cli-java

Repository files navigation

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

  • 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 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

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

License

Stars

Watchers

Forks

Packages

No packages published