0
votes

I'm new to NServiceBus and I'm trying to use it with IIS and SignalR. I have a working scenario but I'm curious how the client chooses which queues to publish to. I've noticed (by stopping IIS and running the publisher) that the message gets published to a system.web queue. I assume this is because my endpoint is being started by ASP.Net or something similar. However, this seems like a really generic queue to use and I would like to use application specific queue names. How do I specify which queues the publisher uses? I've changed the endpoint on the SignalR application but it doesn't seem to make much of a difference.

Here is my client config:

[EndpointName("signalbus.web")]
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
{
}

Here is my app.config from the publisher:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
    <section name="TransportConfig" type="NServiceBus.Config.TransportConfig, NServiceBus.Core"/>
    <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
  </configSections>

  <connectionStrings>
    <add name="NServiceBus/Persistence" connectionString="Url = http://localhost:9090" />
  </connectionStrings>

  <MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />

  <TransportConfig MaximumConcurrencyLevel="5" MaxRetries="2" MaximumMessageThroughputPerSecond="0"/>

  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="SignalBus.Messages" Endpoint="signalbus.web" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

</configuration>
1
Do you have those reversed? Your first code snippet looks like your publisher endpoint config, and your second snippet looks like your subscriber app.config.Phil Sandler
I don't think so. The endpoint on the publisher is flagged AsA_PublisherOchowie

1 Answers

1
votes

When you configure the bus:

Configure.With().DefineEndpointName("MyAppName")

Edit

I'm a little confused based on your posted code and your comments. Are you hosting the subscriber in IIS/ASP.Net? If so, I think EndpointConfig will get ignored, as (AFAIK) it is only used via the NSB Host.

See this link for configuring the Bus in your own process (or ASP.Net): http://docs.particular.net/nservicebus/hosting-nservicebus-in-your-own-process-v4.x

Also, you shouldn't need to reference the subscriber endpoint in your publisher's config--it needs no knowledge of its subscribers. It gets that via RavenDB or whatever subscription storage you are using.