Integration of the Managed Trading Service with AMQP

Similar documents
Basic DOF Security. Programmer s Guide. Version 7.0

Microservices, Messaging and Science Gateways. Review microservices for science gateways and then discuss messaging systems.

Broker Clusters. Cluster Models

Entrust Connector (econnector) Venafi Trust Protection Platform

Configuring the Oracle Network Environment. Copyright 2009, Oracle. All rights reserved.

RabbitMQ Overview. Tony Garnock-Jones

Administrator Manual. Last Updated: 15 March 2012 Manual Version:

Administrator Manual. Last Updated: 15 March 2012 Manual Version:

REST in a Nutshell: A Mini Guide for Python Developers

Digest Authentication Setup for SIP Trunks

Cluster Upgrade Procedure with Job Queue Migration.

Job Reference Guide. SLAMD Distributed Load Generation Engine. Version 1.8.1

Update 9/16/16: Version published to the ServiceNow store now supports Helsinki, Istanbul and Jakarta.

Vulnerability Scan Service. User Guide. Issue 20 Date HUAWEI TECHNOLOGIES CO., LTD.

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

SNMP Agent Setup. Simple Network Management Protocol Support. SNMP Basics

Configure the IM and Presence Service to Integrate with the Microsoft Exchange Server

Scribe Insight 6.5. Release Overview and Technical Information Version 1.0 April 7,

Amazon SES - For Great Delivery

Intellicus Cluster and Load Balancing- Linux. Version: 18.1

Batches and Commands. Overview CHAPTER

Release for Microsoft Windows

Framework 8.5. External Authentication. Reference Manual

RFC 003 Event Service October Computer Science Department October 2001 Request for Comments: 0003 Obsoletes: none.

Ubiquity Server Manual

M/s. Managing distributed workloads. Language Reference Manual. Miranda Li (mjl2206) Benjamin Hanser (bwh2124) Mengdi Lin (ml3567)

Content Services for SAP User Guide for Scanner Operators

Ericsson Mobile Organizer 5.1

Learning Objectives. Description. Your AU Expert(s) Trent Earley Behlen Mfg. Co. Shane Wemhoff Behlen Mfg. Co.

Doc Server installation

MQTT MQ TELEMETRY TRANSPORT. AN INTRODUCTION TO MQTT, A PROTOCOL FOR M2M AND IoT APPLICATIONS. Peter R. Egli INDIGOO.COM. indigoo.com. 1/33 Rev. 1.

Internet Engineering Task Force (IETF) Request for Comments: 8156 Category: Standards Track ISSN: June 2017

Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions

maxecurity Product Suite

Oracle Fail Safe. Release for Microsoft Windows E

Coveo Platform 7.0. Oracle UCM Connector Guide

BEAWebLogic Server and WebLogic Express. Programming WebLogic JNDI

Task 2: TCP Communication

COMMUNICATION IN DISTRIBUTED SYSTEMS

Libelium Cloud Hive. Technical Guide

Cisco TelePresence Conductor with Cisco Unified Communications Manager

Oracle Cloud Using the UiPath Robotic Process Automation Adapter with Oracle Integration F

Workspace ONE UEM Certificate Authentication for EAS with ADCS. VMware Workspace ONE UEM 1902

ACA Cloud Compliance Solution

PTC Integrity Integration With Microsoft Visual Studio (SDK)

Oracle Cloud Using Oracle Messaging Cloud Service

Documenting a Digital Forensic Investigation - Guide

CA Service Desk Integration with Remote Support

Distributed Systems Fall 2009 Final

IoPT Consulting, LLC 2 June 2015

ENTRUST CONNECTOR Installation and Configuration Guide Version April 21, 2017

Distributed Transaction Management 2003

User Manual. SmartLite WebQuiz SQL Edition

PREFACE. This is the reference guide for the Month-End Module for IQ Business & IQ Enterprise software systems.

Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras

Info 408 Distributed Applications Programming Exercise sheet nb. 4

CLIENT DASHBOARD. With Cloud Communication Solution (C.C.S).

SAS Event Stream Processing 5.1: Advanced Topics

Configuring Cisco Unified Presence for Integration with Microsoft Exchange Server

