/// <summary>
        /// Send message. Recipient resolved by the object type.
        /// </summary>
        public void Send(params object[] messages)
        {
            // Skip if there is no messages
            if (messages == null || messages.Length < 1)
            {
                return;
            }

            // Create transport message
            var serviceBusMessage =
                new ServiceBusMessage(messages)
            {
                SentFromQueueName = _inputTransportEndpointAddress.GetFriendlyName()
            };

            // Get list of endpoints we need send message to
            var endpoints = _endpointMapping.GetEndpoints(messages[0].GetType());

            foreach (var endpoint in endpoints)
            {
                // Create EndpointMessage from TransportMessage
                var provider         = TransportRegistry.GetQueueProvider(endpoint.Address);
                var transportMessage = provider.TranslateToTransportMessage(serviceBusMessage);

                // Send message
                var queue = provider.OpenEndpoint(endpoint.Address);
                queue.Send(transportMessage);
            }
        }
        /// <summary>
        /// Run service bus and start input endpoint observing
        /// </summary>
        public void Run()
        {
            // Registration of endpoints
            foreach (var endpoint in _endpointMapping.Endpoints)
            {
                if (TransportRegistry.GetQueueProvider(endpoint.Address) == null)
                {
                    TransportRegistry.Register(endpoint.Address, endpoint.Transport ?? _provider);
                }
            }

            // Check existence of input and error endpoint and create them if needed
            PrepareQueues();

            // Create dispatcher
            _dispatcher = new Dispatcher(_configuration.DispatcherConfiguration);

            // Open error queue
            _errorTransportEndpoint = _provider.OpenEndpoint(_errorTransportEndpointAddress);

            // Create and configure observer of input queue
            _transportEndpointObserver = _provider.CreateObserver(_inputTransportEndpointAddress);
            _transportEndpointObserver.MessageReceived += EndpointObserverMessageReceived;
            _transportEndpointObserver.Start();

            // Set servise bus state into Running state
            _status = ServiceBusStatus.Running;
        }