简体   繁体   English

如何在rebus azure队列单向客户端中设置queuename

[英]How can i set queuename in rebus azure queue oneway client

I have a rebus- worker that runs on azure queue, I have configured the rebusworker that will receive and send messages and it works fine. 我有一个在天蓝色队列上运行的rebus-worker,我已经配置了将接收和发送消息的rebusworker,它工作正常。 But then I want to set up a client as a oneway client like this: 但后来我想将客户端设置为单向客户端,如下所示:

   _bus = Configure.With(adapter)                
                .Transport(
                t =>
                    t.UseAzureStorageQueuesAsOneWayClient(AppSettingsReader.AzureStorage)
                )

            .Routing(r => r.TypeBased()
                .MapAssemblyOf<SomeCommand>(queueAddress)
            )

            })
            .Start();
    }

Where can i set the queue name I want to send messages to? 我在哪里可以设置要发送消息的队列名称? As is it returns a null-reference exception for queuename. 因为它返回queuename的空引用异常。

I'm using rebus and rebus.AzureStorage 0.99.74 我正在使用rebus和rebus.AzureStorage 0.99.74

The queueAddress in your snippet should be name of the queue, to which you would like to send messages from the assembly of SomeCommand . 您的代码段中的queueAddress应该是队列的名称,您希望从SomeCommand程序集发送消息。

To be very concrete, let's pretend you 要非常具体,让我们假装你

.Routing(r => r.TypeBased()
    .MapAssemblyOf<SomeCommand>("commandprocessor")
)

and then you 然后你

await bus.Send(new SomeCommand(...));

then Rebus will send that message to the queue commandprocessor . 然后Rebus将该消息发送到队列commandprocessor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM