Loading ...
Sorry, an error occurred while loading the content.

Programmatically configure input queue name for subscriber

Expand Messages
  • petr.sereda
    Hello, I need to run multiple instances of the same client application which subscribes to a some subscription available on the server. If I want to run
    Message 1 of 9 , Mar 16, 2010
    View Source
    • 0 Attachment
      Hello,

      I need to run multiple instances of the same client application which subscribes to a some subscription available on the server. If I want to run several client instances on the same computer, I need to set individual input queue name for each client, right? The only thing how I can do it is to programmatically set this name when the client starts.

      I have found the following link:
      http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebus.html

      It does exactly the same what I need but for old version of NServiceBus, it doesn't work in 2.0. I have modified the code in the following way:

      public void Init()
      {
      Configure configure = NServiceBus.Configure.With().DefaultBuilder();

      var componentConfig = configure.Configurer.ConfigureComponent<MsmqTransport>(ComponentCallModelEnum.Singleton);

      componentConfig.ConfigureProperty(msmq => msmq.InputQueue, "DynamicQueueName");

      configure
      .XmlSerializer()
      .UnicastBus()
      .ImpersonateSender(false)
      .LoadMessageHandlers()
      .CreateBus()
      .Start();
      }

      But after client has started, it doesn't initialize input queue and can't receive messages from server. Could you please advise me, what I'm doing wrong?

      Thanks,
      Petr
    • Udi Dahan
      Petr, The thing is that there are other things that happen in Configure.MsmqTransport() that you haven t done. If all you want to do is override the input
      Message 2 of 9 , Mar 16, 2010
      View Source
      • 0 Attachment

        Petr,

         

        The thing is that there are other things that happen in Configure.MsmqTransport() that you haven't done.

        If all you want to do is override the input queue, leave the standard IConfigureThisEndpoint, AsA_Client and have another class which does:

         

        public class OverrideInputQueue : IWantCustomInitialization

        {

                        public void Init()

                        {

                                        Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(t => t.InputQueue, yourDynamicQueue);

                        }

        }

         

        Let me know if that works for you.

         

        -- Udi Dahan

         

        From: nservicebus@yahoogroups.com [mailto:nservicebus@yahoogroups.com] On Behalf Of petr.sereda
        Sent: Tuesday, March 16, 2010 11:15 AM
        To: nservicebus@yahoogroups.com
        Subject: [nservicebus] Programmatically configure input queue name for subscriber

         

         

        Hello,

        I need to run multiple instances of the same client application which subscribes to a some subscription available on the server. If I want to run several client instances on the same computer, I need to set individual input queue name for each client, right? The only thing how I can do it is to programmatically set this name when the client starts.

        I have found the following link:
        http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebus.html

        It does exactly the same what I need but for old version of NServiceBus, it doesn't work in 2.0. I have modified the code in the following way:

        public void Init()
        {
        Configure configure = NServiceBus.Configure.With().DefaultBuilder();

        var componentConfig = configure.Configurer.ConfigureComponent<MsmqTransport>(ComponentCallModelEnum.Singleton);

        componentConfig.ConfigureProperty(msmq => msmq.InputQueue, "DynamicQueueName");

        configure
        .XmlSerializer()
        .UnicastBus()
        .ImpersonateSender(false)
        .LoadMessageHandlers()
        .CreateBus()
        .Start();
        }

        But after client has started, it doesn't initialize input queue and can't receive messages from server. Could you please advise me, what I'm doing wrong?

        Thanks,
        Petr

      • Michael Nye
        Does each client not have their own .config file? If they do, you can simply tune the config file per deployment.
        Message 3 of 9 , Mar 16, 2010
        View Source
        • 0 Attachment
          Does each client not have their own .config file?  If they do, you can simply tune the config file per deployment.

          On 16/03/2010 7:15 PM, petr.sereda wrote:
           

          Hello,

          I need to run multiple instances of the same client application which subscribes to a some subscription available on the server. If I want to run several client instances on the same computer, I need to set individual input queue name for each client, right? The only thing how I can do it is to programmatically set this name when the client starts.

          I have found the following link:
          http://www.codingon thetrain. com/2009/ 05/programaticly -configuring- nservicebus. html

          It does exactly the same what I need but for old version of NServiceBus, it doesn't work in 2.0. I have modified the code in the following way:

          public void Init()
          {
          Configure configure = NServiceBus. Configure. With().DefaultBu ilder();

          var componentConfig = configure.Configure r.ConfigureCompo nent<MsmqTranspo rt>(ComponentCal lModelEnum. Singleton) ;

          componentConfig. ConfigurePropert y(msmq => msmq.InputQueue, "DynamicQueueName" );

          configure
          .XmlSerializer( )
          .UnicastBus( )
          .ImpersonateSender( false)
          .LoadMessageHandler s()
          .CreateBus()
          .Start();
          }

          But after client has started, it doesn't initialize input queue and can't receive messages from server. Could you please advise me, what I'm doing wrong?

          Thanks,
          Petr



        • petr.sereda
          Thank you, Udi, that did work for me. Could you please help with another problem? I want to run several subscribers within the same process, each of them
          Message 4 of 9 , Mar 16, 2010
          View Source
          • 0 Attachment
            Thank you, Udi, that did work for me.

            Could you please help with another problem?

            I want to run several subscribers within the same process, each of them having its own input queue. How can I do it if I host NServiceBus in my own process?

            Thanks,
            Petr

            --- In nservicebus@yahoogroups.com, "Udi Dahan" <thesoftwaresimplist@...> wrote:
            >
            > Petr,
            >
            >
            >
            > The thing is that there are other things that happen in
            > Configure.MsmqTransport() that you haven't done.
            >
            > If all you want to do is override the input queue, leave the standard
            > IConfigureThisEndpoint, AsA_Client and have another class which does:
            >
            >
            >
            > public class OverrideInputQueue : IWantCustomInitialization
            >
            > {
            >
            > public void Init()
            >
            > {
            >
            >
            > Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(t =>
            > t.InputQueue, yourDynamicQueue);
            >
            > }
            >
            > }
            >
            >
            >
            > Let me know if that works for you.
            >
            >
            >
            > -- Udi Dahan
            >
            >
            >
            > From: nservicebus@yahoogroups.com [mailto:nservicebus@yahoogroups.com] On
            > Behalf Of petr.sereda
            > Sent: Tuesday, March 16, 2010 11:15 AM
            > To: nservicebus@yahoogroups.com
            > Subject: [nservicebus] Programmatically configure input queue name for
            > subscriber
            >
            >
            >
            >
            >
            > Hello,
            >
            > I need to run multiple instances of the same client application which
            > subscribes to a some subscription available on the server. If I want to run
            > several client instances on the same computer, I need to set individual
            > input queue name for each client, right? The only thing how I can do it is
            > to programmatically set this name when the client starts.
            >
            > I have found the following link:
            > http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebu
            > s.html
            >
            > It does exactly the same what I need but for old version of NServiceBus, it
            > doesn't work in 2.0. I have modified the code in the following way:
            >
            > public void Init()
            > {
            > Configure configure = NServiceBus.Configure.With().DefaultBuilder();
            >
            > var componentConfig =
            > configure.Configurer.ConfigureComponent<MsmqTransport>(ComponentCallModelEnu
            > m.Singleton);
            >
            > componentConfig.ConfigureProperty(msmq => msmq.InputQueue,
            > "DynamicQueueName");
            >
            > configure
            > .XmlSerializer()
            > .UnicastBus()
            > .ImpersonateSender(false)
            > .LoadMessageHandlers()
            > .CreateBus()
            > .Start();
            > }
            >
            > But after client has started, it doesn't initialize input queue and can't
            > receive messages from server. Could you please advise me, what I'm doing
            > wrong?
            >
            > Thanks,
            > Petr
            >
          • petr.sereda
            Hi Michael, I wish it would be so simple :) unfortunately no. Actually what I need to do is to create some test application to verify stability and performance
            Message 5 of 9 , Mar 16, 2010
            View Source
            • 0 Attachment
              Hi Michael,

              I wish it would be so simple :) unfortunately no.

              Actually what I need to do is to create some test application to verify stability and performance of NServiceBus. Our customer asked me to do it.

              Eventually I need to run 2000 simultaneous message receivers and 100 message publishers, publishing about 100 messages per minute. But for beginning I want just locally run several subscriber processes hosting several subscribers each (each one with its own queue) and several publisher processes.

              Thanks,
              Petr

              --- In nservicebus@yahoogroups.com, Michael Nye <michael.nye1@...> wrote:
              >
              > Does each client not have their own .config file? If they do, you can
              > simply tune the config file per deployment.
              >
              > On 16/03/2010 7:15 PM, petr.sereda wrote:
              > >
              > > Hello,
              > >
              > > I need to run multiple instances of the same client application which
              > > subscribes to a some subscription available on the server. If I want
              > > to run several client instances on the same computer, I need to set
              > > individual input queue name for each client, right? The only thing how
              > > I can do it is to programmatically set this name when the client starts.
              > >
              > > I have found the following link:
              > > http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebus.html
              > > <http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebus.html>
              > >
              > > It does exactly the same what I need but for old version of
              > > NServiceBus, it doesn't work in 2.0. I have modified the code in the
              > > following way:
              > >
              > > public void Init()
              > > {
              > > Configure configure = NServiceBus.Configure.With().DefaultBuilder();
              > >
              > > var componentConfig =
              > > configure.Configurer.ConfigureComponent<MsmqTransport>(ComponentCallModelEnum.Singleton);
              > >
              > > componentConfig.ConfigureProperty(msmq => msmq.InputQueue,
              > > "DynamicQueueName");
              > >
              > > configure
              > > .XmlSerializer()
              > > .UnicastBus()
              > > .ImpersonateSender(false)
              > > .LoadMessageHandlers()
              > > .CreateBus()
              > > .Start();
              > > }
              > >
              > > But after client has started, it doesn't initialize input queue and
              > > can't receive messages from server. Could you please advise me, what
              > > I'm doing wrong?
              > >
              > > Thanks,
              > > Petr
              > >
              > >
              > >
              >
            • Udi Dahan
              Petr, You d need to manually put each one in its own appdomain, probably giving it a custom configuration source programmatically (rather than from the config
              Message 6 of 9 , Mar 17, 2010
              View Source
              • 0 Attachment

                Petr,

                 

                You'd need to manually put each one in its own appdomain, probably giving it a custom configuration source programmatically (rather than from the config file).

                 

                Does that answer your question?

                 

                -- Udi Dahan

                 

                From: nservicebus@yahoogroups.com [mailto:nservicebus@yahoogroups.com] On Behalf Of petr.sereda
                Sent: Tuesday, March 16, 2010 5:56 PM
                To: nservicebus@yahoogroups.com
                Subject: [nservicebus] Re: Programmatically configure input queue name for subscriber

                 

                 

                Thank you, Udi, that did work for me.

                Could you please help with another problem?

                I want to run several subscribers within the same process, each of them having its own input queue. How can I do it if I host NServiceBus in my own process?

                Thanks,
                Petr

                --- In nservicebus@yahoogroups.com, "Udi Dahan" <thesoftwaresimplist@...> wrote:

                >
                > Petr,
                >
                >
                >
                > The thing is that there are other things that happen in
                > Configure.MsmqTransport() that you haven't done.
                >
                > If all you want to do is override the input queue, leave the standard
                > IConfigureThisEndpoint, AsA_Client and have another class which does:
                >
                >
                >
                > public class OverrideInputQueue : IWantCustomInitialization
                >
                > {
                >
                > public void Init()
                >
                > {
                >
                >
                > Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(t
                =>
                > t.InputQueue, yourDynamicQueue);
                >
                > }
                >
                > }
                >
                >
                >
                > Let me know if that works for you.
                >
                >
                >
                > -- Udi Dahan
                >
                >
                >
                > From: nservicebus@yahoogroups.com
                [mailto:nservicebus@yahoogroups.com] On
                > Behalf Of petr.sereda
                > Sent: Tuesday, March 16, 2010 11:15 AM
                > To: nservicebus@yahoogroups.com
                > Subject: [nservicebus] Programmatically configure input queue name for
                > subscriber
                >
                >
                >
                >
                >
                > Hello,
                >
                > I need to run multiple instances of the same client application which
                > subscribes to a some subscription available on the server. If I want to
                run
                > several client instances on the same computer, I need to set individual
                > input queue name for each client, right? The only thing how I can do it is
                > to programmatically set this name when the client starts.
                >
                > I have found the following link:
                >
                href="http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebu">http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebu
                > s.html
                >
                > It does exactly the same what I need but for old version of NServiceBus,
                it
                > doesn't work in 2.0. I have modified the code in the following way:
                >
                > public void Init()
                > {
                > Configure configure = NServiceBus.Configure.With().DefaultBuilder();
                >
                > var componentConfig =
                > configure.Configurer.ConfigureComponent<MsmqTransport>(ComponentCallModelEnu
                > m.Singleton);
                >
                > componentConfig.ConfigureProperty(msmq => msmq.InputQueue,
                > "DynamicQueueName");
                >
                > configure
                > .XmlSerializer()
                > .UnicastBus()
                > .ImpersonateSender(false)
                > .LoadMessageHandlers()
                > .CreateBus()
                > .Start();
                > }
                >
                > But after client has started, it doesn't initialize input queue and can't
                > receive messages from server. Could you please advise me, what I'm doing
                > wrong?
                >
                > Thanks,
                > Petr
                >

              • petr.sereda
                Thank you Udi, I ve caught an idea. So it seems I also can t have both subscriber and publisher (listening different queues of course) in one AppDomain, right?
                Message 7 of 9 , Mar 19, 2010
                View Source
                • 0 Attachment
                  Thank you Udi, I've caught an idea.

                  So it seems I also can't have both subscriber and publisher (listening different queues of course) in one AppDomain, right?

                  --- In nservicebus@yahoogroups.com, "Udi Dahan" <thesoftwaresimplist@...> wrote:
                  >
                  > Petr,
                  >
                  >
                  >
                  > You'd need to manually put each one in its own appdomain, probably giving it
                  > a custom configuration source programmatically (rather than from the config
                  > file).
                  >
                  >
                  >
                  > Does that answer your question?
                  >
                  >
                  >
                  > -- Udi Dahan
                  >
                  >
                  >
                  > From: nservicebus@yahoogroups.com [mailto:nservicebus@yahoogroups.com] On
                  > Behalf Of petr.sereda
                  > Sent: Tuesday, March 16, 2010 5:56 PM
                  > To: nservicebus@yahoogroups.com
                  > Subject: [nservicebus] Re: Programmatically configure input queue name for
                  > subscriber
                  >
                  >
                  >
                  >
                  >
                  > Thank you, Udi, that did work for me.
                  >
                  > Could you please help with another problem?
                  >
                  > I want to run several subscribers within the same process, each of them
                  > having its own input queue. How can I do it if I host NServiceBus in my own
                  > process?
                  >
                  > Thanks,
                  > Petr
                  >
                  > --- In nservicebus@yahoogroups.com <mailto:nservicebus%40yahoogroups.com> ,
                  > "Udi Dahan" <thesoftwaresimplist@> wrote:
                  > >
                  > > Petr,
                  > >
                  > >
                  > >
                  > > The thing is that there are other things that happen in
                  > > Configure.MsmqTransport() that you haven't done.
                  > >
                  > > If all you want to do is override the input queue, leave the standard
                  > > IConfigureThisEndpoint, AsA_Client and have another class which does:
                  > >
                  > >
                  > >
                  > > public class OverrideInputQueue : IWantCustomInitialization
                  > >
                  > > {
                  > >
                  > > public void Init()
                  > >
                  > > {
                  > >
                  > >
                  > > Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(t =>
                  > > t.InputQueue, yourDynamicQueue);
                  > >
                  > > }
                  > >
                  > > }
                  > >
                  > >
                  > >
                  > > Let me know if that works for you.
                  > >
                  > >
                  > >
                  > > -- Udi Dahan
                  > >
                  > >
                  > >
                  > > From: nservicebus@yahoogroups.com <mailto:nservicebus%40yahoogroups.com>
                  > [mailto:nservicebus@yahoogroups.com <mailto:nservicebus%40yahoogroups.com> ]
                  > On
                  > > Behalf Of petr.sereda
                  > > Sent: Tuesday, March 16, 2010 11:15 AM
                  > > To: nservicebus@yahoogroups.com <mailto:nservicebus%40yahoogroups.com>
                  > > Subject: [nservicebus] Programmatically configure input queue name for
                  > > subscriber
                  > >
                  > >
                  > >
                  > >
                  > >
                  > > Hello,
                  > >
                  > > I need to run multiple instances of the same client application which
                  > > subscribes to a some subscription available on the server. If I want to
                  > run
                  > > several client instances on the same computer, I need to set individual
                  > > input queue name for each client, right? The only thing how I can do it is
                  > > to programmatically set this name when the client starts.
                  > >
                  > > I have found the following link:
                  > >
                  > http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebu
                  > > s.html
                  > >
                  > > It does exactly the same what I need but for old version of NServiceBus,
                  > it
                  > > doesn't work in 2.0. I have modified the code in the following way:
                  > >
                  > > public void Init()
                  > > {
                  > > Configure configure = NServiceBus.Configure.With().DefaultBuilder();
                  > >
                  > > var componentConfig =
                  > >
                  > configure.Configurer.ConfigureComponent<MsmqTransport>(ComponentCallModelEnu
                  > > m.Singleton);
                  > >
                  > > componentConfig.ConfigureProperty(msmq => msmq.InputQueue,
                  > > "DynamicQueueName");
                  > >
                  > > configure
                  > > .XmlSerializer()
                  > > .UnicastBus()
                  > > .ImpersonateSender(false)
                  > > .LoadMessageHandlers()
                  > > .CreateBus()
                  > > .Start();
                  > > }
                  > >
                  > > But after client has started, it doesn't initialize input queue and can't
                  > > receive messages from server. Could you please advise me, what I'm doing
                  > > wrong?
                  > >
                  > > Thanks,
                  > > Petr
                  > >
                  >
                • Jack Lichwa
                  I have similar issue - somebody decided that all our users will use terminal server, so we had to differentiate queues per user. The only problem is that I
                  Message 8 of 9 , Mar 19, 2010
                  View Source
                  • 0 Attachment

                    I have similar issue – somebody decided that all our users will use terminal server, so we had to differentiate queues per user.

                    The only problem is that I don’t use NServiceBusHost to start our client app ( I was not sure how to implement that with ClickOnce), so I did not use profiles.

                    Maybe I  missed something and you can still user profiles without NServiceBusHost. Anyway we initialize (create subscription to publisher) manually, so in Bootstrapper I put this code:

                     

                    Configure.With()

                                        .StructureMapBuilder(ObjectFactory.Container)

                                        .MsmqSubscriptionStorage()

                                        .XmlSerializer()

                                        .MsmqTransport()

                                            .IsTransactional(true)

                                            .PurgeOnStartup(false)

                     

                                        .UnicastBus()

                                        //.DoNotAutoSubscribe() Once we don't want to subscribe to all types of message

                                        //this line has to be uncommented and Suscribe(messageType) method has to be called

                                            .ImpersonateSender(false)

                                            .LoadMessageHandlers();

                                    

                                    Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(msmq => msmq.InputQueue, "IB_UI_"+Environment.UserName);

                                    Configure.Instance.CreateBus().Start();

                     

                     

                    It is working fine, but I just wonder if that is the best way of doing it. It did not work when I tried to configure msmq after Start().

                     

                    Thanks

                    Jack

                     

                     

                    From: nservicebus@yahoogroups.com [mailto:nservicebus@yahoogroups.com] On Behalf Of petr.sereda
                    Sent: Tuesday, March 16, 2010 10:56 AM
                    To: nservicebus@yahoogroups.com
                    Subject: [nservicebus] Re: Programmatically configure input queue name for subscriber

                     

                     

                    Thank you, Udi, that did work for me.

                    Could you please help with another problem?

                    I want to run several subscribers within the same process, each of them having its own input queue. How can I do it if I host NServiceBus in my own process?

                    Thanks,
                    Petr

                    --- In nservicebus@yahoogroups.com, "Udi Dahan" <thesoftwaresimplist@...> wrote:

                    >
                    > Petr,
                    >
                    >
                    >
                    > The thing is that there are other things that happen in
                    > Configure.MsmqTransport() that you haven't done.
                    >
                    > If all you want to do is override the input queue, leave the standard
                    > IConfigureThisEndpoint, AsA_Client and have another class which does:
                    >
                    >
                    >
                    > public class OverrideInputQueue : IWantCustomInitialization
                    >
                    > {
                    >
                    > public void Init()
                    >
                    > {
                    >
                    >
                    > Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(t
                    =>
                    > t.InputQueue, yourDynamicQueue);
                    >
                    > }
                    >
                    > }
                    >
                    >
                    >
                    > Let me know if that works for you.
                    >
                    >
                    >
                    > -- Udi Dahan
                    >
                    >
                    >
                    > From: nservicebus@yahoogroups.com
                    [mailto:nservicebus@yahoogroups.com] On
                    > Behalf Of petr.sereda
                    > Sent: Tuesday, March 16, 2010 11:15 AM
                    > To: nservicebus@yahoogroups.com
                    > Subject: [nservicebus] Programmatically configure input queue name for
                    > subscriber
                    >
                    >
                    >
                    >
                    >
                    > Hello,
                    >
                    > I need to run multiple instances of the same client application which
                    > subscribes to a some subscription available on the server. If I want to
                    run
                    > several client instances on the same computer, I need to set individual
                    > input queue name for each client, right? The only thing how I can do it is
                    > to programmatically set this name when the client starts.
                    >
                    > I have found the following link:
                    >
                    href="http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebu">http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservicebu
                    > s.html
                    >
                    > It does exactly the same what I need but for old version of NServiceBus,
                    it
                    > doesn't work in 2.0. I have modified the code in the following way:
                    >
                    > public void Init()
                    > {
                    > Configure configure = NServiceBus.Configure.With().DefaultBuilder();
                    >
                    > var componentConfig =
                    > configure.Configurer.ConfigureComponent<MsmqTransport>(ComponentCallModelEnu
                    > m.Singleton);
                    >
                    > componentConfig.ConfigureProperty(msmq => msmq.InputQueue,
                    > "DynamicQueueName");
                    >
                    > configure
                    > .XmlSerializer()
                    > .UnicastBus()
                    > .ImpersonateSender(false)
                    > .LoadMessageHandlers()
                    > .CreateBus()
                    > .Start();
                    > }
                    >
                    > But after client has started, it doesn't initialize input queue and can't
                    > receive messages from server. Could you please advise me, what I'm doing
                    > wrong?
                    >
                    > Thanks,
                    > Petr
                    >

                  • petr.sereda
                    Thank you Jack, your sample helped to me to run many subscribers within same process (however I had to isolate each subscriber in a separate AppDomain).
                    Message 9 of 9 , Mar 23, 2010
                    View Source
                    • 0 Attachment
                      Thank you Jack, your sample helped to me to run many subscribers within same process (however I had to isolate each subscriber in a separate AppDomain).

                      --- In nservicebus@yahoogroups.com, "Jack Lichwa" <Jack.Lichwa@...> wrote:
                      >
                      > I have similar issue - somebody decided that all our users will use
                      > terminal server, so we had to differentiate queues per user.
                      >
                      > The only problem is that I don't use NServiceBusHost to start our client
                      > app ( I was not sure how to implement that with ClickOnce), so I did not
                      > use profiles.
                      >
                      > Maybe I missed something and you can still user profiles without
                      > NServiceBusHost. Anyway we initialize (create subscription to publisher)
                      > manually, so in Bootstrapper I put this code:
                      >
                      >
                      >
                      > Configure.With()
                      >
                      > .StructureMapBuilder(ObjectFactory.Container)
                      >
                      > .MsmqSubscriptionStorage()
                      >
                      > .XmlSerializer()
                      >
                      > .MsmqTransport()
                      >
                      > .IsTransactional(true)
                      >
                      > .PurgeOnStartup(false)
                      >
                      >
                      >
                      > .UnicastBus()
                      >
                      > //.DoNotAutoSubscribe() Once we don't want to
                      > subscribe to all types of message
                      >
                      > //this line has to be uncommented and
                      > Suscribe(messageType) method has to be called
                      >
                      > .ImpersonateSender(false)
                      >
                      > .LoadMessageHandlers();
                      >
                      >
                      >
                      >
                      > Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(msmq =>
                      > msmq.InputQueue, "IB_UI_"+Environment.UserName);
                      >
                      > Configure.Instance.CreateBus().Start();
                      >
                      >
                      >
                      >
                      >
                      > It is working fine, but I just wonder if that is the best way of doing
                      > it. It did not work when I tried to configure msmq after Start().
                      >
                      >
                      >
                      > Thanks
                      >
                      > Jack
                      >
                      >
                      >
                      >
                      >
                      > From: nservicebus@yahoogroups.com [mailto:nservicebus@yahoogroups.com]
                      > On Behalf Of petr.sereda
                      > Sent: Tuesday, March 16, 2010 10:56 AM
                      > To: nservicebus@yahoogroups.com
                      > Subject: [nservicebus] Re: Programmatically configure input queue name
                      > for subscriber
                      >
                      >
                      >
                      >
                      >
                      > Thank you, Udi, that did work for me.
                      >
                      > Could you please help with another problem?
                      >
                      > I want to run several subscribers within the same process, each of them
                      > having its own input queue. How can I do it if I host NServiceBus in my
                      > own process?
                      >
                      > Thanks,
                      > Petr
                      >
                      > --- In nservicebus@yahoogroups.com
                      > <mailto:nservicebus%40yahoogroups.com> , "Udi Dahan"
                      > <thesoftwaresimplist@> wrote:
                      > >
                      > > Petr,
                      > >
                      > >
                      > >
                      > > The thing is that there are other things that happen in
                      > > Configure.MsmqTransport() that you haven't done.
                      > >
                      > > If all you want to do is override the input queue, leave the standard
                      > > IConfigureThisEndpoint, AsA_Client and have another class which does:
                      > >
                      > >
                      > >
                      > > public class OverrideInputQueue : IWantCustomInitialization
                      > >
                      > > {
                      > >
                      > > public void Init()
                      > >
                      > > {
                      > >
                      > >
                      > > Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(t =>
                      > > t.InputQueue, yourDynamicQueue);
                      > >
                      > > }
                      > >
                      > > }
                      > >
                      > >
                      > >
                      > > Let me know if that works for you.
                      > >
                      > >
                      > >
                      > > -- Udi Dahan
                      > >
                      > >
                      > >
                      > > From: nservicebus@yahoogroups.com
                      > <mailto:nservicebus%40yahoogroups.com>
                      > [mailto:nservicebus@yahoogroups.com
                      > <mailto:nservicebus%40yahoogroups.com> ] On
                      > > Behalf Of petr.sereda
                      > > Sent: Tuesday, March 16, 2010 11:15 AM
                      > > To: nservicebus@yahoogroups.com <mailto:nservicebus%40yahoogroups.com>
                      >
                      > > Subject: [nservicebus] Programmatically configure input queue name for
                      > > subscriber
                      > >
                      > >
                      > >
                      > >
                      > >
                      > > Hello,
                      > >
                      > > I need to run multiple instances of the same client application which
                      > > subscribes to a some subscription available on the server. If I want
                      > to run
                      > > several client instances on the same computer, I need to set
                      > individual
                      > > input queue name for each client, right? The only thing how I can do
                      > it is
                      > > to programmatically set this name when the client starts.
                      > >
                      > > I have found the following link:
                      > >
                      > http://www.codingonthetrain.com/2009/05/programaticly-configuring-nservi
                      > cebu
                      > > s.html
                      > >
                      > > It does exactly the same what I need but for old version of
                      > NServiceBus, it
                      > > doesn't work in 2.0. I have modified the code in the following way:
                      > >
                      > > public void Init()
                      > > {
                      > > Configure configure = NServiceBus.Configure.With().DefaultBuilder();
                      > >
                      > > var componentConfig =
                      > >
                      > configure.Configurer.ConfigureComponent<MsmqTransport>(ComponentCallMode
                      > lEnu
                      > > m.Singleton);
                      > >
                      > > componentConfig.ConfigureProperty(msmq => msmq.InputQueue,
                      > > "DynamicQueueName");
                      > >
                      > > configure
                      > > .XmlSerializer()
                      > > .UnicastBus()
                      > > .ImpersonateSender(false)
                      > > .LoadMessageHandlers()
                      > > .CreateBus()
                      > > .Start();
                      > > }
                      > >
                      > > But after client has started, it doesn't initialize input queue and
                      > can't
                      > > receive messages from server. Could you please advise me, what I'm
                      > doing
                      > > wrong?
                      > >
                      > > Thanks,
                      > > Petr
                      > >
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.