B - AMQP Programming Guide 1.5

Eurex Clearing

Eurex Clearing Messaging Interfaces Connectivity

B: AMQP Programming Guide

© Eurex 2012

Deutsche Börse AG (DBAG), Clearstream Banking AG (Clearstream), Eurex Frankfurt AG, Eurex Clearing AG (Eurex Clearing) as well as Eurex Bonds GmbH (Eurex Bonds) and Eurex Repo GmbH (Eurex Repo) are corporate entities and are registered under German law. Eurex Zürich AG is a corporate entity and is registered under Swiss law. Clearstream Banking S.A. is a corporate entity and is registered under Luxembourg law. U.S. Exchange Holdings, Inc. and International Securities Exchange Holdings, Inc. (ISE) are corporate entities and are registered under U.S. American law. Eurex Frankfurt AG (Eurex) is the administrating and operating institution of Eurex Deutschland. Eurex Deutschland and Eurex Zürich AG are in the following referred to as the “Eurex Exchanges”.

All intellectual property, proprietary and other rights and interests in this publication and the subject matter hereof (other than certain trademarks and service marks listed below) are owned by DBAG and its affiliates and subsidiaries including, without limitation, all patent, registered design, copyright, trademark and service mark rights. While reasonable care has been taken in the preparation of this publication to provide details that are accurate and not misleading at the time of publication DBAG, Clearstream, Eurex, Eurex Clearing, Eurex Bonds, Eurex Repo as well as the Eurex Exchanges and their respective servants and agents (a) do not make any representations or warranties regarding the information contained herein, whether express or implied, including without limitation any implied warranty of merchantability or fitness for a particular purpose or any warranty with respect to the accuracy, correctness, quality, completeness or timeliness of such information, and (b) shall not be responsible or liable for any third party’s use of any information contained herein under any circumstances, including, without limitation, in connection with actual trading or otherwise or for any errors or omissions contained in this publication.

This publication is published for information purposes only and shall not constitute investment advice respectively does not constitute an offer, solicitation or recommendation to acquire or dispose of any investment or to engage in any other transaction. This publication is not intended for solicitation purposes but only for use as general information. All descriptions, examples and calculations contained in this publication are for illustrative purposes only.

Eurex and Eurex Clearing offer services directly to members of the Eurex exchanges respectively to clearing members of Eurex Clearing. Those who desire to trade any products available on the Eurex market or who desire to offer and sell any such products to others or who desire to possess a clearing license of Eurex Clearing in order to participate in the clearing process provided by Eurex Clearing, should consider legal and regulatory requirements of those jurisdictions relevant to them, as well as the risks associated with such products, before doing so.

Eurex derivatives (other than EURO STOXX 50® Index Futures contracts, EURO STOXX® Select Dividend 30 Index Futures contracts, STOXX® Europe 50 Index Futures contracts, STOXX® Europe 600 Index Futures contracts, STOXX® Europe Large/Mid/Small 200 Index Futures contracts, EURO STOXX® Banks Futures contracts, STOXX® Europe 600 Banks/Industrial Goods & Services/Insurance/Media/Personal & Household Goods/Travel & Leisure/Utilities Futures contracts, Dow Jones Global Titans 50 IndexSM Futures contracts, DAX® Futures contracts, MDAX® Futures contracts, TecDAX® Futures contracts, SMIM® Futures contracts, SLI Swiss Leader Index® Futures contracts, Eurex inflation/commodity/weather/property and interest rate derivatives) are currently not available for offer, sale or trading in the United States or by United States persons.

Trademarks and Service Marks

Buxl®, DAX®, DivDAX®, eb.rexx®, Eurex®, Eurex Bonds®, Eurex Repo®, Eurex Strategy WizardSM, Euro GC Pooling®, FDAX®, FWB®, GC Pooling®,,GCPI®, MDAX®, ODAX®, SDAX®, TecDAX®, USD GC Pooling®, VDAX®, VDAX-NEW® and Xetra® are registered trademarks of DBAG.

Phelix Base® and Phelix Peak® are registered trademarks of European Energy Exchange AG (EEX).

The service marks MSCI Russia and MSCI Japan are the exclusive property of MSCI Barra.

