The web app has its own end point, the background service has its own
endpoint.

On Tue, Jan 20, 2009 at 9:27 AM, chrisortman <[email protected]> wrote:

>
> In an environment where you have a web app that sends messages and a
> background service that will do the processing/receiving should the
> endpoint in facility/bus point to the same place.
> I think what is happening to me is that both my web app and service
> compete for the message and the web app is getting there first so it
> moves it to the discarded queue..
>
> On Jan 19, 7:59 pm, Ayende Rahien <[email protected]> wrote:
> > Yes, exactly.
> >
> > On Mon, Jan 19, 2009 at 8:27 PM, chrisortman <[email protected]>
> wrote:
> >
> > > light bulb...
> > > So I have 1 guy that owns a particular message.
> > > other guys are going to send those messages to him.
> >
> > > ?Rule: If you are not the message owner you should not call publish or
> > > notify on the message?
> >
> > > What I was doing was in my web app, user clicks submit order and then
> > > the controller would Notify(OrderSubmitted) and then there might be
> > > any number of handlers that would deal with the submitted order. I was
> > > using notify because I thought that the correct way to express that
> > > there could be N handlers for the particular message. But what I
> > > should be doing is in my controller doing a Send(OrderSubmitted) and
> > > then have my consumer for that publish a different message?
> >
> > > On Jan 19, 5:56 pm, Ayende Rahien <[email protected]> wrote:
> > > > It is the guy who is responsible for publishing the message, and the
> guy
> > > who
> > > > gets the message when you send it.
> > > > Did you start the service?
> > > > Did you register your message consumers in the container?
> >
> > > > On Mon, Jan 19, 2009 at 5:27 PM, chrisortman <[email protected]>
> > > wrote:
> >
> > > > > Is the message owner the guy handling the message or the guy
> sending
> > > > > the message?
> >
> > > > > In my scenario they are really the same I think...
> >
> > > > > In my facilities.config
> > > > > <facility id="rhino.esb" >
> > > > >                        <bus threadCount="1"
> > > > >           numberOfRetries="5"
> >
> > > > > logEndpoint="msmq://localhost/myapp.log"
> > > > >           endpoint="msmq://localhost/myapp.backend"
> > > > >             />
> > > > >                        <messages>
> > > > >                                <add name="MyApp.Messages"
> > > > >             endpoint="msmq://localhost/myapp.backend"/>
> > > > >                        </messages>
> > > > >                </facility>
> >
> > > > > Then I have this message class
> > > > > namespace MyApp.Messages {
> > > > >  public class SimpleMessage {
> > > > >  public string Content {get;set;}
> > > > >  }
> > > > > }
> >
> > > > > I then have a  MR controller
> > > > > public class MyController {
> >
> > > > >  public void Submit(string content)  {
> > > > >     var bus = IoC.Resolve<IServiceBus>();
> > > > >     var message = new SimpleMessage(content);
> > > > >     bus.Notify(message); //nothing to do because there are no
> > > > > subscribers
> > > > >  }
> > > > > }
> >
> > > > > Now, I had been planning on _not_ setting up a separate service to
> > > > > handle messages and instead just have everything live in my web
> > > > > application. Is that really really bad or just bad? Maybe that is
> why
> > > > > I am so confused?
> >
> > > > > On Jan 19, 4:09 pm, Ayende Rahien <[email protected]> wrote:
> > > > > > a) usually... yes. b) no, you don't.
> > > > > > You need to register this in the message owner's configuration.
> >
> > > > > > <castle>
> >
> > > > > > <facilities>
> >
> > > > > > <facility id="rhino.esb" >
> >
> > > > > > <bus threadCount="1"
> >
> > > > > >  numberOfRetries="5"
> >
> > > > > >  endpoint="msmq://localhost/nhprof.backend"
> >
> > > > > >              />
> >
> > > > > > <messages>
> >
> > > > > > <add name="NHProfilerWeb.Backend.InternalMessages"
> >
> > > > > >  endpoint="msmq://localhost/nhprof.backend"/>
> >
> > > > > > <add name="NHProfilerWeb.Messages"
> >
> > > > > >  endpoint="msmq://localhost/nhprof.backend"/>
> >
> > > > > > </messages>
> >
> > > > > > </facility>
> >
> > > > > > </facilities>
> >
> > > > > > On Mon, Jan 19, 2009 at 4:43 PM, chrisortman <
> [email protected]>
> > > > > wrote:
> >
> > > > > > > Sorry, I don't think I understand...
> >
> > > > > > > a) Are you saying that there will always be other endpoints?
> >
> > > > > > > b)
> > > > > > > I need to define in my application something like this?
> > > > > > > public class Something : ConsumerOf<AdministrativeMessage> {
> > > > > > >  public void Consume(AdministrativeMessage m) {
> > > > > > >   //nothing to do here
> > > > > > >   }
> > > > > > > }
> >
> > > > > > > On Jan 19, 3:20 pm, Ayende Rahien <[email protected]> wrote:
> > > > > > > > a) you assume that there are other end points.b) make sure
> that
> > > you
> > > > > have
> > > > > > > > message owners defined for the bus' messages, that will
> handle
> > > the
> > > > > > > > subscriptions.
> >
> > > > > > > > On Mon, Jan 19, 2009 at 4:03 PM, chrisortman <
> > > [email protected]>
> > > > > > > wrote:
> >
> > > > > > > > > I think why I am getting confused is that whatever bus i
> use to
> > > > > Send|
> > > > > > > > > Notify|Publish should be an implicit subscriber since it
> can
> > > > > consume
> > > > > > > > > its own messages. Otherwise I can't see why to use
> > > Notify|Publish
> > > > > if
> > > > > > > > > there are no other endpoints.
> >
> > > > > > > > > On Jan 19, 2:05 pm, Ayende Rahien <[email protected]>
> wrote:
> > > > > > > > > > No, because discarded messages are for _arriving_
> messages.
> >
> > > > > > > > > > On Mon, Jan 19, 2009 at 2:43 PM, chrisortman <
> > > > > [email protected]>
> > > > > > > > > wrote:
> >
> > > > > > > > > > > Currently when doing IServiceBus.Notify(message)
> nothing
> > > > > happens if
> > > > > > > > > > > there are no subscribers.
> > > > > > > > > > > Should this also generate a discarded message?
> >
> > > > > > > > > > > On Jan 19, 11:04 am, Ayende Rahien <[email protected]>
> > > wrote:
> > > > > > > > > > > > That is an extremely common approach.
> > > > > > > > > > > > For that matter, here is the real configuration
> behind
> > > the NH
> > > > > > > Prof
> > > > > > > > > > > website:
> >
> > > > > > > > > > > > <castle>
> >
> > > > > > > > > > > > <facilities>
> >
> > > > > > > > > > > > <facility id="rhino.esb" >
> >
> > > > > > > > > > > > <bus threadCount="1"
> >
> > > > > > > > > > > >  numberOfRetries="5"
> >
> > > > > > > > > > > >  endpoint="msmq://localhost/nhprof.backend"
> >
> > > > > > > > > > > >              />
> >
> > > > > > > > > > > > <messages>
> >
> > > > > > > > > > > > <add name="NHProfilerWeb.Backend.InternalMessages"
> >
> > > > > > > > > > > >  endpoint="msmq://localhost/nhprof.backend"/>
> >
> > > > > > > > > > > > <add name="NHProfilerWeb.Messages"
> >
> > > > > > > > > > > >  endpoint="msmq://localhost/nhprof.backend"/>
> >
> > > > > > > > > > > > </messages>
> >
> > > > > > > > > > > > </facility>
> >
> > > > > > > > > > > > </facilities>
> >
> > > > > > > > > > > > On Mon, Jan 19, 2009 at 12:00 PM, chrisortman <
> > > > > > > [email protected]
> >
> > > > > > > > > > > wrote:
> >
> > > > > > > > > > > > > Does it violate anything if the same bus that sends
> the
> > > > > message
> > > > > > > is
> > > > > > > > > > > > > also the one that is watching that queue?
> >
> > > > > > > > > > > > > Lets say I have 2 apps.
> > > > > > > > > > > > > 1 NHProf website
> > > > > > > > > > > > > 2 Windows Service that does order processing
> >
> > > > > > > > > > > > > So in the web app I would do something like
> > > > > > > > > > > > >   <facility id="rhino.esb" >
> > > > > > > > > > > > >                        <bus threadCount="1"
> > > > > > > > > > > > >           numberOfRetries="5"
> > > > > > > > > > > > >            endpoint="msmq://localhost/nhprof.web"
> > > > > > > > > > > > >             />
> > > > > > > > > > > > >                        <messages>
> > > > > > > > > > > > >                                <add name="nhprof"
> > > > > > > > > > > > >
> endpoint="msmq://localhost/nhprof.orders"/>
> > > > > > > > > > > > >                        </messages>
> > > > > > > > > > > > > </facility>
> >
> > > > > > > > > > > > > And then the service app:
> > > > > > > > > > > > >  <facility id="rhino.esb" >
> > > > > > > > > > > > >                        <bus threadCount="1"
> > > > > > > > > > > > >           numberOfRetries="5"
> > > > > > > > > > > > >            endpoint="msmq://localhost/nhprof.svc"
> > > > > > > > > > > > >             />
> > > > > > > > > > > > >                        <messages>
> > > > > > > > > > > > >                                <add name="nhprof"
> > > > > > > > > > > > >
> endpoint="msmq://localhost/nhprof.orders"/>
> > > > > > > > > > > > >                        </messages>
> > > > > > > > > > > > > </facility>
> > > > > > > > > > > > > On Jan 19, 10:53 am, Ayende Rahien <
> [email protected]>
> > > > > wrote:
> > > > > > > > > > > > > > No, there is an assumption that that queue
> exists.
> >
> > > > > > > > > > > > > > On Mon, Jan 19, 2009 at 11:50 AM, chrisortman <
> > > > > > > > > [email protected]
> >
> > > > > > > > > > > > > wrote:
> >
> > > > > > > > > > > > > > > Is there an assumption then that there exists a
> bus
> > > > > that is
> > > > > > > > > > > watching
> > > > > > > > > > > > > > > that endpoint?
> >
> > > > > > > > > > > > > > > On Jan 19, 10:27 am, Ayende Rahien <
> > > [email protected]>
> > > > > > > wrote:
> > > > > > > > > > > > > > > > inline
> >
> > > > > > > > > > > > > > > > On Mon, Jan 19, 2009 at 10:43 AM, chrisortman
> <
> > > > > > > > > > > [email protected]
> >
> > > > > > > > > > > > > > > wrote:
> >
> > > > > > > > > > > > > > > > > Is it correct to say that a Discarded
> message
> > > is
> > > > > any
> > > > > > > > > message
> > > > > > > > > > > that
> > > > > > > > > > > > > > > > > arrives at an endpoint but has no consumers
> > > > > registered
> > > > > > > for
> > > > > > > > > it?
> >
> > > > > > > > > > > > > > > > yes
> > > > > > > > > > > > > > > > another option is that this is a saga message
> > > that
> > > > > > > doesn't
> > > > > > > > > have a
> > > > > > > > > > > > > saga
> > > > > > > > > > > > > > > > instance to orchestrate it.
> >
> > > > > > > > > > > > > > > > > I am also not understanding why messages
> have
> > > their
> > > > > own
> > > > > > > > > > > endpoint or
> > > > > > > > > > > > > > > > > when they should share the same endpoint as
> the
> > > > > bus?
> >
> > > > > > > > > > > > > > > > > I am running the trunk right now, and when
> I
> > > use
> > > > > this
> > > > > > > as my
> > > > > > > > > > > config
> > > > > > > > > > > > > > > > > <facility id="rhino.esb" >
> > > > > > > > > > > > > > > > >                        <bus threadCount="1"
> > > > > > > > > > > > > > > > >           numberOfRetries="5"
> >
> > > > > > > > > > > > > > > > > logEndpoint="msmq://localhost/my.log"
> > > > > > > > > > > > > > > > >           endpoint="msmq://localhost/rhino"
> >
> > ...
> >
> > read more ยป
> >
>

--~--~---------~--~----~------------~-------~--~----~
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