views:

14

answers:

2

I have a doubt regarding .net messaging & its compatibility with other open protocols out there. I would like to know if .net messaging API capable of working with STOMP protocol? How do i make use of this protocol? is there any specific library out there I need to use?

thanks for sharing your experience and ideas.

A: 

At the root of it, STOMP appears to be TCP-based messaging with its set of commands and control characters.

There's nothing in .NET that should give you any doubts about not being able to build an application or library using this protocol. If you were building a .NET STOMP library from scratch, you'd have to leverage System.Net.Sockets. Here's some sample C# code.

Byte[] bytesSent = Encoding.ASCII.GetBytes(someStringMessage);

// Create a socket connection with the specified server and port.
Socket s = ConnectSocket("192.168.0.101", somePort);

// If the socket could not get a connection, then return false.
if (s == null)
    return false;

// Send message to the destination.
s.Send(bytesSent, bytesSent.Length, 0);

// Receive the response back
int bytes = 0;
s.ReceiveTimeout = 3000;
bytes = s.Receive(bytesReceived, bytesReceived.Length, 0);
string page = Encoding.ASCII.GetString(bytesReceived, 0, bytes);
s.Close();

What doubts did you have? Perhaps edit your question with any concerns?

p.campbell
thanks for the info! so, you mean to say that .net MQ supports it and we can make use of it.. Are you aware of any existing library? Google search seems to be filled with java based MQ results.
Abdel Olakara
@Abdel: I guess what I'm saying is that you can definitely write your own, if you don't find a library. I got the sense from your question that you had doubts on whether a .NET language would support the protocol.
p.campbell
A: 

If your goal is to send messages from a .NET language, consider leveraging the Apache ActiveMQ NMS library for .NET. They claim to use a single API to connect to multiple different providers.

Currently, the following providers are available:

  • ActiveMQ which connects using OpenWire to an ActiveMQ Message Broker.
  • STOMP which connects to any STOMP Broker.

Their site linked above has the downloads, and links to articles on how to get started on the common messaging scenarios.

p.campbell
thanks! thats very useful!
Abdel Olakara
@Abdel: here's an upvote for your question!
p.campbell