Ejemplo n.º 1
0
        public DurableSender(string connectionString, string serviceBusQueueName)
        {
            // Create a Service Bus queue client to send messages to the Service Bus queue.
            this.queueClient = new QueueClient(connectionString, serviceBusQueueName);

            // Create MSMQ queue if it doesn't exit. If it does, open the existing MSMQ queue.
            this.msmqQueue = MsmqHelper.GetMsmqQueue(MsmqHelper.CreateMsmqQueueName("", serviceBusQueueName, "SEND"));

            // Create MSMQ deadletter queue if it doesn't exit. If it does, open the existing MSMQ deadletter queue.
            this.msmqDeadletterQueue = MsmqHelper.GetMsmqQueue(MsmqHelper.CreateMsmqQueueName("", serviceBusQueueName, "SEND_DEADLETTER"));

            // Start receiving messages from the MSMQ queue.
            this.MsmqPeekBegin();
        }
Ejemplo n.º 2
0
        public DurableSender(MessagingFactory messagingFactory, string serviceBusQueueName)
        {
            // Create a Service Bus queue client to send messages to the Service Bus queue.
            this.queueClient = messagingFactory.CreateQueueClient(serviceBusQueueName);

            // Create MSMQ queue if it doesn't exit. If it does, open the existing MSMQ queue.
            this.msmqQueue = MsmqHelper.GetMsmqQueue(MsmqHelper.CreateMsmqQueueName(messagingFactory.Address.DnsSafeHost, serviceBusQueueName, "SEND"));

            // Create MSMQ deadletter queue if it doesn't exit. If it does, open the existing MSMQ deadletter queue.
            this.msmqDeadletterQueue = MsmqHelper.GetMsmqQueue(MsmqHelper.CreateMsmqQueueName(messagingFactory.Address.DnsSafeHost, serviceBusQueueName, "SEND_DEADLETTER"));

            // Start receiving messages from the MSMQ queue.
            this.MsmqPeekBegin();
        }