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