Discuss this help topic in MsgConnect Forum

Getting Started

This section contains step by step instructions about how to start using MsgConnect in your application:

  1. First of all you need to understand the ideology of MsgConnect, i.e. its message-oriented nature.
  2. MsgConnect is a transport, that can be used as a backend for application-level protocols. Even if you send only one message and don't get replies, this is also a protocol (although very simple). So you need to design a protocol. Of course, you can leave this step for future, when your application is built.
  3. Now it's time to add MsgConnect to your application. First step is to add an instance of Messenger class.
  4. Once the messenger is added, it is desirable to add an instance of Queue class and link it to Messenger using Queue.Messenger property. Queue is a way for your application to receive messages, that were sent. It is like a "post box" to which messages are sent.
  5. If you want to process all messages for the queue in one routine, you need to set a handler for Queue.OnUnhandledMessage event. The alternative is to add one or more MessageHandler objects using Handlers.Add method (the reference to Handlers object can be obtained from Queue instance using Queue's Handlers property) and set a handler for Handler.OnMessage event.
  6. Now you need to add one or more transport. Transport is what will deliver your messages to recipients. MsgConnect offers several transport classes with more transports to be added later. Transport should be linked to Messenger using BaseTransport.Messenger property.
  7. (Optional) If you need to encrypt, sign or compress your data, you can add one or more transformers. Transformers are available only under MsgConnect Commercial License. To link transformer to messenger you need to use transformer's Messenger property.

That's all you need to have MsgConnect working for you.
Now you need to send and receive a message.

Sending a message is done via one of the following methods:

If you've created a Queue object, messages are dispatched via Queue and Handler objects. All you will need is to call Messenger.DispatchMessages method periodically to let messenger call proper event handlers.
There is another option to receive messages -- via Messenger.GetMessage and Messenger.PeekMessage methods. If you use these methods to get the message from the message queue, you will need to call Messenger.MessageProcessed method when the message is processed, so that messenger can send a result and dispose of message data.

There are several schemes available if you want to see graphic representation of MsgConnect. First of them is a high-level representation of MsgConnect and its place in your application. Second one, General Scheme shows relationships between classes in MsgConnect. Third, Delivery Scheme, describes a process of message delivery using SendMessage function.

Discuss this help topic in MsgConnect Forum