iTraxx® is a registered trademark of International Index Company Limited (IIC) and has been licensed for the use by Eurex. IIC does not approve, endorse or recommend Eurex or iTraxx® Europe 5-year Index Futures, iTraxx® Europe HiVol 5-year Index Futures and iTraxx® Europe Crossover 5-year Index Futures.

Eurex is solely responsible for the creation of the Eurex iTraxx® Credit Futures contracts, their trading and market surveillance. ISDA® neither sponsors nor endorses the product’s use. ISDA® is a registered trademark of the International Swaps and Derivatives Association, Inc. IPD UK Annual All Property Index is a registered trademark of Investment Property Databank Ltd. IPD and has been licensed for the use by Eurex for derivatives.

SLI®, SMI® and SMIM® are registered trademarks of SIX Swiss Exchange AG.

The STOXX® indexes, the data included therein and the trademarks used in the index names are the intellectual property of STOXX Limited and/or its licensors Eurex derivatives based on the STOXX® indexes are in no way sponsored, endorsed, sold or promoted by STOXX and its licensors and neither STOXX nor its licensors shall have any liability with respect thereto.

Dow Jones, Dow Jones Global Titans 50 IndexSM and Dow Jones Sector Titans IndexesSM are service marks of Dow Jones & Company, Inc. Dow Jones-UBS Commodity IndexSM and any related sub-indexes are service marks of Dow Jones & Company, Inc. and UBS AG. All derivatives based on these indexes are not sponsored, endorsed, sold or promoted by Dow Jones & Company, Inc. or UBS AG, and neither party makes any representation regarding the advisability of trading or of investing in such products.

All references to London Gold and Silver Fixing prices are used with the permission of The London Gold Market Fixing Limited as well as The London Silver Market Fixing Limited, which for the avoidance of doubt has no involvement with and accepts no responsibility whatsoever for the underlying product to which the Fixing prices may be referenced.

PCS® and Property Claim Services® are registered trademarks of ISO Services, Inc.

Korea Exchange, KRX, KOSPI and KOSPI 200 are registered trademarks of Korea Exchange Inc.

BSE and SENSEX are trademarks/service marks of Bombay Stock Exchange (BSE) and all rights accruing from the same, statutory or otherwise, wholly vest with BSE. Any violation of the above would constitute an offence under the laws of India and international treaties governing the same.

The names of other companies and third party products may be trademarks or service marks of their respective owners.

Eurex Clearing

Eurex Clearing Messaging Interfaces Connectivity

B: AMQP Programming Guide

  • For Internal Use Only -

Document ID

Version Number 1.4

Status draft

Author J. Scholz, M. Zerola

Reviewed by

Approval

Level 1

Level 2

Release Date 15.11.200028.11.2008official due date

Printed 12/30/2011 1:12:00 PM

Abstract

This document provides information about the connectivity for the AMQP based Eurex Clearing FIXML Interface, Eurex Clearing FpML Interface and Eurex Clearing Margin Calculator Interface. This document is intended to be a guide to Members developing applications, which will utilize this interface.

Keywords

Eurex Clearing FIXML Interface, Eurex Clearing FpML Interface, Eurex Clearing Margin Calculator Interface, Advanced Message Queuing Protocol, AMQP, Clearing, FIXML, FpML, XML, Development guide, Java, C++, .NET

History

Date Version By Reason
06.06.2014 1.0 J. Scholz Interface docu separated from FpML / FIXML docu
16.06.2014 1.1 J. Scholz Handling of full request queues, removing examples, SSL support on Windows changes, Support for Qpid 0.30
12.11.2014 1.2 J. Scholz TextMessage versus BytesMessage
26.01.2015 1.3 J. Scholz Preparation for MRG-M 3.0 / SSL 2.0 & 3.0 removal
04.02.2015 1.4 J. Scholz AMQP 1.0 support

.Table of Contents

(To insert or update the table of contents, press the button on the menu bar above.)

1Introduction 9

1.1 Overview 9

1.1.1 Eurex Clearing FIXML Interface 9

1.1.2 Eurex Clearing FpML Interface 9

1.1.3 Eurex Clearing Margin Calculator Interface 9

1.1.4 AMQP 9

1.1.5 FIXML 9

1.1.6 FpML 10

1.2 Intended audience 10

1.3 Eurex Clearing Messaging Interface Connectivity documentation 10

1.4 Eurex Clearing FIXML Interface documentation 11

