Is this patch added to the trunk ?
On Jan 19, 8:06 pm, Ayende Rahien <[email protected]> wrote:
> Please zip it here.
> Mike, can you review that?
>
> On Mon, Jan 19, 2009 at 2:02 PM, chrisortman <[email protected]> wrote:
>
> > Here's a patch for that
>
> > From 5dc1b09401ae6e9c5cd719025c57121dd293aa34 Mon Sep 17 00:00:00 2001
> > From: Chris Ortman <[email protected]>
> > Date: Mon, 19 Jan 2009 13:00:33 -0600
> > Subject: [PATCH] Allows the FlatQueueStrategy to create its subqueues
> > on demand.
>
> > ---
> > .../MsmqFlatQueueTestBase.cs | 67 +++++++++
> > +----------
> > ...rializableMessageWillBeForwardedToErrorQueue.cs | 1 +
> > .../Impl/RhinoServiceBusFacility.cs | 8 +++
> > .../Rhino.ServiceBus/Msmq/FlatQueueStrategy.cs | 17 ++++-
> > .../Rhino.ServiceBus/Msmq/IInitializeSubQueues.cs | 33 ++++++++++
> > .../Rhino.ServiceBus/Msmq/IQueueStrategy.cs | 1 +
> > .../Rhino.ServiceBus/Msmq/MsmqExtensions.cs | 8 ++-
> > .../Rhino.ServiceBus/Msmq/MsmqTransport.cs | 14 ++++
> > .../Rhino.ServiceBus/Msmq/MsmqUtil.cs | 4 +-
> > .../Rhino.ServiceBus/Msmq/SubQueueStrategy.cs | 5 ++
> > .../Rhino.ServiceBus/Rhino.ServiceBus.csproj | 1 +
> > 11 files changed, 119 insertions(+), 40 deletions(-)
> > create mode 100644 rhino-service.bus/Rhino.ServiceBus/Msmq/
> > IInitializeSubQueues.cs
>
> > diff --git a/rhino-service.bus/Rhino.ServiceBus.Tests/
> > MsmqFlatQueueTestBase.cs b/rhino-service.bus/Rhino.ServiceBus.Tests/
> > MsmqFlatQueueTestBase.cs
> > index a08b167..0f0f89a 100644
> > --- a/rhino-service.bus/Rhino.ServiceBus.Tests/
> > MsmqFlatQueueTestBase.cs
> > +++ b/rhino-service.bus/Rhino.ServiceBus.Tests/
> > MsmqFlatQueueTestBase.cs
> > @@ -64,46 +64,47 @@ namespace Rhino.ServiceBus.Tests
> > if (MessageQueue.Exists(transactionalTestQueuePath) ==
> > false)
> > MessageQueue.Create(transactionalTestQueuePath,
> > true);
>
> > - if (MessageQueue.Exists(testQueuePath + errorsPathSuffix)
> > == false)
> > - MessageQueue.Create(testQueuePath +
> > errorsPathSuffix);
> > -
> > - if (MessageQueue.Exists(testQueuePath2 +
> > errorsPathSuffix) == false)
> > - MessageQueue.Create(testQueuePath2 +
> > errorsPathSuffix);
> > -
> > - if (MessageQueue.Exists(transactionalTestQueuePath +
> > errorsPathSuffix) == false)
> > - MessageQueue.Create(transactionalTestQueuePath +
> > errorsPathSuffix, true);
> > -
> > - if (MessageQueue.Exists(testQueuePath +
> > discardedPathSuffix) == false)
> > - MessageQueue.Create(testQueuePath +
> > discardedPathSuffix);
>
> > queue = new MessageQueue(testQueuePath);
> > queue.Purge();
>
> > - using (var errQueue = new MessageQueue(testQueuePath +
> > errorsPathSuffix))
> > - {
> > - errQueue.Purge();
> > - }
> > -
> > - using (var discardedQueue = new MessageQueue
> > (testQueuePath + discardedPathSuffix))
> > - {
> > - discardedQueue.Purge();
> > - }
> > -
> > - testQueue2 = new MessageQueue(testQueuePath2);
> > +
> > if(MessageQueue.Exists(testQueuePath+ errorsPathSuffix))
> > + {
> > + using (var errQueue
> > = new MessageQueue(testQueuePath +
> > errorsPathSuffix))
> > + {
> > +
> > errQueue.Purge();
> > + }
> > + }
> > +
> > +
> > if(MessageQueue.Exists(testQueuePath+discardedPathSuffix))
> > + {
> > + using (var discardedQueue =
> > new MessageQueue(testQueuePath +
> > discardedPathSuffix))
> > + {
> > +
> > discardedQueue.Purge();
> > + }
> > + }
> > +
> > + testQueue2 = new MessageQueue(testQueuePath2);
> > testQueue2.Purge();
>
> > - using (var errQueue2 = new MessageQueue(testQueuePath2 +
> > errorsPathSuffix))
> > - {
> > - errQueue2.Purge();
> > - }
> > +
> > if(MessageQueue.Exists(testQueuePath2+errorsPathSuffix))
> > + {
> > + using (var errQueue2 = new
> > MessageQueue(testQueuePath2 +
> > errorsPathSuffix))
> > + {
> > + errQueue2.Purge();
> > + }
> > + }
>
> > - transactionalQueue = new MessageQueue
> > (transactionalTestQueuePath);
> > + transactionalQueue = new MessageQueue
> > (transactionalTestQueuePath);
> > transactionalQueue.Purge();
>
> > - using (var errQueue3 = new MessageQueue
> > (transactionalTestQueuePath + errorsPathSuffix))
> > - {
> > - errQueue3.Purge();
> > - }
> > + if (MessageQueue.Exists(transactionalTestQueuePath +
> > errorsPathSuffix))
> > + {
> > + using (var errQueue3 = new MessageQueue
> > (transactionalTestQueuePath + errorsPathSuffix))
> > + {
> > + errQueue3.Purge();
> > + }
> > + }
>
> > subscriptions = new MessageQueue(subbscriptionQueuePath)
> > {
> > @@ -122,7 +123,7 @@ namespace Rhino.ServiceBus.Tests
> > new XmlMessageSerializer(
> > new DefaultReflection(),
> > new DefaultKernel()), TestQueueUri, 1,
> > - DefaultMessageActions(TestQueueUri));
> > + DefaultMessageActions(TestQueueUri))
> > { SubQueueInitializer = new FlatQueueSubQueueInitializer()};
> > transport.Start();
> > }
> > return transport;
> > @@ -150,7 +151,7 @@ namespace Rhino.ServiceBus.Tests
> > if (transactionalTransport == null)
> > {
> > transactionalTransport = new MsmqTransport(new
> > XmlMessageSerializer(new DefaultReflection(), new DefaultKernel()),
> > -
> > TransactionalTestQueueUri, 1, DefaultMessageActions
> > (TransactionalTestQueueUri));
> > +
> > TransactionalTestQueueUri, 1, DefaultMessageActions
> > (TransactionalTestQueueUri) ){ SubQueueInitializer = new
> > FlatQueueSubQueueInitializer()};
> > transactionalTransport.Start();
> > }
> > return transactionalTransport;
> > diff --git a/rhino-service.bus/Rhino.ServiceBus.Tests/
> > UnserializableMessageWillBeForwardedToErrorQueue.cs b/rhino-
> > service.bus/Rhino.ServiceBus.Tests/
> > UnserializableMessageWillBeForwardedToErrorQueue.cs
> > index 60110b7..04db6a9 100644
> > --- a/rhino-service.bus/Rhino.ServiceBus.Tests/
> > UnserializableMessageWillBeForwardedToErrorQueue.cs
> > +++ b/rhino-service.bus/Rhino.ServiceBus.Tests/
> > UnserializableMessageWillBeForwardedToErrorQueue.cs
> > @@ -36,6 +36,7 @@ namespace Rhino.ServiceBus.Tests
> > Assert.True(wasCalled);
> > }
> > }
> > +
> > public class
> > UnserializableMessageWillBeForwardedToFlattenedErrorQueue :
> > MsmqFlatQueueTestBase
> > {
> > [Fact]
> > diff --git a/rhino-service.bus/Rhino.ServiceBus/Impl/
> > RhinoServiceBusFacility.cs b/rhino-service.bus/Rhino.ServiceBus/Impl/
> > RhinoServiceBusFacility.cs
> > index 30a791a..b39ba30 100644
> > --- a/rhino-service.bus/Rhino.ServiceBus/Impl/
> > RhinoServiceBusFacility.cs
> > +++ b/rhino-service.bus/Rhino.ServiceBus/Impl/
> > RhinoServiceBusFacility.cs
> > @@ -109,6 +109,14 @@ namespace Rhino.ServiceBus.Impl
> > .ImplementedBy(serializerImpl)
> > );
>
> > + if(queueStrategyImpl ==
> > typeof(FlatQueueStrategy))
> > + {
> > + Kernel.Register(
> > +
> > Component.For<IInitializeSubQueues>()
> > +
> > .ImplementedBy<FlatQueueSubQueueInitializer>()
> > + );
> > + }
> > +
> > Kernel.Register(
> > AllTypes.Of<IMessageAction>()
> > .FromAssembly(typeof(IMessageAction).Assembly)
> > diff --git a/rhino-service.bus/Rhino.ServiceBus/Msmq/
> > FlatQueueStrategy.cs b/rhino-service.bus/Rhino.ServiceBus/Msmq/
> > FlatQueueStrategy.cs
> > index 6872c60..7e1a35f 100644
> > --- a/rhino-service.bus/Rhino.ServiceBus/Msmq/FlatQueueStrategy.cs
> > +++ b/rhino-service.bus/Rhino.ServiceBus/Msmq/FlatQueueStrategy.cs
> > @@ -62,7 +62,8 @@ namespace Rhino.ServiceBus.Msmq
> > /// <param name="message">The message.</param>
> > public void MoveToErrorsQueue(MessageQueue queue, Message
> > message)
> > {
> > - using (var destinationQueue = new
> > MessageQueue(GetErrorsQueuePath
> > (), QueueAccessMode.Send))
> > +
> > + using (var destinationQueue = new
> > MessageQueue(GetErrorsQueuePath
> > (),QueueAccessMode.Send))
> > {
>
> > destinationQueue.Send(queue.ReceiveByLookupId(message.LookupId),
>
> > queue.GetTransactionType());
> > @@ -77,7 +78,7 @@ namespace Rhino.ServiceBus.Msmq
> > /// <param name="message">The message.</param>
> > public void MoveToDiscardedQueue(MessageQueue queue, Message
> > message)
> > {
> > - using (var destinationQueue = new MessageQueue
> > (GetDiscardedQueuePath(), QueueAccessMode.Send))
> > + using (var destinationQueue = new
>
> ...
>
> 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
-~----------~----~----~----~------~----~------~--~---