<BGSOUND src="images/profondorosso.mid">

MQ4CPP

Message Queuing for C++

Home


CV in english

CV in italian


Photoalbum

Favorite links

Download

64bit corner


True3D*Shell

3D hand study

3D Depth sort

Raddy project

MQ4CPP project


The gateway

Overview

MQ4CPP, or "Message Queuing for C++", is an open source implementation of enterprise messaging system, also referred to as message-oriented middleware (MOM).

MQ4CPP enables C++ application threads to communicate with other threads locally or remotely through the exchange of messages. A message is a request, report, and/or event that contains information needed to coordinate communication between different applications. A message provides a level of abstraction, allowing you to separate the details about the destination system from the application code.

Specifically, MQ4CPP:

  •  enables C++ applications sharing a messaging system to exchange messages
  •  simplifies application development by providing a standard interface for creating, sending, and receiving messages.

 

MQ4CPP allows to build clusterized services. A cluster consists of multiple server instances running simultaneously and working together to provide increased scalability and reliability. The server instances that constitute a cluster can run on the same machine, or be located on different machines. Each server instance contains a session repository of properties (a property represents a state of the service). A session can be replicated on multiple server istance to protect service state. If a server instance on which a service is running fails, another server instance on which that service is deployed can continue application processing. Session replication and service failover work also on heterogeneous platforms.

 

MQ4CPP implements the following messaging paradigms:

  •  direct/indirect messaging
  •  unsolicited messaging
  •  request/reply
    •  reliable messaging
    •  automatic reconnection
    •  connection failover on multiple server
  •  conversation
  •  broadcast
  •  publish/subscribe
  •  store&forward

MQ4CPP implements also the following services:

  •  advanced tracing for multi-threading debugging
    •  output on stdout
    •  Microsoft DDK WinDbg debugger
  •  thread safe garbage collector.
  •  performant implementation of LinkedList and Vector patterns.
  •  timer (single shot, self-repeating).
  •  thread safe logger.
  •  deferred queuing to avoid thread locks or infinite looping.
  •  lookup service:
    •  local services
    •  remote services
  •  local and remote threads referenced by handle.
  •  automatic clean-up of network connections.
  •  socket transmission:
    •  reuse of same connections
    •  statistical multiplexing.
    •  packets limited to 65 Kbytes to avoid buffer overflows.
    •  packets associated to a sequence number.
  •  session management:
    •  session repository of properties
    •  session replication between multiple server instances
  •  inflight message encryption:
    •  Rijndael 128
    •  Rijndael 256
    •  ready for more
  • inflight message compression:
    •  lossless data compression 
    •  dictionary coder with caching
  • complex messages (like XML but in binary format)

As implementation of Request/Reply paradigm, MQ4CPP include also:

  •  Distributed lock manager to allow multiple threads share any resources
  •  File transfer to transfer files between threads
  •  Memory channel to transfer big ammount of memory (for example a cache) between threads.

MQ4CPP allows to build your client-server or peer-to-peer application using C++ language and inheriting and extending its toolkit classes.

 

MQ4CPP allows also to build your high-perfomance computing (HPC) application, helping you to break a data crunching algorithm in several threads and deploying it on several server.

 

MQ4CPP is compiled and tested on the following platforms:

  •  Windows 2000 (x86)
  •  Windows XP (x86)
  •  Windows 2003 Enterprise Server SP1 (SMP Itanium2)
  •  Linux Red Hat ES 3.0 (x86 - kernel 2.4.21)
  •  Linux SuSE SLES 8 (SMP Itanium2 - kernel 2.4.21)
  •  Linux Red Hat ES 3.0 (SMP Itanium2 - kernel 2.4.21)
  •  Linux Red Hat EL 4.0 (SMP Itanium2 - kernel 2.6.9)
  •  Linux OpenSuse 10.1 (x86 - kernel 2.6.16.13)

MQ4CPP has been successifully compiled also on Debian and FreeBSD.


Development tools

To develop this project I have used the following free tools:

Java SDK 1.4.2: to run Eclipse

Eclipse 3.0: for visual editing.

Eclipse CDT 2.0 plug-in: for C and C++ editing.

Microsoft Visual C++ Express 2005: include Intel x86 compiler, linker and standard C and C++ libraries.

Microsoft Platform SDK (Core SDK only): include Intel Itanium2 compiler and Windows SDK libraries.


Download

MQ4CPP is licensed under the GNU Lesser General Public License. This means that all source code, tools and documentation is available free of charge for any purpose.

The main constraints of the LGPL license:

  •  Modifications of MQ4CPP should be made publically available.
  •  Make the MQ4CPP available as source with copyrights intact.
  •  Clearly document customisations, modifications or changes to MQ4CPP.

Disclaimer

No warranty or responsibility in relation to the suitability, functionality, reliability or robustness of the software. This software is under constant revision, with changes likely to some parts of application or API. All reasonable efforts are made to supply the software without known defects or exploits, however no responsibility can be accepted by the authors.


Release

Source archive

Release notes

1.0

Implementation of direct/indirect messaging, unsolicited messaging,
request/reply, conversation, broadcast, local and remote lookup.

1.1

This version implements a reliable request/reply messaging with automatic reconnection and connection failover on multiple server instances using round-robin algorithm. See example7.cpp to learn how implement a client failover.

1.2

This version implements a complete clustering for Request/Reply services. See example8.cpp to learn how implement a cluster.

1.3

This version fix a bug on session management and add message encryption using Rijndael 128/256 algorithm (source: mcrypt).

1.4

Some bugs due to multithreading conflicts are fixed. Trace is now integrated with MS DDK WinDbg. Current version is composed by 48 C++ classes and about 5700 lines of code (examples excluded).

1.5

This version fix several bugs (threads dead locks) and implements publish/subscribe paradigm. See example9 to learn how to implement it.

1.6

This version implements Store&Forward paradigm. See example10 to learn how to implement it.

1.7

Improvements to support True3D*Shell project.

1.8

The multithreading synchronization was redesigned to support SMP on x86 and IA64 on Windows Server. This release uses CriticalSection instead of CreateMutex/WaitForSingleObject. Thread queues and vectors use InterlockedExchange to enforce SMP cache coherency. An '-MT' switch has been added to the makefile to link the C multithreaded run-time library (LIBCMT.LIB). I added example11 to explain how send complex messages (like XML but in binary format).

1.9
This version implements Lock Manager, File transfer and Memory channel.
1.10

Maintenance release.

 

1.11
Maintenance release and bug fixes. Now it is supported the compiler Microsoft Visual C++ 2005 Express Edition. See README to setup your DOS environment.
1.12

Maintenance release.

 

1.13
Fixed a performance problem during transmition in MessageProxy module and a bad deallocation of tx message in RequestReply module. This version include a new compression algorithm and a benchmark application to test MQ4CPP performances on your platform.
1.14

This version implements message routing. The benchmark application has been modified to support local and remote message routing.

Thank to Janos Soos now MQ4CPP has a new version '.bz2' compatible with libtool. Extract the file with 'bunzip2', run './configure' and 'make' to compile all.

1.15

mq4cpp_v1.15.zip

mq4cpp-1.15.tar.bz2

This version improves message switching and fixes some bugs.
1.16

mq4cpp_v1.16.zip

mq4cpp-1.16.tar.bz2

This version includes some patches for FreeBSD compatibility.

 

Please report any problem or request of support sending an e-mail here.