Skip to content

Eurex-Clearing-Messaging-Interfaces/Vert.x-Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status CircleCI Coverage Status

Vert.x-Examples

These examples show how to connect to Eurex Clearing Messaging Interfaces using the Vert.x 3 toolkit. More information about Vert.x can be found on its website. The examples are designed as a simple REST based application. They use the vertx-proton extension to communicate with the AMQP broker using AMQP 1.0. More info about vertx-proton can be found on its GitHub project. The examples also uses HSQL database over JDBC interface to store the messages.

Configuration

The application can be configured using a JSON file which specifies

  • Connection details for the AMQP broker
  • HTTP port where the REST interface should run
  • URL where the database should run / how it should be configured

Example configuration file can be found in ./src/main/resources/config.json.

Application start

The application can be build using mvn package command and started as a regular Java application: https://github.com/vert-x3/vertx-proton

After the start, the application will

  1. Start the webserver
  2. Initialize the JDBS connection to the SQL database and create the database structure
  3. Connect to the AMQP broker using AMQP 1.0, SASL EXTERNAL and SSL Client Authentication

Rest interface

The REST interface is used for a basic control of the application.

Subscribing to messages

In order to receive any messages from the AMQP broker, you have to create a receiver. That can be done using following HTTP POST request sent to the path /api/subscribe:

curl -X POST http://localhost:8080/api/subscribe -d "{\"name\":\"broadcast.ABCFR_ABCFRALMMACC1.TradeConfirmationNCM\"}"

In the same way you can also subscribe to the response queue response.ABCFR_ABCFRALMMACC1:

curl -X POST http://localhost:8080/api/subscribe -d "{\"name\":\"response.ABCFR_ABCFRALMMACC1\"}"

Sending requests

Request messages can be sent using HTTP POST request sent to /api/request. The body of the request is a JSON encoded map with the message details. For example:

curl -X POST http://localhost:8080/api/request -d "{\"correlationId\":\"myCorrId\",\"body\":\"Hello World\"}"

Reading Messages

Messages which were received by the application are stored in the database. They can be obtained using HTTP GET request. Reqeust sent to /api/messages will return JSON formated list of all messages. Request sent to /api/messages/<queueNeme> will return only messages received from the given queue. And request sent to /api/messages/<queueNeme>/<correlationID> will return only messages received from the given queue matching the specific correlation ID.

curl -X GET http://localhost:8080/api/messages
curl -X GET http://localhost:8080/api/messages/response.ABCFR_ABCFRALMMACC1
curl -X GET http://localhost:8080/api/messages/response.ABCFR_ABCFRALMMACC1/myCorrId

SSL

In order to connect to the Eurex brokers using SSL Client Authentication based on self-signed certificates, the examples use the AliasKeyManager library.

Integration tests

The project is using Travis-CI and Circle CI to run its own integration tests. The tests are executed using Docker images which contain the AMQP broker with configuration corresponding to Eurex Clearing FIXML Interface as well as the Dispatch router. The details of the Travis-CI and Circle CI integration can be found in the .travis.yml and circle.yml files.

Documentation

More details about Eurex Clearing Messaging Interfaces can be found on Eurex Clearing website

About

Eurex Clearing Messaging Interfaces - Vert.x 3 based code examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages