Showing posts with label 0MQ. Show all posts
Showing posts with label 0MQ. Show all posts

Thursday, 22 March 2012

Metro Messaging

Unable to display content. Adobe Flash is required.

Here is a Metro styled client/server application that sends messages via queues:

metro-messaging-2

Queuing Frameworks

msmq

rabbitmq

zeromq

 

Other Frameworks

elysium

mvvmlight

Other Concepts

  • Real time updating Metro style Tiles as messages are received
  • Custom user control with data binding including dependency properties
  • Value converter as mark up extension (no need to reference as a resource)
  • Auto scrolling textboxes using custom attached property
  • Generics with predicates
  • MVVM Light locator, messenger, relay commands and view models
  • Metro style app with Elysium and Metro Icons (http://metro.windowswiki.info/)
  • Custom Build Event:    copy $(SolutionDir)Libs\zeromq\libzmq.dll $(TargetDir)

Deployment

You’ll need to install the server components for MSMQ and RabbitMQ before running the solution from the downloadable source below.

Source code:  http://stevenhollidge.com/blog-source-code/Messaging.zip

Wednesday, 28 September 2011

ØMQ (Zero MQ)

ZeroMQ is a socket library that allows developers to create distributed, concurrent, queue based messaging systems with high availability.  One of the many benefits is the abstraction of dealing with sockets at a queue and atomic message level.

It’s really simple to use, here is an example:

Client

namespace Client
{
using System;
using System.Text;

class Program
{
static void Main()
{
using (var ctx = new ZMQ.Context(1))
{
var socket = ctx.Socket(ZMQ.REQ);
socket.Connect("tcp://localhost:5555");

while (true)
{
socket.Send(Encoding.ASCII.GetBytes("Hello"));

byte[] message;
socket.Recv(out message);

Console.WriteLine(Encoding.ASCII.GetString(message));
}
}
}
}
}

Server

namespace Server
{
using System;
using System.Text;

class Program
{
static void Main()
{
using (var ctx = new ZMQ.Context(1))
{
var socket = ctx.Socket(ZMQ.REP);
socket.Bind("tcp://*:5555");

while (true)
{
byte[] message;
socket.Recv(out message);

Console.WriteLine(Encoding.ASCII.GetString(message));

socket.Send(Encoding.ASCII.GetBytes("World"));
}
}
}
}
}

This sample was taken from the internet but you can download a snapshot of the source here:


http://stevenhollidge.com/blog-source-code/ZeroMqDemo.zip