public override void ReceiveMessage(PrintMessage printMessage, PrintMessageException printMessageException) { this.printMessage = printMessage; this.printMessageException = printMessageException; queueClient = new QueueClient(serviceBusConnectionString, queueName); // Register QueueClient's MessageHandler and receive messages in a loop RegisterOnMessageHandlerAndReceiveMessages(); }
public override void ReceiveMessage(PrintMessage printMessage, PrintMessageException printMessageException) { this.printMessage = printMessage; this.printMessageException = printMessageException; subscriptionClient = new SubscriptionClient(serviceBusConnectionString, topicName, subscriptionName); // Configure the message handler options in terms of exception handling, number of concurrent messages to deliver, etc. var messageHandlerOptions = new MessageHandlerOptions(ExceptionReceivedHandler) { // Maximum number of concurrent calls to the callback ProcessMessagesAsync(), set to 1 for simplicity. // Set it according to how many messages the application wants to process in parallel. MaxConcurrentCalls = MaxConcurrentCalls, // Indicates whether MessagePump should automatically complete the messages after returning from User Callback. // False below indicates the Complete will be handled by the User Callback as in `ProcessMessagesAsync` below. AutoComplete = AutoComplete }; // Register the function that processes messages. subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions); }
public virtual void ReceiveMessage(PrintMessage printMessage, PrintMessageException printMessageException) { throw new System.NotImplementedException(); }