Check List for Programming Styleguide for S7-1200/S7-1500

[MC-SMP]: Session Multiplex Protocol. Intellectual Property Rights Notice for Open Specifications Documentation

Core Engine. R XML Specification. Version 5, February Applicable for Core Engine 1.5. Author: cappatec OG, Salzburg/Austria

Cloudiway Google Groups migration. Migrate from Google Groups to Office 365 groups

MQTT Client Driver PTC Inc. All Rights Reserved.

Finding Support Information for Platforms and Cisco IOS Software Images

Communication. Distributed Systems Santa Clara University 2016

Table of Contents 1 AQL SMS Gateway How to Guide...1

STARCOUNTER. Technical Overview

AsyncOS 11.0 API - Getting Started Guide for Security Appliances

Category: Standards Track January 1999

The Google File System

OPC XML-DA Client Driver PTC Inc. All Rights Reserved.

INFORMATION TECHNOLOGY SERVICES

Handout 20 - Quiz 2 Solutions

VMWARE VREALIZE OPERATIONS MANAGEMENT PACK FOR. MongoDB. User Guide

Comprehensive Setup Guide for TLS on ESA

Hal Documentation. Release 1.0. Dan Ryan

Architecture. Steven M. Bellovin October 31,

Getting Started with Neverfail SCOPE For

SMTP Simple Mail Transfer Protocol

Area Access Manager User Guide

User's Guide c-treeace SQL Explorer

Configuring Security Features on an External AAA Server

Terex Management System (TMS)

Routing EDIFACT Documents in Productions

About 1. Chapter 1: Getting started with odata 2. Remarks 2. Examples 2. Installation or Setup 2. Odata- The Best way to Rest 2

Lookout Mobile Endpoint Security. Deploying Lookout with BlackBerry Unified Endpoint Management

CS 351 Design of Large Programs Java and Socket Communication

Client Installation and User's Guide

Client Setup (.NET, Internet Explorer)

COPYRIGHTED MATERIAL. Using SQL. The Processing Cycle for SQL Statements

Cloud Application Integration Service

Password Reset PRO INSTALLATION GUIDE

Configuring SSL. SSL Overview CHAPTER

Module 25 TCP Timers and delayed duplicates problem in TCP

1 GENERAL. Not all changes are related to the helpdesk specifically though.

F5 BIG-IQ Centralized Management: Local Traffic & Network. Version 5.2

Read the following information carefully, before you begin an upgrade.

DISTRIBUTED COMPUTER SYSTEMS

Accessing the Ministry Secure File Delivery Service (SFDS)

Transcription:

a Integration of the Managed Trading Service with AMQP

a Version Author Date Comment 1.7.3 Aleksander Michalik 2015-10-23 replyroutingkey and correlationid features introduced: - Chapter 2.4. Message control added 1.7.4 Aleksander Michalik 3.0 Andrei Byvshev - Other affected passages altered. 2016-02-17 Acknowledgement specs updated - Routing keys - Acknowledgement-Exchange types and message descriptions 2017-03-05 - TLS connection with MTS AMQPS - correlationid naming clarified - delivery mode for message clarified - Cancelation protocol additional details

Table of Contents 1. Purpose of this document 5 2. Integration with MTS.. 5 2.1 General MTS integration principle. 5 2.2. Access information 6 2.2.1. Connection points. 6 2.2.2. Virtual host, user, password. 6 Secure connection.. 6 2.2.3. Exchanges.. 7 2.2.4. Queues 7 2.2.4.1. Queue naming convention 7 2.2.4.2. Queue naming recommendation.. 8 2.3. Currently supported message flows. 9 2.3.1. Ticket submission + Response + Acknowledgment.. 9 2.3.2. Ticket cancellation + Response 11 2.4. Message control.. 13 2.4.1. Determining the response reception Queue 13 2.4.1.1. replyroutingkey convention. 14 2.4.1.2. Recommendation 15 2.4.2. correlationid.. 15 3. Best practices & known problems. 15 3.1. Handling of connections and channels. 15 3.1.1. Channels.. 16 3.1.1.1. Thread safety. 16 3.1.2. Connections 16 3.2. Message handling 16 3.2.1. Durability and memory threat.. 16 3.2.2. Delivery guarantees 17 3.2.2.1. Consumer Acks. 17 3.2.2.2. Publisher Confirms (advanced publishing safety scenario) 18 3 P a g e

