Example #1
1
        protected AbstractMsmqListener(
            IQueueStrategy queueStrategy,
            Uri endpoint,
            int threadCount,
            IMessageSerializer messageSerializer,
            IEndpointRouter endpointRouter,
            TransactionalOptions transactional,
            IMessageBuilder<Message> messageBuilder)
        {
            this.queueStrategy = queueStrategy;
            this.messageSerializer = messageSerializer;
            this.endpointRouter = endpointRouter;
            this.endpoint = endpoint;

            this.threadCount = threadCount;
            threads = new Thread[threadCount];

            switch (transactional)
            {
                case TransactionalOptions.Transactional:
                    this.transactional = true;
                    break;
                case TransactionalOptions.NonTransactional:
                    this.transactional = false;
                    break;
                case TransactionalOptions.FigureItOut:
                    this.transactional = null;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("transactional");
            }
            this.messageBuilder = messageBuilder;
            this.messageBuilder.Initialize(Endpoint);
        }
        protected AbstractFileListener(
            IQueueStrategy queueStrategy,
            Uri endpoint,
            int threadCount,
            IMessageSerializer messageSerializer,
            IEndpointRouter endpointRouter,
            TransactionalOptions transactional,
            IMessageBuilder <Message> messageBuilder)
        {
            this.queueStrategy     = queueStrategy;
            this.messageSerializer = messageSerializer;
            this.endpointRouter    = endpointRouter;
            this.endpoint          = endpoint;
            this.threadCount       = threadCount;
            threads = new Thread[threadCount];
            switch (transactional)
            {
            case TransactionalOptions.Transactional: this.transactional = true; break;

            case TransactionalOptions.NonTransactional: this.transactional = false; break;

            case TransactionalOptions.FigureItOut: this.transactional = null; break;

            default: throw new ArgumentOutOfRangeException("transactional");
            }
            this.messageBuilder = messageBuilder;
            this.messageBuilder.Initialize(Endpoint);
        }
Example #3
0
 public MsmqTransport(IMessageSerializer serializer, IQueueStrategy queueStrategy, Uri endpoint, int threadCount, IMsmqTransportAction[] transportActions, IEndpointRouter endpointRouter, IsolationLevel queueIsolationLevel, TransactionalOptions transactional, bool consumeInTransaction)
     : base(queueStrategy, endpoint, threadCount, serializer, endpointRouter, transactional)
 {
     this.transportActions = transportActions;
     this.queueIsolationLevel = queueIsolationLevel;
     this.consumeInTransaction = consumeInTransaction;
 }
		public MsmqReadyForWorkListener(IQueueStrategy queueStrategy, 
			Uri endpoint, 
			int threadCount, 
			IMessageSerializer messageSerializer, 
			IEndpointRouter endpointRouter, 
			TransactionalOptions transactional,
            IMessageBuilder<Message> messageBuilder) : base(queueStrategy, endpoint, threadCount, messageSerializer, endpointRouter, transactional, messageBuilder)
		{}
 public MsmqReadyForWorkListener(IQueueStrategy queueStrategy,
                                 Uri endpoint,
                                 int threadCount,
                                 IMessageSerializer messageSerializer,
                                 IEndpointRouter endpointRouter,
                                 TransactionalOptions transactional) : base(queueStrategy, endpoint, threadCount, messageSerializer, endpointRouter, transactional)
 {
 }
 public MsmqLoadBalancer(
     IMessageSerializer serializer,
     IQueueStrategy queueStrategy,
     IEndpointRouter endpointRouter,
     Uri endpoint,
     int threadCount,
     Uri secondaryLoadBalancer,
     TransactionalOptions transactional)
     : this(serializer, queueStrategy, endpointRouter, endpoint, threadCount, transactional)
 {
     this.secondaryLoadBalancer = secondaryLoadBalancer;
 }
 public MsmqLoadBalancer(
     IMessageSerializer serializer,
     IQueueStrategy queueStrategy,
     IEndpointRouter endpointRouter,
     Uri endpoint,
     int threadCount,
     TransactionalOptions transactional)
     : base(queueStrategy, endpoint, threadCount, serializer, endpointRouter, transactional)
 {
     heartBeatTimer = new Timer(SendHeartBeatToSecondaryServer);
     this.queueStrategy = queueStrategy;
 }
Example #8
0
 public MsmqLoadBalancer(
     IMessageSerializer serializer,
     IQueueStrategy queueStrategy,
     IEndpointRouter endpointRouter,
     Uri endpoint,
     int threadCount,
     Uri secondaryLoadBalancer,
     TransactionalOptions transactional)
     : this(serializer, queueStrategy, endpointRouter, endpoint, threadCount, transactional)
 {
     this.secondaryLoadBalancer = secondaryLoadBalancer;
 }
Example #9
0
 public MsmqLoadBalancer(
     IMessageSerializer serializer,
     IQueueStrategy queueStrategy,
     IEndpointRouter endpointRouter,
     Uri endpoint,
     int threadCount,
     TransactionalOptions transactional)
     : base(queueStrategy, endpoint, threadCount, serializer, endpointRouter, transactional)
 {
     heartBeatTimer     = new Timer(SendHeartBeatToSecondaryServer);
     this.queueStrategy = queueStrategy;
 }
Example #10
0
 public MsmqSecondaryLoadBalancer(
     IMessageSerializer serializer,
     IQueueStrategy queueStrategy,
     IEndpointRouter endpointRouter,
     Uri endpoint,
     Uri primaryLoadBalancer,
     int threadCount,
     TransactionalOptions transactional)
     : base(serializer, queueStrategy, endpointRouter, endpoint, threadCount, transactional)
 {
     TimeoutForHeartBeatFromPrimary = TimeSpan.FromSeconds(10);
     this.primaryLoadBalancer       = primaryLoadBalancer;
     tookOverWork = false;
 }
 public MsmqSecondaryLoadBalancer(
     IMessageSerializer serializer,
     IQueueStrategy queueStrategy,
     IEndpointRouter endpointRouter,
     Uri endpoint,
     Uri primaryLoadBalancer,
     int threadCount,
     TransactionalOptions transactional)
     : base(serializer, queueStrategy, endpointRouter, endpoint, threadCount, transactional)
 {
     TimeoutForHeartBeatFromPrimary = TimeSpan.FromSeconds(10);
     this.primaryLoadBalancer = primaryLoadBalancer;
     tookOverWork = false;
 }
Example #12
0
 public MsmqTransport(IMessageSerializer serializer,
                      IQueueStrategy queueStrategy,
                      Uri endpoint,
                      int threadCount,
                      IMsmqTransportAction[] transportActions,
                      IEndpointRouter endpointRouter,
                      IsolationLevel queueIsolationLevel,
                      TransactionalOptions transactional,
                      bool consumeInTransaction,
                      IMessageBuilder <Message> messageBuilder)
     : base(queueStrategy, endpoint, threadCount, serializer, endpointRouter, transactional, messageBuilder)
 {
     this.transportActions     = transportActions;
     this.queueIsolationLevel  = queueIsolationLevel;
     this.consumeInTransaction = consumeInTransaction;
 }