In top directory execute following commands
mkdir build
cd build
cmake ..
make
ctest
Examples in qpid-messaging folder are using the Qpid Messaging C++ API. It supports both AMQP 1.0 and 0-10. To run the examples:
- Install Qpid Proton C library (only needed for AMQP 1.0 support)
- Install Qpid Messaging C++ API
- Change the hostname / IP address, port number, paths to the certificates and queue names
- Run the examples
The C++ libraries are using the NSS tools to handle SSL. The NSS database has to be prepared before running the client and configured using environment variables.
- Create the database:
certutil -N -d sql:<path>
- Load the broker public key as a trusted peer
certutil -A -d sql:<path> -t "P,," -n broker -i certutil -A -d sql:./ -t "P,," -n ecag-fixml-simu1 -i ecag-fixml-simu1_deutsche-boerse_com.crt
- Load the member public key
certutil -A -d sql:<path> -t ",," -n ABCFR_ABCFRALMMACC1 -i ABCFR_ABCFRALMMACC1.crt
- Load the member private key
pk12util -i ABCFR_ABCFRALMMACC1.p12 -d sql:<path>
- Create the password file
echo "<password>" > <passwordFile>
The Qpid Messaging C++ libraries are using environment varible to configure the SSL certificates. There are three relevant variables:
QPID_SSL_CERT_DB
contains the path to the NSS databaseQPID_SSL_CERT_PASSWORD_FILE
contains the path to the password file for the databaseQPID_SSL_CERT_NAME
contains the nick name of the certificate which should be used for the connection
for example:
export QPID_SSL_CERT_DB=sql:./tests/resources/
export QPID_SSL_CERT_PASSWORD_FILE=tests/resources/pwdfile
export QPID_SSL_CERT_NAME=ABCFR_ABCFRALMMACC1
The Qpid client application under the Windows can either use certificates for authentication against the broker from the system’s certificate store or the certificates may be provided to the application from files. To use certificates from the system’s store, one has to first properly import them.
The public key for verifying the identity of Eurex’s AMQP broker has to be always stored directly in Windows certificate store. To import it, follow these steps:
- Start the certmgr.msc for managing windows certificates
- Expand the Trusted Root Certification Authorities store
- Right-click on the Certificates folder and select "Import"
- Import the broker public key
To store the private key in the Windows certificate store and use it in your application, follow these steps:
- Prepare the private key in PKCS12 file
- Double click the PKCS12 file
- A dialog window pops up which guides you through the import
- Use environment variables to point your application to the private key
set QPID_SSL_CERT_STORE=<CertificateStore>
set QPID_SSL_CERT_NAME=<friendlyName>
For example:
set QPID_SSL_CERT_STORE=Personal
set QPID_SSL_CERT_NAME=CN=ABCFR_ABCFRALMMACC1
The private key can be also used directly from the PKCS12 file.
- Prepare the private key in PKCS12 file
- Create the password file (a text file containing the password to the PKCS12 file)
- Use environment variables to point your application to the private key
set QPID_SSL_CERT_FILENAME=<certificateFile>
set QPID_SSL_CERT_PASSWORD_FILE=<passwordFile>
set QPID_SSL_CERT_NAME=<friendlyName>
For example:
set QPID_SSL_CERT_FILENAME=ABCFR_ABCFRALMMACC1.p12
set QPID_SSL_CERT_PASSWORD_FILE=ABCFR_ABCFRALMMACC1.pwd
set QPID_SSL_CERT_NAME=abcfr_abcfralmmacc1
Example executable demo_qpid-messaging
is created in <build directory>/qpid-messaging/src
. This executable can be run in two modes - as broadcast receiver or as request sender / response receiver. The demo_qpid-messaging
program accepts following options:
./demo_qpid-messaging [options] <mode>
Options:" << std::endl;
-a <account> Account (default=ABCFR_ABCFRALMMACC1)
-h <hostname> Hostname (default=ecaf-fixml-simu1.deutsche-boerse.com)
-p <port> Port (default=10170)
-t <timeout> Timeout (default=10)
-1 Enable AMQP 1.0 protocol
Modes:
broadcast_receiver - Receive broadcasts.
request_response - Send request and receive response.
To run the executable:
- Configure SSL
- Run
./demo_qpid-messaging -a ABCFR_ABCFRALMMACC1 -h ecag-fixml-dev1 -p 5671 request_response
to send request / receive response - Run
./demo_qpid-messaging -a ABCFR_ABCFRALMMACC1 -h ecag-fixml-dev1 -p 5671 broadcast_receiver
to receive broadcasts - Use the option -1 to use AMQP 1.0
The code responsible for receiving broadcasts is in the files BroadcastReceiver.h
and BroadcastReceiver.cpp
. This code handles both AMQP 0-10 and 1.0.
The code responsible for sending requests / receiving responses is in the files RequestResponse.h
and RequestResponse.cpp
. This code handles both AMQP 0-10 and 1.0.
Examples in qpid-proton folder are using the (C++ binding) of Qpid Proton API. It supports both AMQP 1.0. To run the examples:
- Install Qpid Proton C library along with C++ binding
- Change the hostname / IP address, port number, paths to the certificates and queue names
- Run examples
To use SSL private key in PEM format and public key in crt format are needed.
Example executable demo_qpid-proton
is created in <build directory>/qpid-proton/src
. This executable can be run in two modes - as broadcast receiver or as request sender / response receiver. The demo_qpid-proton
program accepts following options:
./demo_qpid-proton [options] <mode>
Options:
-a <account> Account (default=ABCFR_ABCFRALMMACC1)
-h <hostname> Hostname (default=ecag-fixml-simu1.deutsche-boerse.com)
-p <port> Port (default=10170)
-c <path> Path to host certificate (default=ecag-fixml-simu1.crt)
-k <path> Path to account private key (default=ABCFR_ABCFRALMMACC1.pem)
-w <password> Account private key password (default=123456)
Modes:
broadcast_receiver - Receive broadcasts.
request_response - Send request and receive response.
To run the executable:
- Prepare private key and public certificate
- Run
./demo_qpid-proton -a ABCFR_ABCFRALMMACC1 -h ecag-fixml-dev1 -p 5671 -c ecag-fixml-simu1.crt -k ABCFR_ABCFRALMMACC1.pem request_response
to send request / receive response - Run
./demo_qpid-proton -a ABCFR_ABCFRALMMACC1 -h ecag-fixml-dev1 -p 5671 -c ecag-fixml-simu1.crt -k ABCFR_ABCFRALMMACC1.pem broadcast_receiver
to receive broadcasts
The code responsible for receiving broadcasts is in the files BroadcastReceiver.h
and BroadcastReceiver.cpp
. This code handles only AMQP 1.0.
The code responsible for sending requests / receiving responses is in the files RequestResponse.h
and RequestResponse.cpp
. This code handles only AMQP 1.0.
The project is using Travis-CI and Circle CI to run its own integration tests. The tests are executed against Docker images which contain the AMQP broker with configuration corresponding to Eurex Clearing FIXML Interface. The details of the integration tests can be found in the .travis.yml and circle.yml files.
More details about C++ APIs and code examples can be found in the Volume B of Eurex Clearing Messaging Interfaces documentation on Eurex Clearing website.