3.3. Queue handling 19 3.3.2. Queue properties 19 3.3.2.1. Recommendation 19 4. References. 20 4.1. RabbitMQ Concepts 20 4.2. AMQP client libraries (as offered on the RabbitMQ-site) 20 4.3. RabbitMQ Documentation.. 20 4.4. Tutorials. 21 4.5. Additional Notes 21 4 P a g e

1. Purpose of this document This is a specific guide, aiming at an audience knowledgeable in the programming language of their choice and preferably experienced in the application of AMQP. Therefore AMQP basics are kept short and more emphasis is put on MTS specifications. Nevertheless some general potential problematic points and/or best practices are lined out in chapter 3 still. Additionally a compilation of links to AMQP basics, such as principles and tutorials and further content is found at the end. 2. Integration with MTS 2.1 General MTS integration principle The general MTS integration is based on the message-answer principle - as in every sort of bidirectional communication. The core concept is the submission of tickets and their evaluation. A ticket represents a bet placed by the customer (the punter). The customer submits a punter s ticket information for initial evaluation, which represent the main message. He then receives the MTS answer - which can be the recommendation to that submission - means either ticket acceptance or refusal. Additionally the customer has the option to respond, informing MTS about his decision regarding the MTS recommendation. It means he has the option to submit the Info Ticket acceptance. Other messages to and replies from MTS beyond the mentioned are also thinkable and their realization partly realized or in progress. The ticket cancellation falls here under. Their status will be updated with the evolution of MTS itself. Ticket information Customer Ticket acceptance or refusal Info Ticket acceptance MTS Other messages Other responses Fig. 3.1.: General principle of the MTS integration 5 P a g e

2.2. Access information 2.2.1. Connection points - Client integration environment Address integration-mts.betradar.com [91.201.213.134] Port 5672 Secure connection port 5671 - Production environment Address tradinggate.betradar.com [91.201.212.86] Port 5672 Secure connection port 5671 2.2.2. Virtual host, user, password Please contact your Betradar MTS-integration manager for your username and password. As a convention, this username is used in the virtual host s name as well as in your designated Exchanges and Queues. The virtual host s name is then simply /username (a slash followed by the username). Secure connection When establishing a TLS connection with MTS AMQPS service you will get a *.betradar.com wildcard x.509 certificate which was signed by a trustworthy CA - Entrust. That means you should connect to the hostname tradinggate.betradar.com on port 5671. Machines usually come with that CA included in the trust store so verification of the chain should succeed without any intervention on client's side. Of course it is still in your domain to do the proper action (e.g., disconnect) when validation fails. We don't employ client certificates for authentication but there is a IP whitelist in place to ensure only authorized clients are able to connect. You can expect such metadata in the cert: subject=/c=ch/l=st.gallen/o=/cn=*.betradar.com issuer=/c=us/o=entrust, Inc./OU=See www.entrust.net/legal-terms/ou=(c) 2012 Entrust, Inc. You can also use certificate pinning, but please be advised the validity period of the wildcard certificate is relatively short (1 year). 6 P a g e

2.2.3. Exchanges Exchange name Purpose Type Access/ Options Description username-submit submit ticket information fanout write sending the ticket username- Control submit control messages topic write f.eg. cancel ticket username- Confirm receive ticket acceptance or refusal topic read accept/refuse recommendation username-reply receive control messages reply topic read f.eg. accept/refuse cancellation request username-ack submit - info ticket acceptance and - info ticket cancellation acceptance topic Write - customer feedback to MTS ticket acceptance/refusal recommendation and - customer feedback to MTS cancellation acceptance/refusal Exchanges are durable and are provided and maintained by MTS. You only have to know to which one you have to publish a respective message and to which one you will have to bind your Queue before consuming messages (see following chapters). 2.2.4. Queues Queue name Type Purpose Description username-(submit Confirm Ack Control Reply)* any Queue consume any message see subchapter 3.3. You are obliged to declare, bind, consume from and to maintain the Queues of your custom needs (see chapter 3.3.). 2.2.4.1. Queue naming convention Therefor you have the right to instantiate any AMQP-entity within your vhost that follows the following naming-pattern: username-(submit Confirm Ack Control Reply)* your username followed by a dash followed by one of the (or) separated strings within the brackets followed by any valid 7 P a g e