1.5 Eurex Clearing FpML Interface and Margin Calculator Interface documentation 12

1.6 Conventions used in this document 12

1.7 Examples used in this document 12

1.8 Organization of this document 12

1.9 Code examples 13

2Obtaining the AMQP client API 14

2.1 Apache Qpid / Red Hat MRG Messaging 14

2.2 SwiftMQ AMQP 1.0 Java client 15

2.3 Upgrading client libraries 16

3Java 17

3.1 SSL / TLS Certificates 17

3.1.1 Client certificate 17

3.1.2 Broker public keys 18

3.1.3 SSL / TLS debugging 19

3.2 JMS 20

3.2.1 Java Naming and Directory Interface (JNDI) 20

3.2.2 Preparing connection and session 20

3.2.3 Creating a receiver/sender 21

3.2.4 Starting the connection 22

3.2.5 Thread safety 22

3.2.6 Receiving/sending messages 23

3.2.6.1 Preparing a request message 23

3.2.6.2 Sending a request message 23

3.2.6.3 Receiving a message using Message listener 24

3.2.6.4 Receiving a message using the receive() method 24

3.2.6.5 Message processing 25

3.2.7 Closing the connection 26

3.2.8 Error handling 26

3.3 Apache Qpid JMS client for AMQP 0-10 28

3.3.1 Connection Factory 28

3.3.2 Connection URI 28

3.3.3 Addresses 30

3.3.3.1 Receiving responses to requests 30

3.3.3.2 Sending requests 32

3.3.3.3 “ReplyTo” address in requests 33

3.3.3.4 Receiving broadcasts 33

3.3.4 Performance 34

3.3.4.1 Receive pre-fetching 34

3.3.4.2 Message acknowledgement 35

3.3.4.3 Sender synchronization 36

3.3.5 Logging 36

3.4 Apache Qpid JMS client for AMQP 1.0 37

3.4.1 Connection Factory 37

3.4.2 Connection URI 37

3.4.3 Addresses 39

3.4.3.1 Receiving responses to requests 39

3.4.3.2 Sending requests 40

3.4.3.3 “ReplyTo” address in requests 40

3.4.3.4 Receiving broadcasts 40

3.4.4 Performance 41

3.4.4.1 Receive pre-fetching 41

3.4.4.2 Message acknowledgement 41

3.4.4.3 Sender synchronization 42

3.4.5 Logging 42

3.5 Apache Qpid AMQP 1.0 JMS client 43

3.5.1 Connection Factory 43

3.5.2 Connection URI 43

3.5.3 Addresses 44

3.5.3.1 Receiving responses to requests 45

3.5.3.2 Sending requests 45

3.5.3.3 “ReplyTo” address in requests 45

3.5.3.4 Receiving broadcasts 46

3.5.4 Performance 46

3.5.4.1 Receive pre-fetching 46

3.5.4.2 Sender synchronization 47

3.5.5 Logging 47

3.6 SwiftMQ AMQP 1.0 client 47

3.6.1 SSL Client Authentication 48

3.6.2 Preparing connection and session 50

3.6.3 Creating consumer and producer 50

3.6.4 Sending messages 51

3.6.5 Receiving messages 52

3.6.6 Closing the connection 53

3.6.7 Logging 53

4C++ 54

4.1 Environment setup under Linux 54

4.2 Environment setup under Windows 56

4.3 Specifying the destination (addresses) 57

4.3.1 AMQP 0-10 57

4.3.2 AMQP 1.0 58

4.3.2.1 Receiving responses to requests 58

4.3.2.2 “ReplyTo” address in requests 58

4.4 Preparing connection and session 59

4.4.1 Auto reference handling 60

4.5 Creating a receiver/sender 61

4.6 Thread safety 61

4.7 Receiving/sending messages 61

4.7.1 Preparing a request message 61

4.7.2 Sending a request message 61

4.7.3 Receiving a message 62

4.7.4 Message processing 63

4.8 Closing the connection 63

4.9 Compilation and linking on the Linux operating system 63

4.10 Compilation and linkage under the Windows operating system 64

4.11 Logging 64

4.12 Error handling 64

4.13 Performance 65

4.13.1 Receive pre-fetching 65

4.13.2 Message acknowledgement 66

4.13.3 Sender synchronization 67

5.NET 68

6Python 69

7Glossary of terms and abbreviations 70