In this quick start guide, we’ll be getting you set up with an OpenMAMA development environment, and subscribe to a Market Data Publisher.
Depending on your target environment, we have many options for installing OpenMAMA. The easiest one for this task would be to connect to a running instance of the AWS AMI or vagrant box since it already contains a running publisher you can subscribe to, but we’ll also document how to run your own here.
To continue, you’ll need to install:
yum install gcc cmake
apt install gcc g++ cmake
yum install java-ll-openjdk
apt install openjdk-13-jdk
We have a number of ready-made OpenMAMA projects ready for you to grab from the OpenMAMA repository tutorials folder here. You can download these with:
git clone https://github.com/OpenMAMA/OpenMAMA
Then they will be available for each language in OpenMAMA/tutorials
. If you want to view the code, you may navigate
your IDE to that directory. The projects are standard for each language so most IDEs should automatically import them.
Now that you have your ready made projects available, you can get building from the command line, or alternatively
you can defer to your IDE of choice if you prefer. Note that the default install
location for OpenMAMA packages (OPENMAMA_ROOT
) on Linux is /opt/openmama
:
This will create a quickstart
executable relative to the build directory. Its location will
vary depending on the platform, but that's it ready to execute, but the OS will need to know where to find
OpenMAMA at runtime too, so before running:
This will create a quickstart
executable relative to the build directory. Its location will
vary depending on the platform, but that's it ready to execute, but the OS will need to know where to find
OpenMAMA at runtime too, so before running:
On Java, you can pretty much run this out of the box, but the OS will need to know where to find OpenMAMA at runtime too, so before running:
On Windows: On Linux: On Mac: Then you're ready to run:On .NET, you can pretty much run this out of the box, but the OS will need to know where to find OpenMAMA at runtime too, so before running:
On Windows: On Linux: Then you're ready to run:OK so now you have a working application, you can go ahead and connect to market data! Note that if your data is provided
by a proprietary solution, you may need to contact them to acquire their OpenMAMA integration libraries and drop them into
$OPENMAMA_ROOT/lib
or alternatively include them in your system’s runtime linker library path.
If you don’t already have a Market Data publisher to subscribe to, you can run your own using Qpid along with our test market data.
$ git clone https://github.com/OpenMAMA/OpenMAMA-testdata.git /opt/openmama/data
$ export PATH=/opt/openmama/bin:$PATH
$ export LD_LIBRARY_PATH=/opt/openmama/lib:$PATH
$ export WOMBAT_PATH=/opt/openmama/config
$ capturereplayc -dictionary /opt/openmama/data/dictionaries/data.dict -m qpid -S OM -tport pub \
-f /opt/openmama/data/playbacks/openmama_utpcasheuro_capture.5000.10.qpid.mplay -v -v -v -v
Note that regardless of the language being used, the C capture replay tool may be used here since the protocols are the same.
If you are using our demo environment, this service will already be running.
Now that your environment is up and running, you can begin consuming market data!
$ export WOMBAT_PATH=/opt/openmama/config
$ export LD_LIBRARY_PATH=/opt/openmama/lib
$ ./quickstart -m qpid -S OM -t sub -s DE000CM95AU4.EUR.XPAR \
-d /home/fquinn/SourceExternal/cascadium/OpenMAMA-testdata/dictionaries/data.dict
Note that to connect to other middlewares, you can simply drop the third party libraries you need
into /opt/openmama/lib
, configure / use another transport from mama.properties
and that’s it -
no code changes or even a recompile required!
Go ahead and open up the code in your favourite text editor and have a look through the code. There’s really not much to getting up and running… if you’re not at a developer box at the moment, the code is detailed below: