Monday, November 05, 2012

ZeroMQ via C#: Introduction

Introduction   

ZeroMQ (also spelled ØMQ, 0MQ or ZMQ) is a very lightweight message queuing open source software. It doesn't have a stand-alone server; messages are sent directly from application to application. It is very simple to learn and implement. It is composed of one single library called libzmq.dll written in c++ that can be linked to any application. To use it in the .Net environment we need a wrapper for this library which is called clrzmq.dll written in C#.

ZeroMQ can be run on Windows, OS X, and Linux. Several languages can be used to implement applications using ZeroMQ including C, C++, C#, Java, Python… This gives the ability to communicate with different applications on different platforms. 

The heart of ZeroMq 

The main part of ZeroMQ is the socket. It's not the traditional socket, but it's a socket that provides a layer of abstraction on top of the traditional socket API, which frees us from the complexity and the repeated tasks that we do in our applications. ZeroMQ supports several types of sockets (the type of the socket is defined as an attribute value in the socket itself). The different combinations of socket types in the sending and receiving ends give us different communication patterns that we will explore some of them in this article.  

Asynchronous Communication 

The communications done by ZeroMQ are done in an asynchronous way. That means our application will not be blocked during setting up or closing the socket connection, re-connection and message delivery. These operations are managed by ZeroMQ tself in background threads and in parallel to the regular processing done by our application. It queues messages (either at sender or receiver side) automatically when needed. It does this intelligently, pushing messages as close as possible to the receiver before queuing them. 

Read more: Codeproject
QR: Inline image 1

Posted via email from Jasper-Net