protected void internalStart()
        {
            shouldContinue = true;

            _sqlQueueManager = new SqlQueueManager(queueEndpoint, connectionString);
            _queueId         = _sqlQueueManager.CreateQueue(queueName);
        }
示例#2
0
 public internalTransactionScope(SqlQueueManager parent)
 {
     if (SqlTransactionContext.Current == null)
     {
         transactionToCommit = parent.BeginTransaction();
     }
 }
	    public SqlMessageHandlingCompletion(SqlQueueManager sqlQueueManager, Action sendMessageBackToQueue, Exception exception, Action<CurrentMessageInformation, Exception> messageCompleted, Action<CurrentMessageInformation> beforeTransactionCommit, Action<CurrentMessageInformation> beforeTransactionRollback, ILog logger, Action<CurrentMessageInformation, Exception> messageProcessingFailure, CurrentMessageInformation currentMessageInformation)
	    {
	        this.sqlQueueManager = sqlQueueManager;
			this.sendMessageBackToQueue = sendMessageBackToQueue;
			this.exception = exception;
			this.messageCompleted = messageCompleted;
			this.beforeTransactionCommit = beforeTransactionCommit;
            this.beforeTransactionRollback = beforeTransactionRollback;
			this.logger = logger;
			this.messageProcessingFailure = messageProcessingFailure;
			this.currentMessageInformation = currentMessageInformation;
		}
 public SqlMessageHandlingCompletion(SqlQueueManager sqlQueueManager, Action sendMessageBackToQueue, Exception exception, Action <CurrentMessageInformation, Exception> messageCompleted, Action <CurrentMessageInformation> beforeTransactionCommit, Action <CurrentMessageInformation> beforeTransactionRollback, ILog logger, Action <CurrentMessageInformation, Exception> messageProcessingFailure, CurrentMessageInformation currentMessageInformation)
 {
     this.sqlQueueManager        = sqlQueueManager;
     this.sendMessageBackToQueue = sendMessageBackToQueue;
     this.exception                 = exception;
     this.messageCompleted          = messageCompleted;
     this.beforeTransactionCommit   = beforeTransactionCommit;
     this.beforeTransactionRollback = beforeTransactionRollback;
     this.logger = logger;
     this.messageProcessingFailure  = messageProcessingFailure;
     this.currentMessageInformation = currentMessageInformation;
 }
        public void Start()
        {
            if (haveStarted)
                return;

            shouldContinue = true;

            _sqlQueueManager = new SqlQueueManager(queueEndpoint, connectionString);
            _queueId = _sqlQueueManager.CreateQueue(queueName);

            queue = _sqlQueueManager.GetQueue(queueName);

            timeout = new TimeoutAction(queue);
            logger.DebugFormat("Starting {0} threads to handle messages on {1}, number of retries: {2}",
                threadCount, queueEndpoint, numberOfRetries);
            for (var i = 0; i < threadCount; i++)
            {
                threads[i] = new Thread(ReceiveMessage)
                {
                    Name = "Rhino Service Bus Worker Thread #" + i,
                    IsBackground = true
                };
                threads[i].Start(i);
            }
            haveStarted = true;
            var started = Started;
            if (started != null)
                started();
        }
	    protected void internalStart()
		{
			shouldContinue = true;

			_sqlQueueManager = new SqlQueueManager(queueEndpoint, connectionString);
			_queueId = _sqlQueueManager.CreateQueue(queueName);
	    }
			public internalTransactionScope(SqlQueueManager parent)
			{
				if (SqlTransactionContext.Current == null)
				{
					transactionToCommit = parent.BeginTransaction();
				}
			}