Use MessageDeliveryModeStrategy

Here are fixes that I missed introducing MessageDeliveryModeStrategy
Added support for infinite timeout in PersistentChannel.cs
Make auto subscriber test less fragile to new IConsumers
Add exception handling around responder function, to avoid timeout on the client when the exception is thrown before the task is returned.
Merge pull request #249 from micdenny/master

Add exception handling around responder function, to avoid timeout on the client...
Merge pull request #253 from tmutton/master

Added support for infinite timeout in PersistentChannel.cs
Update Version.cs
Consumer configuration added to auto subscriber
Test: ReflectionHelpersTests.ShouldPerformFasterThanGetCustomAttributes made explicit. Failing on build server.
Merge pull request #255 from philiphoy/master

Added the ability to configuration subscription for autosubscriber
Merge remote-tracking branch 'upstream/master' into persisten-attribute-fix

Conflicts:
	Source/EasyNetQ/RabbitBusExtensions.cs
Test: ReflectionHelpersTests.ShouldPerformFasterThanGetCustomAttributes made explicit, failing on build server.
Merge branch 'master' of github.com:mikehadlow/EasyNetQ
Merge pull request #252 from Pliner/persisten-attribute-fix

Use MessageDeliveryModeStrategy
Initial ConsumeSingle implementation.
A bit of fun with reflection

I found a usage of costly reflection functions: GetCustomAttributes and
Activator.CreateInstance(http://msdn.microsoft.com/en-us/magazine/cc163759.aspx#S1).

Here is an attempt to cache reflection calls. Also, perfomance tests are
included.

Conflicts:
	Source/EasyNetQ.Tests/ReflectionHelpersTests.cs
	Source/EasyNetQ/Producer/Rpc.cs
	Source/EasyNetQ/ReflectionHelpers.cs
Fix bug and cache with static initialization
1. Split IPublishExchangeDeclareStrategy in two..
  * PublishExchangeDeclareStrategy was referring directly to the container. Moved to constructor
  * Split interface in two: An advanced and a convention based one.
Extract conventions from Rpc/restructure.
	a) I don't agree with the request/response implementation
	  - There can only be one rpc-service for each (Type x Type).
	  - The responseQueue handling is not necessary.
	  It implies that a service can only have 1 consumer for each (Type x Type), since their keys would conflict.
	  (So in that sense it is really unnecessary that it is a Concurrent one)
	  - For the same reason the request-queue is exclusive. This can cause downtime if an old connection is not timed out when restarting a service.

	EasyNetQ should be able to support several servers IMO -- all the hard work is already done in rabbit.
	--
	On rabbit this rpc pattern is usually done with a random queue per response. Set expires (a bit larger than the timeout), so that we will not cloud the rabbit server.

	Here is the high-level scheme I have used before

	0. The server declares a request-queue which subscribes to some routingkey.
	1. The client creates a response queue with random name. Sets the expires to something more than the response timeout.
	2. The client decides the response routingkey (could just be the response-queue-name), and puts it in the request message header.
	3. The client publishes the request message
	4. The server receives the request, calls the handler, and gets the response.
	5. The server extracts the response routingkey from the request-header, and publishes the response message (maybe also propagate a correlation id)

	Then we don't need the response queue management and the response-queue management is kept local in the handler method.

	b) EasyNetQ is using a direct exchange (the default) for the rpc. It makes sense for the response queues, but I think it is a real pity for the requests.

	If the request publish happens in a topic exchange, we can have different contexts (topics) of rpc for the same request/reply types.
	Other services might be interested in the messages as well. For logging, monitoring, etc.

	c) I don't see why the client and the server implementation is mixed to such an extent. I have split it in two, since it started to confuse me.

	d) Added handler-id (subscription-id) to respond -- just like it is possible for IBus.Subscribe(). Added a generator, RpcRequestQueueNameConvention, in IConvention
	   Implemented like:
	     RpcRequestQueueNameConvention = (type, id) => "Rpc:"+QueueNamingConvention(type,id);

	e) An rpc request queue should expire+autodelete. It doesn't make sense to handle an old message. The client times out anyway.

	f) Due to e we want to cancel the response consume when we have consumed 1 message. I would like you to take a look at this one:

		class AdvancedClientRpc {

			//...

			private void SubscribeToResponse(string responseQueueName)
			{
				//...
				//the response is published to the default exchange with the queue name as routingkey. So no need to bind to exchange
				var disposeWhenSet = new DisposeWhenSet();
				var consumingDisposer = _advancedBus.Consume(queue, (bytes, msgProp, messageReceivedInfo) => Task.Factory.StartNew(() =>
				{
					ResponseAction responseAction;
					if (responseActions.TryRemove(msgProp.CorrelationId, out responseAction))
					{
						responseAction.OnSuccess(new SerializedMessage(msgProp, bytes));
					}
					disposeWhenSet.DisposeObject();
				}));
				disposeWhenSet.Disposable = consumingDisposer;
				//...
			}
			//...
		}

		I needed to add a wrapper for disposing the consumption. But it stinks like something that can cause a dead-lock. (The dispose call waiting for the task to finish.)
		Looking at InternalConsumer.Dispose() though..
			public void Dispose()
			{
				if (disposed) return;
				disposed = true;

				var model = Model;
				if (model != null)
				{
					// Queued because we may be on the RabbitMQ.Client dispatch thread.
					consumerDispatcher.QueueAction(() =>
						{
							Model.Dispose();
							eventBus.Publish(new ConsumerModelDisposedEvent(ConsumerTag));
						});
				}
			}
		... it seems to be safe.
		It is probably much better to add a ConsumeSingle to the advanced api.

IRpc and Rpc is unchanged. So the solution is backwards compatible. I have made another implementation BetterRpc (Feel free to rename), which uses the new scheme. The two implementation are switchable in ComponentRegistration

Conflicts:
	Source/EasyNetQ/Producer/Rpc.cs
Added advanced rpc to IAdvancedBus + Moved rpc stuff to own folder

Conflicts:
	Source/EasyNetQ/IAdvancedBus.cs
	Source/EasyNetQ/RabbitAdvancedBus.cs