string. According to the RabbitMQ documentation a valid string here can be empty, or a sequence of these characters: letters, digits, hyphen, underscore, period, or colon. For convenience reasons this is the same permission range as is granted to you regarding the entity-names from which you are allowed to read. However, currently, if it comes to creating named entities within your vhost, you only need to regard Queues. These Queues that you have to create you are required then to either bind to your Confirm or Reply - Exchange (see chapter 2.2.3. or 2.3.). 2.2.4.2. Queue naming recommendation Therefore we recommend you to name your Queues respective of the Exchange you want to bind them to: - username-confirm-nodex, if you intend to bind this Queue to your Confirm-Exchange - username-reply-nodex, if you intend to bind this Queue to your Reply-Exchange Here username-reply- and username-control- are strings whereas nodex represents the id you dedicate internally on your side to the client-node within your cluster that you wish to receive the MTS response on (typically the one you send the related message to MTS in the first place with), of which the X stands for an integer. (see chapter 2.4.1.) In the end you are of course, free to disregard this recommendation and name your Queue the way you like as long as you follow the earlier mentioned naming-convention. 8 P a g e

2.3. Currently supported message flows 2.3.1. Ticket submission + Response + Acknowledgment 1.) Create Queue User user: declares 2.) Bind Queue User 3.) Ticket submission -> User Queue username-confirm-nodex Queue username-confirm-nodex User: publishes ticket info header replyroutingkey: nodex.ticket.confirm (see chapter 2.4.1.) Recommended naming-pattern in the case of a Queue intended for binding to your Confirm-Exchange! nodex represents here an id referring to the client-node on the user side, where X is could stand for integer for instance (see chapter 2.4.1.) user: binds binding-key: nodex.ticket.confirm (see chapter 2.4.1.) Exchange username-confirm Exchange username-submit MTS: processes ticket info 4.) <- Response User User: consumes MTS response: ticket acceptance or refusal Queue username-confirm-nodex Exchange: sends out MTS response: ticket acceptance or refusal MTS: provides MTS response: ticket acceptance or refusal Exchange username-confirm 5.) Acknowledgement -> (distinguish from consumer acks in chapter 3.2.2.!) User User: publishes Info ticket acceptance routing-key: ack.ticket Exchange username-ack 9 P a g e

1.) The user declares a Queue named username-confirm-nodex his username followed by a dash followed by the string Confirm followed by a string (in place of -nodex ). Note: Queue names have to be unique within one vhost! Thus we recommend that nodex represents an id referring to the client-node on the customer side he wishes to receive the respective MTS response on. If the recommendation of chapter 2.2.4.2. is followed, the Queue names are going to be strings like mymtsusername-confirm-node1, mymtsusername-confirm-node2, mymtsusername-confirm-node3, or deviating strings, if the recommendation is disregarded deliberately, but strings that are within the range that is lined out by the Queue naming-convention of chapter 2.4.2.1. Also see chapter chapter 2.4.1. 2.) The user binds his Queue to the Exchange named username-confirm his username followed by a dash followed by the string Confirm. Here he applies a binding-key that equals the message header replyroutingkey described in the Note of point 3 below. 3.) Then he can publish his ticket (ticket info) to the Exchange named username- Submit his username followed by a dash followed by the string Submit. NB!: Submitted tickets (ticket info or JSON object) require a message header named replyroutingkey whose value, a non-empty valid string, will be used to route the respective MTS response (ticket acceptance or refusal) to the Queue that was bound with the same binding-key value. Also see chapter chapter 2.4.1. 4.) As soon as the MTS response (ticket acceptance or refusal) arrives in the Queue the user can consume it. 5.) The user informs MTS if the recommendation contained in the MTS response (to accept or refuse the ticket) was followed on his side or not. Therefore he publishes his responseacknowledgement (info ticket acceptance) to the Exchange called username-ack his username followed by a dash followed by the string Ack. Info ticket acceptance messages have to be sent with the routing-key ack.ticket. Note: Don t confuse these acknowledgements with the consumer acks as described in chapter 3.2.2.! 10 P a g e

2.3.2. Ticket cancellation + Response 1.) Create Queue User user: declares 2.) Bind Queue User Queue username- Reply-nodeX Queue username- Reply-nodeX Recommended naming-pattern in the case of a Queue intended for binding to your Reply-Exchange! nodex represents here an id referring to the client-node on the user side, where X is could stand for an integer for instance (see chapter 2.4.1.) user: binds binding-key: nodex.cancel.confirm (see chapter 2.4.1.) Exchange username-reply 3.) Cancellation request -> User: publishes User ticket cancellation request - routing-key: cancel - header replyroutingkey: nodex.cancel.confirm (see chapter 2.4.1.) Exchange username-control MTS: processes ticket cancellation request 4.) <- Response User User: consumes MTS response: ticket cancellation acceptance or refusal Queue username- Reply-nodeX Exchange: sends out MTS response: ticket cancellation acceptance or refusal MTS: provides ticket cancellation request acceptance or refusal Exchange username-reply 5.) Acknowledgement -> (distinguish from consumer acks in chapter 3.2.2.!) User: publishes Info ticket cancellation User acceptance routing-key: ack.cancel Exchange username-ack 11 P a g e

Preface: Messages regarding a ticket cancellation flow in both directions via Exchanges of the type topic. Therefore a.) A meaningful routing-key and binding-key (for response queues) are required. Since the topic is the cancellation of tickets the simple string cancel is used as routing key for messages towards MTS concerning this topic. This means MTS binds its internal Queues with a binding-key to listen for cancellation request messages incoming with a routing-key cancel. b.) However cancellation requests require a message header (exactly as ticket submissions do, see chapter 2.3.1.) which equals the binding-key of the targeted Queue of response - in addition to a routing-key. Also see chapter chapter 2.4.1. 1.) The user declares a Queue named username-reply-nodex his username followed by a dash followed by the string Reply followed by a dash followed by a string (in place of -nodex ). Note: Queue names have to be unique within one vhost! Thus we recommend that nodex represents an id referring to the client-node on the customer side he wishes to receive the respective MTS response on. If the recommendation of chapter 2.2.4.2. is followed, the Queue names are going to be strings like mymtsusername-reply-node1, mymtsusername-reply-node2, mymtsusername-reply-node3, or deviating strings, if the recommendation is disregarded deliberately, but strings that are within the range that is lined out by the Queue naming-convention of chapter 2.4.2.1. Also see chapter chapter 2.4.1. 2.) The user binds his Queue to the Exchange named username-reply his username followed by a dash followed by the string Reply. While binding he applies a binding-key that equals the value of the message header replyroutingkey as described in the Note of point 3 below. 3.) Then he can publish his ticket cancellation request to the Exchange named username- Control his username followed by a dash followed by the string Submit. He publishes these requests with the routing-key cancel. Note: Ticket cancellation requests (ticket infos) additionally require a message header named replyroutingkey whose value, a non-empty valid string, will be used to route the respective MTS response (ticket cancellation acceptance or refusal) to the Queue that was bound with the same binding-key value. Also see chapter chapter 2.4.1. Note2: Cancelation messages are processed in asynchronous way. MTS will generally process cancellations at the time of their arrival but there might be cases where response will be delayed for a couple of seconds or even minutes. MTS still makes guarantee that a cancellation request will eventually be processed, but you are allowed to re-send a cancellation only once after a timeout period of 1 minute. This operation is idempotent. 4.) As soon as the MTS response (ticket acceptance or refusal) arrives in the Queue the user can consume it. 5.) The user informs MTS if the recommendation within the MTS response (to cancel the ticket or not) was followed on his side or not. Therefore he publishes his response- 12 P a g e

acknowledgement (info ticket cancellation acceptance) to the Exchange called username- Ack his username followed by a dash followed by the string Ack.Info ticket cancellation acceptance messages have to be sent with the routing-key ack.cancel. Note: Don t confuse these acknowledgements with the consumer acks as described in chapter 3.2.2. 2.4. Message control 2.4.1. Determining the response reception Queue The user is required to communicate to MTS to which Queue he wants each of the MTS responses to each of his messages, be it ticket submissions or cancellation requests, routed to. This information comes in handy for sorting the responses in single node client environments on the customer side. However it is a necessary requirement for clustered client environments, where multiple nodes work independently of each other and the MTS customer has no possibility to match the outgoing messages with the incoming MTS responses on all nodes. In other words, without you predetermining the route for the response from MTS in your message towards MTS, we can t guarantee that the response will be relayed to a Queue on the particular node that the message was initially sent on. 13 P a g e

clientnoden clientnodey clientnodex client- Node0 response1 message2 response2 message1 a) response1 Queue response2 Queue Confirm or Reply- Exchange Submit or Control-Exchange clientnoden clientnodey clientnodex client- Node0 b) response2 routing-key: Y Queue binding-key: Y response2 routing-key: Y message2 header:: replyroutingkey: Y response1 routing-key: X response1 routing-key: X Queue binding-key: X message1 header:: replyroutingkey: X Confirm or Reply- Exchange Submit or Control-Exchange Fig 2.4.: a) Without predetermining the reply target in advance the MTS response might be sent to a different node its corresponding message was originally sent from. You determine the response route via a message header field of the name replyroutingkey b) Specifying the reply target in advance works via the field replyroutingkey, which you set in the header of your message towards MTS. The corresponding your ticket MTS submissions response will be and sent cancellation with a routing requests. key equaling your replyroutingkey value to your Exchange of response. If you happen to have a Queue bound with the same binding-key value, the response will be relayed there successfully. 2.4.1.1. replyroutingkey convention The value of this header field must contain any valid non-empty string as a prerequisite for a successful response relay. However, it must match at least one binding-key of at least one Queue you bound to the respective Exchange of reply in order to be eventually relayed to you, since this value will be used as the routing-key for the MTS responses. Note: If you don t set a valid replyroutingkey for tickets, it will be set by MTS automatically to the string not_set. 14 P a g e

If you don t set a valid replyroutingkey for cancellation requests it will be set by MTS automatically to the string cancel. 2.4.1.2. Recommendation We recommend the following values if it comes to the replyroutingkeys and the matching binding-keys for your Queues (for Queue naming recommendations see chapter 2.2.4.2): message-type ticket (info) cancellation request replyroutingkey & Queue binding-key nodex.ticket.confirm nodex.cancel.confirm For simplicity reasons we recommend to use node as a literal string and a cluster-unique character representing an integer (optimally starting with 1 and incrementing by 1 within your cluster: node1, node2, node3) in place of X. 2.4.2. correlationid For identifying which MTS response corresponds to which message sent initially by you towards MTS we offer a more convenient option, apart from a tedious parsing of the message payload in order to then compare the ticket-id. A more convenient and efficient way is having you set the message property field correlation_id. Its value will be found then on the corresponding MTS responses in their header field of the same name. Note: There is sometimes confusion in regards to naming of this field correlation_id vs correlationid: correlationid is something you will find among used AMQP library methods during message publishing. correlation_id is actual field name that is sent. 3. Best practices & known problems 3.1. Handling of connections and channels Connections are TCP based and require authentication. You normally establish it by the means of your AMQP API to MTS RabbitMQ cluster, that contains your targeted vhost while logging into it with your credentials (username/password see chapter 2.2.2.). 15 P a g e

