Setup
The Java, C++ and Python examples can be run using either jzmq or jeromq.
Open a shell and go to the root Cameo directory:
Set the PATH variable so that the C++ programs are found:
$ export PATH=build/examples/cpp:$PATH
If necessary, set the PYTHONPATH variable so that the cameopy module is found. The path is dependent on the system e.g.:
$ export PYTHONPATH=<cameo-build-path>/lib/python3/dist-packages:$PYTHONPATH
Select jzmq or jeromq Java library.
Case jzmq:
$ export CLASSPATH=examples/java/jzmq/target/cameo-examples-jzmq-full.jar
You shall define the variable LD_LIBRARY_PATH so that libjzmq.so is found:
$ export LD_LIBRARY_PATH=<path-to-libjzmq>
In each new shell, create the alias for cmo:
$ alias cmo="java -jar java/console-jzmq/target/cameo-console-jzmq-2.0.0-full.jar"
Case jeromq:
$ export CLASSPATH=examples/java/jeromq/target/cameo-tests-jeromq-full.jar
In each new shell, create the alias for cmo:
$ alias cmo="java -jar java/console/target/cameo-console-2.0.0-full.jar"
Requester/Responder
Java
The requester/responder in Java can be tested. First start the Cameo server:
$ java fr.ill.ics.cameo.server.Server examples/java/config.xml --log-console
Then start the responder in a new shell:
$ cmo -p 10000 exec responder
Execute a requester in a new shell:
$ cmo -p 10000 exec requester my-request 10
C++
The requester/responder in C++ can be tested. First start the Cameo server:
$ java fr.ill.ics.cameo.server.Server examples/cpp/config.xml --log-console
Then start the responder in a new shell:
$ cmo -p 10000 exec responder
Execute a requester in a new shell:
$ cmo -p 10000 exec requester my-request 10
Execute the requester with the Java responder:
$ cmo -p 10000 exec requester my-request 10 tcp://localhost:10000
Python
First start the Cameo server:
$ java fr.ill.ics.cameo.server.Server examples/python/config.xml --log-console
In a shell, start the responderpy test:
$ cmo -p 10000 exec responderpy
In a shell, start the requesterpy application:
$ cmo -p 10000 exec requesterpy 1000
Publisher/Subscriber
Java
The publisher/subscriber in Java can be tested. First start the Cameo server:
$ java fr.ill.ics.cameo.server.Server examples/java/config.xml --log-console
Then start the publisher in a new shell:
$ cmo -p 10000 exec publisher
Execute a subscriber in a new shell:
$ cmo -p 10000 exec subscriber
C++
The publisher/subscriber in C++ can be tested. First start the Cameo server:
$ java fr.ill.ics.cameo.server.Server examples/cpp/config.xml --log-console
Then start the publisher in a new shell:
$ cmo -p 10000 exec publisher
Execute a subscriber in a new shell:
$ cmo -p 10000 exec subscriber
Execute the requester with the Java publisher:
$ cmo -p 10000 exec subscriber tcp://localhost:10000
Python
First start the Cameo server:
$ java fr.ill.ics.cameo.server.Server examples/python/config.xml --log-console
In a shell, start the publisherpy test:
$ cmo -p 10000 exec publisherpy
In a shell, start the subscriberpy application:
$ cmo -p 10000 exec subscriberpy