NServiceBus教程演示失败

时间:2018-03-15 19:05:13

标签: nservicebus

我开始学习NServiceBus。

我读到的第一件事是我们展示NServiceBus如何保证可靠性和可扩展性,好的:)

从NServiceBus网站https://docs.particular.net/tutorials/quickstart/下载零售演示教程解决方案

跑吧,它打开3个控制台应用程序ClientUI,Sales,Billing。 它应该从ClinetUI发送消息到Sales and Billing。

然而,销售应用程序失败了这个细节(下次即使刚刚开始也不再工作):

2018-03-15 14:31:47.771 INFO  DefaultFactory Logging to 'C:\Users\username\Projects\Tutorials\RetailDemo\Sales\bin\Debug\net461\' with level Info
2018-03-15 14:31:48.014 INFO  NServiceBus.LicenseManager No valid license could be found, falling back to trial license with start date '3/12/2018'

2018-03-15 14:31:48.114 INFO  NServiceBus.PerformanceCounterHelper NServiceBus performance counter for '# of msgs pulled from the input queue /sec' is not set up correctly. To rectify this problem, consult the NServiceBus performance counters documentation.
2018-03-15 14:31:48.121 INFO  NServiceBus.PerformanceCounterHelper NServiceBus performance counter for '# of msgs successfully processed / sec' is not set up correctly. To rectify this problem, consult the NServiceBus performance counters documentation.
2018-03-15 14:31:48.128 INFO  NServiceBus.PerformanceCounterHelper NServiceBus performance counter for '# of msgs failures / sec' is not set up correctly. To rectify this problem, consult the NServiceBus performance counters documentation.
Press Enter to exit.
2018-03-15 14:31:48.365 INFO  Sales.PlaceOrderHandler Received PlaceOrder, OrderId = d299afed-5b85-4d74-97e8-0d48d9bcd653
2018-03-15 14:31:48.371 INFO  Sales.PlaceOrderHandler Publishing OrderPlaced, OrderId = d299afed-5b85-4d74-97e8-0d48d9bcd653
2018-03-15 14:31:48.495 FATAL NServiceBus Failure while trying to process C:\Users\username\Projects\Tutorials\RetailDemo\.learningtransport\Sales\f37361c2-e95e-4a8a-be81-29a72574c646.metadata.txt
System.IO.IOException: Access to the path 'C:\Users\username\Projects\Tutorials\RetailDemo\.learningtransport\Sales\.pending\c687e34a-4a0e-405a-bce2-25515b419778' is denied.
   at System.IO.Directory.InternalMove(String sourceDirName, String destDirName, Boolean checkHost)
   at NServiceBus.DirectoryBasedTransaction.Commit()
   at NServiceBus.LearningTransportMessagePump.<ProcessFile>d__9.MoveNext()
2018-03-15 14:31:48.503 INFO  NServiceBus.Unicast.UnicastBus Initiating shutdown.
2018-03-15 14:31:48.517 INFO  NServiceBus.Unicast.UnicastBus Shutdown complete.

我猜关键原因是

2018-03-15 14:31:48.495 FATAL NServiceBus Failure while trying to process C:\Users\username\Projects\Tutorials\RetailDemo\.learningtransport\Sales\f37361c2-e95e-4a8a-be81-29a72574c646.metadata.txt
System.IO.IOException: Access to the path 'C:\Users\username\Projects\Tutorials\RetailDemo\.learningtransport\Sales\.pending\c687e34a-4a0e-405a-bce2-25515b419778' is denied.

问题 - 什么错?访问权限未被拒绝,此文件夹或文件没有任何内容。

如果他们的演示解决方案失败,我该怎么做才能继续学习这个框架?

1 个答案:

答案 0 :(得分:1)

似乎工作正常。

您在堆栈跟踪中看到的异常来自NServiceBus.DirectoryBasedTransaction.Commit(),由Directory.Move()引起。这是一个文件系统调用,它清楚地表明对.pending\c687e34a-4a0e-405a-bce2-25515b419778的访问被拒绝。

原因可能有所不同。可能是前一次运行失败并且文件夹/文件被锁定。您可以使用Microsoft/SysInternals Process Explorer之类的工具来查找导致锁定的进程。也可以在另一台机器上试试。

相关问题