3.1.1. Channels Channels and their creation are lightweight. Thus many channels / connection shouldn t be problematic. So feel free to segregate the message flow by using separate channels. It is even recommended to use separate channels for publishing and consuming in any case! When not used anymore channels should be closed, though fewer long-lasting channels seem preferable instead of a constant opening and closing of channels. 3.1.1.1. Thread safety Neither the Java-client nor the.net-client channels are considered ultimately thread safe. Thus it is recommended to use one channel / thread. http://www.rabbitmq.com/api-guide.html#channel-threads http://www.rabbitmq.com/dotnet-api-guide.html#model-sharing These and other best practices regarding channels can be found here: https://dzone.com/articles/rabbitmq-amqp-channel-best 3.1.2. Connections Generally goes the fewer connections you establish the better. If your system topology or internal processes don t require multiple or alternating connections, just open one connection and keep it up as long a particular messaging flow is ongoing. As soon as one can regard a particular message flow done for a reasonable time though you should close that particular connection. In fact, if for any reason you should decide to abandon a connection you have to close it respectively! However, one long-lasting connection at a time appears to be desirable. Server customer Gate server RabbitMQ MTS Client Connection Thread 1: publishing channel s Thread 2: consuming channel s vhost 3.2. Message handling 3.2.1. Durability and memory threat Durable messages pose a potential memory threat to the broker. Therefore in high message load systems, such as MTS, none of the messages may be durable within RabbitMQ. Fig 3.1.: Your needs might deviate in number of connections and especially channels from this line-out. However this line-up represents the desired minimum configuration of connections and channels at a time. Since RabbitMQ is not a DB your messages to MTS will be safely stored somewhere else anyhow. Thus we strongly discourage you to set the durability parameter of your messages to 16 P a g e

true. In any case, MTS has mechanisms in place in order to counteract the durability of customer messages. This above means delivery mode for message itself must be set to 1. If it comes to responses from MTS - we strongly encourage you to consume all your responses from your Queue on time. Not consumed responses pose, again, a potential memory threat. 3.2.2. Delivery guarantees There is of course no ultimate delivery guarantee. However, in order to improve the existing mechanisms it is recommended to confirm / acknowledge sent messages. After having consumed MTS responses from a Queue you should confirm that you have received those messages via basic acknowledgements. We recommend to send these acknowledgements in any scenario. In the other direction, if it comes to get confirmations for your published messages the application of publisher confirms is thinkable (see chapter 3.2.2.2.). 3.2.2.1. Consumer Acks We recommend you to send us acknowledgements after you have intentionally consumed them, as opposed to sending automatic acknowledgements or not sending any acknowledgements at all (don t confuse these acks with the acknowledgements as described in chapter 2.3.!). This you can achieve by a call of the basic.ack -method of the channel. However, as it is generally a good practice to minimize the frequency of networkcalls, it is recommended to send them in reasonable intervals, after having consumed a batch of MTS responses. Note that in order to make sense of intentional acknowledgements you should set the autoack -parameter in your basicconsume -method call to false. Note further that the channel you dedicate to consuming messages should stay transactional, since Acknowledgements have to be sent via the same channel as the respective message they were consumed from and since the transactional mode is the one Acknowledgements operate in. 17 P a g e

3.2.2.2. Publisher Confirms (advanced publishing safety scenario) In an advanced scenario, when a heightened publishing safety is required, it is advised to make use of publisher confirms: https://www.rabbitmq.com/confirms.html. It is a good practice to either: 1) send messages in batches and then to wait for respective publisher confirms, or 2) handle confirms asynchronously. advanced scenario batch 0, size: n batch 0, size: n 1. r0 r1 rn-2 rn-1 1. m0 m1 mn-2 mn-1 2. acknolwedgement Thread 1: publishing channel 2. confirm Thread 1: publishing channel, confirm mode Time 1. 2. batch 1, size: n r0 r1 rn-2 rn-1 acknolwedgement Thread 2: consuming channel, transactional mode MTS 1. 2. batch 1, size: n m0 m1 mn-2 mn-1 Thread 2: consuming channel, transactional mode confirm MTS Fig 3.2.2.: or Left: It is recommended that you acknowledge consumed responses. In order to minimize the number of network calls you should consume the MTS-responses in batches of a reasonable size and then acknowledge the consumption. Note that therefore the consuming channel ought to remain in transactional mode, since acknowledgements operate in this mode and you have to send them on the same channel as you consumed your MTS-responses. Right - Advanced scenario: In a scenario where increased delivery safety is required you might employ confirms, by putting your publishing channel into confirm mode. You then either send your messages in batches and wait for the confirmation for the entire batch to arrive on the publishing channel (top graphics) - or - you send your messages asynchronously to the consumption of the confirms (bottom graphics). message 117 message 116 confirm 96 confirm 95 Thread 1: publishing channel, confirm mode message message message 115 114 113 confirm 97 Thread 2: consuming channel, transactional mode message 111 message 112 confirm 98 confirm 99 MTS 18 P a g e

