RSS

Tag Archives: tutorials

Using RabbitMQ in C# (III) Consuming messages from RabbitMQ


It can be found that In earlier posts, setup RabbitMQ and sending messages are a piece of cake using RabbitMQ C# client. Let’s take a further step and see how to consume messages from RabbitMQ.

Create a console application, and add below code:

public static void Main()
{
        var factory = new ConnectionFactory() { HostName = "…" };
        using (var connection = factory.CreateConnection())
        {
            using (var channel = connection.CreateModel())
            {
//Assuming you have a queue named “whatever” created already
var consumer = new EventingBasicConsumer(channel); consumer.Received += (model, ea) => { var body = ea.Body; var message = Encoding.Default.GetString(body); Console.WriteLine(" [x] Received {0}", message); }; channel.BasicConsume("whatever", true, consumer); Console.WriteLine(" Press [enter] to exit."); Console.ReadLine(); } } }

That is it! Simple?

 
Leave a comment

Posted by on August 17, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , , , , , , , , ,

Using RabbitMQ in C# (II) Sending message to RabbitMQ


Create a Winform application, add below UI to the form:

image

Read the rest of this entry »

 
1 Comment

Posted by on August 13, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , , , , ,

Using RabbitMQ in C# (I) Installation of RabbitMQ


image image

 

  • Select the server software on the desired platform and download the setup package. In this example, I will use windows installer.
  • Run the windows installer, and you will be prompted to install Erlang, follow the links and download install Erlang:

image

image image

Read the rest of this entry »

 
2 Comments

Posted by on August 13, 2015 in Dotnet/C#, Programming

 

Tags: , , , , , , , , ,

Install Genymotion In Ubuntu


Genymotion is a great virtual machine, especially for emulating Android VMs.

In my earlier post, I have shown how to emulate Nexus 10 using Genymotion.

image

Recently, I need to do the same work in Ubunut, and found this post very useful to guide me in installation of Genymotion in Ubuntu. Below is from the post by Gregory Schier:

Read the rest of this entry »

 
1 Comment

Posted by on May 29, 2014 in Android, Linux, Programming

 

Tags: , , , , , , , , , , , , ,

Android tab control: the new way


Android SDK now deprecated TabActivity, as you can see the strike through symbol in previous post. Using the new Android SDK, it is preferred to use Fragment instead, and it is also pretty easy.

  • Create a new android project in Eclipse
  • Create two (as many as you like) activities Fragments in Eclipse:
    > Right click the Package Exporer, New > Other, or press Ctrl + N;
    > Select Android layout, name it fragment_tabpage1 and fragment_tabpage2


    image

Read the rest of this entry »

 
Leave a comment

Posted by on July 29, 2013 in Android, Programming

 

Tags: , , ,