1
0
mirror of synced 2024-11-22 01:13:49 +00:00

[ci skip] More documentation, only parallel and transient requests remaining

This commit is contained in:
Mark van Renswoude 2019-08-15 15:36:40 +02:00
parent dcd0436f30
commit 46ea070865
3 changed files with 27 additions and 2 deletions

View File

@ -7,7 +7,7 @@ namespace Tapeti.Annotations
/// Can be attached to a message class to specify that the receiver of the message must /// Can be attached to a message class to specify that the receiver of the message must
/// provide a response message of the type specified in the Response attribute. This response /// provide a response message of the type specified in the Response attribute. This response
/// must be sent by either returning it from the message handler method or using /// must be sent by either returning it from the message handler method or using
/// YieldWithResponse when using Tapeti Flow. These methods will respond directly /// EndWithResponse when using Tapeti Flow. These methods will respond directly
/// to the queue specified in the reply-to header automatically added by Tapeti. /// to the queue specified in the reply-to header automatically added by Tapeti.
/// </summary> /// </summary>
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]

View File

@ -73,7 +73,7 @@ The queue attribute can be either *DynamicQueue* or *DurableQueue*. The attribut
DynamicQueue will create a queue with a name generated by RabbitMQ which is automatically deleted when your service stops. Bindings will be added for the messages handled by the controller. You will typically use dynamic queues for scenarios where handling the message is only relevant while the service is running (for example, updating a service's cache or performing live queries). DynamicQueue will create a queue with a name generated by RabbitMQ which is automatically deleted when your service stops. Bindings will be added for the messages handled by the controller. You will typically use dynamic queues for scenarios where handling the message is only relevant while the service is running (for example, updating a service's cache or performing live queries).
DurableQueue requires a queue name as the parameter. By default, the queue is assumed to be present already and Tapeti will throw an exception if it does not. If you want Tapeti to create and update the durable queues as well, see :doc:`indepth` for use of EnableDeclareDurableQueues. DurableQueue requires a queue name as the parameter. By default, the queue is assumed to be present already and Tapeti will throw an exception if it does not. If you want Tapeti to create and update the durable queues as well, see :ref:`declaredurablequeues` in :doc:`indepth`.
:: ::

View File

@ -8,6 +8,31 @@ As described in the Getting started guide, a message is a plain object which can
When communicating between services it is considered best practice to define messages in separate class library assemblies which can be referenced in other services. This establishes a public interface between services and components without binding to the implementation. When communicating between services it is considered best practice to define messages in separate class library assemblies which can be referenced in other services. This establishes a public interface between services and components without binding to the implementation.
.. _declaredurablequeues:
Durable queues
--------------
Before version 2.0, and still by default in the newer versions, Tapeti assumes all durable queues are set up with the proper bindings before starting the service.
However, since this is very inconvenient you can enable Tapeti to manage durable queues as well. There are two things to keep in mind when enabling this functionality:
#) The `RabbitMQ management plugin <https://www.rabbitmq.com/management.html>`_ must be enabled
#) The queue name must be unique to the service to prevent conflicting updates to the bindings
To enable the automatic creation of durable queues, call EnableDeclareDurableQueues or SetDeclareDurableQueues on the TapetiConfig:
::
var config = new TapetiConfig(new SimpleInjectorDependencyResolver(container))
.EnableDeclareDurableQueues()
.RegisterAllControllers()
.Build();
The queue will be bound to all message classes for which you have defined a message handler. If the queue already existed and contains bindings which are no longer valid, those bindings will be removed. Note however that if there are still messages of that type in the queue they will be consumed and cause an exception.
At the time of writing there is no special support for obsolete queues. Once a durable queue is no longer referenced in the service it will remain in RabbitMQ along with any messages in it, without a consumer. This allows you to inspect the contents, perform any migrating steps necessary and delete the queue manually.
Request - response Request - response
------------------ ------------------