3.3. Queue handling Since the Queues shall reflect your very custom system topology of servers, clients, connections and channels down to the Queue-number and -distribution of your need, it is up to you to declare and bind the Queues you intend to consume messages from. Therefore you should get familiar with Queue properties and their meaning. 3.3.2. Queue properties There is a comprehensive list of Queue properties, as well as domains in general found in the General AMQP reference on the RabbitMQ-site -> section Queue -> method-section declare. There the relevant Queue property information can be found. 3.3.2.1. Recommendation We recommend you the following settings for the Queue-parameters: parameter recommended comment value durable set (true) If you do not want to re-declare the Queues in case of an unexpected connection loss (e.g. a broker restart on our side) you might want to persist them to the disk, which would let them survive a broker restart. This is achieved by declaring them durable. auto-delete unset (false) Auto-delete = true would mean that the Queue gets deleted when the last consumer unsubscribes. That would contradict the purpose of having durable Queues. Thus auto-delete = false. exclusive unset (false) Setting this parameter would make a Queue exclusive to the connection it was declared within. Since connections are not durable you can t have durable Queues exclusive to a connection. Thus exclusive = false. passive unset (false) A passive declaration serves only the purpose to invoke a Declare-OK response, if a Queue of that name already exists within the vhost, or a channel exception if not. Usually used only to verify the existence of a specific Queue since this declaration doesn t create a Queue on the server. Thus passive = false. no-wait unset (false) You might want to wait for a server response to make sure your Queue was created (or found). Therefore nowait = false. arguments unset (null) Not expected. 19 P a g e

4. References The collection of the references here makes for a basic guide. It is in no way exhaustive, especially if it comes to links concerning particular programming languages. You are hereby encouraged to do your own research! 4.1. RabbitMQ Concepts https://www.rabbitmq.com/tutorials/amqp-concepts.html 4.2. AMQP client libraries (as offered on the RabbitMQ-site) General download site: https://www.rabbitmq.com/download.html (Note that for the MTS integration with RabbitMQ no server setup on the your side is required) - Java: https://www.rabbitmq.com/java-client.html -.NET: https://www.rabbitmq.com/dotnet.html - PHP: https://github.com/videlalvaro/php-amqplib 4.3. RabbitMQ Documentation General site: https://www.rabbitmq.com/documentation.html - Java: https://www.rabbitmq.com/documentation.html -.NET: https://www.rabbitmq.com/releases/rabbitmq-dotnet-client/v3.4.3/rabbitmq-dotnet-client- 3.4.3-client-htmldoc/html/index.html - PHP: http://de.slideshare.net/old_sound/integrating-php-withrabbitmqzendcon (Introduction to RabbitMQ with PHP s Zend framework) 20 P a g e

4.4. Tutorials General site: https://www.rabbitmq.com/getstarted.html General AMQP reference: https://www.rabbitmq.com/amqp-0-9-1-reference.html Quick reference Guide: https://www.rabbitmq.com/amqp-0-9-1-quickref.html - Java: A comprehensive guide starting with lesson one: https://www.rabbitmq.com/tutorials/tutorial-one-java.html Master tree: https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/java -.NET: A comprehensive guide starting with lesson one: https://www.rabbitmq.com/tutorials/tutorial-one-dotnet.html Master tree: https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/dotnet - PHP: A comprehensive guide starting with lesson one: https://www.rabbitmq.com/tutorials/tutorial-one-php.html 4.5. Additional Notes If you want to use the PHP libraries offered here without in-depth knowledge of their abstraction structure - a PHP dependency manager (autoloader) is recommended, due to the abstraction level found in the respective libraries. Here a link to the common manager used also in the official tutorials: https://getcomposer.org/ Nevertheless, feel free to use a PHP dependency managing tool (and generally the AMQP PHP client library ) of your choice. You can find support for languages not covered in this document and in general all sorts of links and resources here: https://www.rabbitmq.com/devtools.html. 21 P a g e