我不是程序员,但我试图通过给他们一些指导来帮助他们。我们不再拥有任何有关 msmq 的内部专业知识。我们正在尝试使用它来将一些功能与调度应用程序集成。
调度应用程序通过使用自定义构建的 dll 进行网络调用来启动作业。dll 调用 weburl。Web 应用程序将运行其任务并向网站发送有关其执行的任务的更新。网站将消息写入队列。调用该站点的 dll 正在监视队列中是否有带有分配给该作业的标签的消息。当它收到最终状态消息时,它会关闭。
我们每隔几个小时就会收到以下消息。我们每小时运行近 100 个使用此方法的作业。在底部列出的代码中,jobid 对应于消息队列中消息的标签。每个作业在开始时都会发出一个 jobid,并将使用它作为发送到该作业的 msmq 的每条消息的标签。
System.Messaging.MessageQueueException (0x80004005): Message that the cursor is currently pointing to has been removed from the queue by another process or by another call to Receive without the use of this cursor.
at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
at System.Messaging.MessageEnumerator.get_Current()
Run Code Online (Sandbox Code Playgroud)
这是它的代码。
while ( running )
{
// System.Console.WriteLine( "Begin Peek" );
messageQueue.Peek();
//System.Console.WriteLine( "End Peek" ); …Run Code Online (Sandbox Code Playgroud) 首先,我对 powershell 和编程非常陌生。我有一个 powershell 脚本,它接受一些参数并输出一个值。脚本的结果将类似于 9/10,其中 9 将是节点总数中活动的数量。我想将输出分配给一个变量,这样我就可以根据该值调用另一个脚本。
这是我尝试过的,但不起作用:
$active = (./MyScript.ps1 lb uid **** site)
Run Code Online (Sandbox Code Playgroud)
我还尝试了以下似乎将变量分配给空字符串的方法
$active = (./MyScript.ps1 lb uid **** site | out-string)
Run Code Online (Sandbox Code Playgroud)
在这两种情况下,它们都会运行并立即给我值,而不是将其分配给变量。当我调用变量时,我没有得到任何数据。