Yea sure,
allow me to shed some light on it first tho ;P
All my agents are *.dll files, with the agent.config file added to the
resource file of that DLL.
Then when the agent is loaded (through assembly) I parse the XML
string with my own xml parser and setup the configuration as follows:
var host = new DefaultHost();
HostConfiguration hostConfiguration = new HostConfiguration();
hostConfiguration.Bus(configData[0].ToString()); // configData[0] =
The endpoint from the <bus /> element
foreach (string[] s in (List<string[]>)configData[1])
{
hostConfiguration.Receive(s[0], s[1]); // s[0] = The name attr from
the <add /> element under messages | s[1] = The endpoint attr from the
<add /> element under messages
}
host.BusConfiguration(c => hostConfiguration);
host.Start<EditorBootstrapper>();
That being said, here's the config file for example the Editor:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--[E D I T O R] CONFIGURATION-->
<configSections>
<section name="castle"
type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler,
Castle.Windsor"/>
</configSections>
<castle>
<facilities>
<facility id="rhino.esb">
<bus threadCount="1" numberOfRetries="5" endpoint="msmq://
localhost/newspaper.editor"/>
<messages>
<add name="Data.Messages.Reporter.NewArticle"
endpoint="msmq://localhost/newspaper.agentcontroller" />
<add name="Data.Messages.Critic.ArticleOk" endpoint="msmq://
localhost/newspaper.critic" />
</messages>
</facility>
</facilities>
</castle>
</configuration>
I assume this is a total crap way of dealing with the configurations,
but I get completely lost when it comes to configurations :(
Kind regards,
Dirk
On 8 mrt, 14:39, Mike Nichols <[email protected]> wrote:
> can you share your configurations?
>
> On Tue, Mar 8, 2011 at 3:41 AM, Dirk Schuermans
> <[email protected]>wrote:
>
>
>
> > Hey everyone,
>
> > I got a question in regards to starting endpoints and wether the have
> > to be in a specific order or not.
>
> > I'm working on a small sample app to understand RSB so here's the
> > following situation:
>
> > We got a newspaper and ofcourse a Reporter that writes articles.
> > In our newspaper we have a Critic that checks wether newly submitted &
> > editted articles have a certain minimum length.
> > We also got an Editor employed, this person checks new articles for
> > foul words and removes / replaces them. The editor then publishes the
> > editted article.
> > Last but not least, we have a Press, which, obviously, prints our
> > article in our newspaper and let our reporter know that his article
> > got printed.
>
> > So, quick overview:
>
> > Reporter -> Submit new article -> Critic & Editor both receive new
> > article -> Critic checks if length is valid, editor waits with editing
> > untill approval from critic -> Critic sends out approval -> Editor
> > receives approval and edits the article -> Editor publishes editted
> > article -> Critic & Press receive editted article -> Critic checks
> > length of the modified article, press waits untill approval from
> > critic -> Critic sends out approval -> Press receives approval and
> > prints the article -> Press notifies reporter that his article got
> > printed.
>
> > There, hope I'm making myself clear :x
>
> > Anyhow, in that system I've also built-in a way that I can use an
> > admin console to start / stop those agents (Critic, Reporter & Press)
> > But apperantly, when I first start the system I'll have to start it
> > twice to make sure each of the agents know where they're getting their
> > messages from etc.
>
> > If I only do it once for example and I start in the following order
> > (leaving Press out of the question, isn't finished yet):
>
> > Critic > Editor
>
> > Then Critic will be able to send his approval to the editor, but the
> > editor won't be able to send his editted article to the critic (since
> > there aren't any subscribers to the editted article message.
>
> > When I start like this:
>
> > Editor > Critic
>
> > Then the Critic isn't able to send his approval to the editor but the
> > editor will most likely be able to send his editted article to the
> > critic
>
> > But when I start them twice in a row:
>
> > Critic > Editor > Critic > Editor
>
> > Then it all works (ofcourse, without purging subqueues after the first
> > start)
>
> > So I'm wondering if it is supposed to be like this, or am I totally
> > missing something?
>
> > --
> > 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.- Tekst uit
> >oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -
--
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.