Ah, think I found the issue. The publisher's bus was pointing to the
same queue where I was publishing messages to. Therefore, both the
publisher and consumer were trying to read messages off same queue
(seems I had inadvertently set up competing consumers). When the
message was picked up by consumer process everything was fine because
I had a ConsumerOf<T> registered in the container. But when it was
picked up by producer, I didn't have any ConsumerOf<T> registered, so
message was dumped to discarded queue.

hth someone else

cheers

On Nov 18, 2:49 am, Ayende Rahien <[email protected]> wrote:
> Enable logging, and try to see why it is ending up there.
>
> On Tue, Nov 17, 2009 at 9:14 PM, Andrew <[email protected]> wrote:
>
> > Attempting to get the most simple of scenarios going here where I just
> > do a straightforward pub-sub between 1 publisher and 1 consumer. The
> > problem I am experiencing is that most of the messages I publish are
> > ending up in the 'discarded' queue, not in my handler, although a few
> > of them are processed correctly. I must be missing something obvious,
> > but can't figure out what! Any suggestions?
>
> > My code and config below:
>
> > Producer config:
> > --------------------
> > <castle>
> >        <facilities>
> >                <facility id="rhino.esb.sender" >
> >                        <bus threadCount="1" numberOfRetries="5"
> > endpoint="msmq://localhost/
> > My.queue" DisableAutoQueueCreation="false" />
> >                        <messages>
> >                                <add name="My.Messages"
> > endpoint="msmq://localhost/My.queue"/>
> >                        </messages>
> >                </facility>
> >        </facilities>
> > </castle>
>
> > Producer code:
> > --------------------
> > var container = new WindsorContainer(new XmlInterpreter
> > ("RhinoEsbSettings.xml"));
> > RhinoServiceBusFacility facility = new RhinoServiceBusFacility();
> > container.Kernel.AddFacility("rhino.esb.sender", facility);
>
> > var bus = container.Resolve<IStartableServiceBus>();
> > bus.Start();
>
> > while (true)
> > {
> >        ViewInitialized msg = new ViewInitialized {ViewInstanceId =
> > Guid.NewGuid()};
> >        Console.WriteLine("Sending ViewInitialized message for view '{0}'",
> > msg.ViewInstanceId);
> >        bus.Send(msg);
> >        Console.ReadLine();
> > }
>
> > Consumer config:
> > ---------------------
> > <castle>
> >        <facilities>
> >                <facility id="rhino.esb.receiver" >
> >                        <bus threadCount="1" numberOfRetries="5"
> > endpoint="msmq://localhost/
> > My.queue" DisableAutoQueueCreation="false" />
> >                        <messages>
> >                                <add name="My.Messages"
> > endpoint="msmq://localhost/My.queue" />
> >                        </messages>
> >                </facility>
> >        </facilities>
> > </castle>
>
> > Consumer code:
> > ----------------------
> > var container = new WindsorContainer(new XmlInterpreter
> > ("RhinoEsbSettings.xml"));
> > container.Register(Component.For<ConsumerOf<ViewInitialized>>
> > ().ImplementedBy<DummyReceiver>().LifeStyle.Transient);
>
> > RhinoServiceBusFacility facility = new RhinoServiceBusFacility();
> > container.Kernel.AddFacility("rhino.esb.receiver", facility);
>
> > var bus = container.Resolve<IStartableServiceBus>();
>
> > bus.Start();
> > Console.WriteLine("Ready to receive ViewInitialized messages");
> > Console.ReadLine();
>
> > Receiver class:
> > -------------------
> >        public class DummyReceiver : ConsumerOf<ViewInitialized>
> >        {
> >                #region Implementation of ConsumerOf<ViewInitialized>
> >                public void Consume(ViewInitialized message)
> >                {
> >                        Console.WriteLine("Received ViewInitialized message
> > for view
> > '{0}'", message.ViewInstanceId);
> >                }
> >                #endregion
> >        }
>
> > Thanks
> > --~--~---------~--~----~------------~-------~--~----~
> > 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]<rhino-tools-dev%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/rhino-tools-dev?hl=en
> > -~----------~----~----~----~------~----~------~--~---
>
>

--

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].
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=.


Reply via email to