Sapo Broker - Maven Edition
Here will be documented variables and goals used to build and execute broker agents and clients, and their dependencies.
To build with maven:
mvn clean install
To build a debian package:
mvn package
To run the agent directly from maven:
mvn exec:java
The package will be at the target directory.
- Clean and Build - in order to build all components please execute mvn install on the root of the project. If you need to clean all previous builds before a new build execute mvn clean. You can combine both goals by executing mvn clean install. You can run these goals on each submodule separately if you only need to update or bundle one of these submodules. All the created jars and necessary files are accessible through the created target folder on each submodule. All inner dependencies follow the global's project version.
- Jar with dependencies - if you include a file named with-deps on the root of your submodule, a jar with all dependencies is created on the target folder.
-
Configurable properties (inside the POM or within the command line execution)
- mainClass - class that will be included on the jar manifest as main Class. In conjunction with jar with dependencies feature you can then execute the resulting jar by calling mvn exec:exec or java -jar [jar-with-dependencies]
- className - on some submodules the mainClass can already be defined, sapo-broker-java-client for example, as pt.com.broker.client.sample.${className}, being then possible to execute different client types through the command line using the option -DclassName=[class name]
- extraArgs - extra JVM options specific to each module. They will be concatenated with the default JVM options defined on Sapo's parent POM (-server -Xverify:none -Xms32M -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false -Dfile.encoding=UTF-8)
- extraOptions - execution options that will be accessible through the String[] args parameter on the main method of the executable class.
- Sapo's maven repository (important links) - All dependencies used originate from our maven's repository. Authenticated deployments can be made into 3rd party snapshots, 3rd party releases, Sapo's releases and Sapo's snapshots.
The most important central maven repositories are proxied by Sapo's repository so you will only need to use one (Sapo's) repository on your maven settings. You can search and navigate the repository here.
Vagrant
There is a pre-configured Vagrant box with the tools that you need start using sapo broker.
git submodule init
git submodule update
cd vagrant
cp Vagrantfile.orig Vagrantfile
vagrant plugin install vagrant-share
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-timezone
vagrant up
Wireshark
There is a simple wireshark dissector that helps you debug the broker protocol. The plugin is work-in-progress and the support is very limited.