I would like to be able to have many clients and reply to specific
ones. To do this I think I need to set up each client with an endpoint
that contains a guid or something else unique. To do this I was moving
away from configuration file to programatically setting the
configuration. Unfortunately this isn't working for me. I do not get
any error messages just messages do not seem to arrive.

My config file that I'm trying to replace is:

<configuration>

  <configSections>
    <section name="rhino.esb"
type="Rhino.ServiceBus.Config.BusConfigurationSection,
Rhino.ServiceBus"/>
  </configSections>

  <rhino.esb>

    <bus
        threadCount="1"
        numberOfRetries="5"
        endpoint="msmq://localhost/LearningRhinoESB.E3.Client" />

    <messages>
      <!-- This time we specify the complete namespace here -->
      <add
        name="Messages"
        endpoint="msmq://localhost/LearningRhinoESB.E3.Backend"
           />
    </messages>

  </rhino.esb>

</configuration>

I have tried two approaches:

Approach one Bootstrapper of client:

    public class ClientBootStrapper : CastleBootStrapper
    {

        public override void BeforeStart()
        {

            var config = new HostConfiguration()
                .Bus("msmq://localhost/LearningRhinoESB." + "E3" +
".Client")
                .Receive("Message", "msmq://localhost/
LearningRhinoESB.E3.Backend")
                .ToBusConfiguration();

            UseConfiguration(config);

            base.BeforeStart();
        }

    }


Approach two was when creating the host:


            var host = new DefaultHost();
            host.BusConfiguration(c => c.Bus("msmq://localhost/
LearningRhinoESB." + "E3" + ".Client")
                .Receive("Messages", "msmq://localhost/
LearningRhinoESB.E3.Backend"));

            host.Start<ClientBootStrapper>();

            Console.WriteLine("Client 1: Hit enter to send message");
            Console.ReadLine();

            var bus = host.Bus as IServiceBus;

Both these approaches do nothing when sending this message:

            bus.Send(new HelloWorldMessage
            {
                Content = "Hello World!!!"
            });

But it works perfectly when using the configuration file. I have been
looking for a simple mistake and typo but can't find one.

Any ideas?

Many thanks

Max

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply via email to