public DefaultMessagingSystemFactory(IMessagingProvider messagingProvider, IProtocolFormatter protocolFromatter)
        {
            using (EneterTrace.Entering())
            {
                myOutputConnectorFactory = new DefaultOutputConnectorFactory(messagingProvider, protocolFromatter);
                myInputConnectorFactory  = new DefaultInputConnectorFactory(messagingProvider, protocolFromatter);

                NoDispatching aNoDispatching = new NoDispatching();
                InputChannelThreading  = aNoDispatching;
                OutputChannelThreading = aNoDispatching;

                myDispatcherAfterMessageDecoded = aNoDispatching.GetDispatcher();
            }
        }
        /// <summary>
        /// Constructs the factory.
        /// </summary>
        /// <param name="serviceConnectingAddress">message bus address intended for services which want to register in the message bus.
        /// It can be null if the message bus factory is intended to create only duplex output channels.</param>
        /// <param name="clientConnectingAddress">clientConnectingAddress message bus address intended for clients which want to connect a registered service.
        /// It can be null if the message bus factory is intended to create only duplex input channels.</param>
        /// <param name="serviceUnderlyingMessaging">underlying messaging used for services which connect the message bus to expose services.
        /// It can be null if the message bus factory is intended to create only duplex output channels.</param>
        /// <param name="clientUnderlyingMessaging">underlying messaging used for clients which connect the message bus to consume an exposed service.
        /// It can be null if the message bus factory is intended to create only duplex input channels.</param>
        /// <param name="serializer">serializer which is used to serialize {@link MessageBusMessage} which is internally used for the communication with
        /// the message bus. If null then custom message bus serializer is used.</param>
        public MessageBusMessagingFactory(string serviceConnectingAddress, string clientConnectingAddress, IMessagingSystemFactory serviceUnderlyingMessaging, IMessagingSystemFactory clientUnderlyingMessaging, ISerializer serializer)
        {
            using (EneterTrace.Entering())
            {
                ISerializer aSerializer = serializer ?? new MessageBusCustomSerializer();
                myOutputConnectorFactory = new MessageBusOutputConnectorFactory(clientConnectingAddress, aSerializer);
                myInputConnectorFactory  = new MessageBusInputConnectorFactory(serviceConnectingAddress, aSerializer);

                ClientMessaging  = clientUnderlyingMessaging;
                ServiceMessaging = serviceUnderlyingMessaging;

                // Dispatch events in the same thread as notified from the underlying messaging.
                OutputChannelThreading = new NoDispatching();
                InputChannelThreading  = OutputChannelThreading;
            }
        }