public PoolableRabbitReceiverChannel(ICommunicationServiceConfig config,
                                    int instanceNum)
     : base(config, "Receiver_" + instanceNum.ToString())
 {
     _incomingMessageManager = new IncomingMessageManager();
     _consumerDict = new Dictionary<IMessageDestination, string>();
 }
        public DefaultCommunicationService(ICommunicationServiceConfig config,
            IPoolableObjectFactory<IMessageSenderChannel> senderChannelFactory,
            IPoolableObjectFactory<IMessageReceiverChannel> receiverChannelFactory, 
            string name = "DefaultCommunicationService",
            Int32 instanceNum = 1) : base(name, instanceNum)
        {
            var senderChannelPoolConfig = new ObjectPoolConfig<IMessageSenderChannel>.Builder()
                {
                    SetValidateBeforeBorrow = true,
                    SetCapacity = config.TotalSenderChannels,
                    SetMaximumObjectsActiveOnStartup = config.TotalSenderChannels,
                    Factory = senderChannelFactory
                }.Build();
            _senderChannelPool = new DefaultMessageSenderChannelPool(senderChannelPoolConfig);

            var receiverChannelPoolConfig = new ObjectPoolConfig<IMessageReceiverChannel>.Builder()
            {
                SetCapacity = config.TotalReceiverChannels,
                SetMaximumObjectsActiveOnStartup = config.TotalReceiverChannels,
                SetValidateBeforeBorrow = true,
                Factory = receiverChannelFactory
            }.Build();
            _receiverChannelPool = new DefaultMessageReceiverChannelPool(
                receiverChannelPoolConfig, config.UniqueResponseTopic);
        }
 protected AbstractCommunicationChannel(ICommunicationServiceConfig config, String connectionIdSuffix)
 {
     _config = config;
     _connectionId = String.Format("{0}/{1}_{2}_{3}_{4}",
         config.ConnectionIdPrefix,
         System.Environment.UserName,
         System.Environment.MachineName,
         System.Diagnostics.Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture),
         connectionIdSuffix);
 }
 public PoolableRabbitSenderChannel(ICommunicationServiceConfig config,
                                    int instanceNum)
     : base(config, "Sender_" + instanceNum.ToString())
 {
 }
 protected BaseRabbitCommunicationChannel(ICommunicationServiceConfig config, 
     String connectionIdSuffix) : base(config, connectionIdSuffix)
 {
 }