Class AbstractMessagingTemplate<D>
public abstract class AbstractMessagingTemplate<D> : AbstractMessageReceivingTemplate<D>, IMessageSendingOperations<D>, IMessageReceivingOperations<D>, IMessageRequestReplyOperations<D>
Type Parameters
D
- Inheritance
-
AbstractMessagingTemplate<D>
- Implements
- Derived
- Inherited Members
Methods
ConvertSendAndReceiveAsync<T>(object, IMessagePostProcessor, CancellationToken)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to a default destination after applying the post processor, receive the reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(object request, IMessagePostProcessor requestPostProcessor, CancellationToken cancellationToken = default)
Parameters
request
objectpayload for the request message to send
requestPostProcessor
IMessagePostProcessorthe post processor to apply
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the target type of the reply
ConvertSendAndReceiveAsync<T>(object, CancellationToken)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to a default destination, receive the reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(object request, CancellationToken cancellationToken = default)
Parameters
request
objectpayload for the request message to send
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the target type of the payload
ConvertSendAndReceiveAsync<T>(D, object, IMessagePostProcessor, CancellationToken)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to the specified destination after applying the post processor, receive the reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(D destination, object request, IMessagePostProcessor requestPostProcessor, CancellationToken cancellationToken = default)
Parameters
destination
Dthe target destination
request
objectpayload for the request message to send
requestPostProcessor
IMessagePostProcessorthe post processor to apply
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the target type of the reply
ConvertSendAndReceiveAsync<T>(D, object, IDictionary<string, object>, IMessagePostProcessor, CancellationToken)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to the specified destination after applying the post processor, with the specified headers, receive the reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(D destination, object request, IDictionary<string, object> headers, IMessagePostProcessor requestPostProcessor, CancellationToken cancellationToken = default)
Parameters
destination
Dthe target destination
request
objectpayload for the request message to send
headers
IDictionary<string, object>the headers to send
requestPostProcessor
IMessagePostProcessorthe post processor to apply
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the target type of the reply
ConvertSendAndReceiveAsync<T>(D, object, IDictionary<string, object>, CancellationToken)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to a specified destination with the given headers, receive the reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(D destination, object request, IDictionary<string, object> headers, CancellationToken cancellationToken = default)
Parameters
destination
Dthe target destination
request
objectpayload for the request message to send
headers
IDictionary<string, object>the headers to send
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the target type of the payload
ConvertSendAndReceiveAsync<T>(D, object, CancellationToken)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to a specified destination, receive the reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(D destination, object request, CancellationToken cancellationToken = default)
Parameters
destination
Dthe target destination
request
objectpayload for the request message to send
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the target type of the payload
ConvertSendAndReceive<T>(object)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to a default destination, receive the reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(object request)
Parameters
request
objectpayload for the request message to send
Returns
- T
the receieved message; or null
Type Parameters
T
the target type of the payload
ConvertSendAndReceive<T>(object, IMessagePostProcessor)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to a default destination after applying the post processor, receive the reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(object request, IMessagePostProcessor requestPostProcessor)
Parameters
request
objectpayload for the request message to send
requestPostProcessor
IMessagePostProcessorthe post processor to apply
Returns
- T
the receieved message; or null
Type Parameters
T
the target type of the reply
ConvertSendAndReceive<T>(D, object)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to a specified destination, receive the reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(D destination, object request)
Parameters
destination
Dthe target destination
request
objectpayload for the request message to send
Returns
- T
the receieved message; or null
Type Parameters
T
the target type of the payload
ConvertSendAndReceive<T>(D, object, IMessagePostProcessor)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to the specified destination after applying the post processor, receive the reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(D destination, object request, IMessagePostProcessor requestPostProcessor)
Parameters
destination
Dthe target destination
request
objectpayload for the request message to send
requestPostProcessor
IMessagePostProcessorthe post processor to apply
Returns
- T
the receieved message; or null
Type Parameters
T
the target type of the reply
ConvertSendAndReceive<T>(D, object, IDictionary<string, object>)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to a specified destination with the given headers, receive the reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(D destination, object request, IDictionary<string, object> headers)
Parameters
destination
Dthe target destination
request
objectpayload for the request message to send
headers
IDictionary<string, object>the headers to send
Returns
- T
the receieved message; or null
Type Parameters
T
the target type of the payload
ConvertSendAndReceive<T>(D, object, IDictionary<string, object>, IMessagePostProcessor)
Convert the given request object to serialized form, possibly using a message converter, send it as a message to the specified destination after applying the post processor, with the specified headers, receive the reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(D destination, object request, IDictionary<string, object> headers, IMessagePostProcessor requestPostProcessor)
Parameters
destination
Dthe target destination
request
objectpayload for the request message to send
headers
IDictionary<string, object>the headers to send
requestPostProcessor
IMessagePostProcessorthe post processor to apply
Returns
- T
the receieved message; or null
Type Parameters
T
the target type of the reply
DoSendAndReceive(D, IMessage)
protected abstract IMessage DoSendAndReceive(D destination, IMessage requestMessage)
Parameters
destination
DrequestMessage
IMessage
Returns
DoSendAndReceiveAsync(D, IMessage, CancellationToken)
protected abstract Task<IMessage> DoSendAndReceiveAsync(D destination, IMessage requestMessage, CancellationToken cancellationToken = default)
Parameters
destination
DrequestMessage
IMessagecancellationToken
CancellationToken
Returns
SendAndReceive(IMessage)
Send a request message and receive the reply from a default destination.
public virtual IMessage SendAndReceive(IMessage requestMessage)
Parameters
requestMessage
IMessagethe message to send
Returns
- IMessage
the receieved message; or null
SendAndReceive(D, IMessage)
Send a request message and receive the reply from the given destination.
public virtual IMessage SendAndReceive(D destination, IMessage requestMessage)
Parameters
destination
Dthe target destination
requestMessage
IMessagethe message to send
Returns
- IMessage
the receieved message; or null
SendAndReceiveAsync(IMessage, CancellationToken)
Send a request message and receive the reply from a default destination.
public virtual Task<IMessage> SendAndReceiveAsync(IMessage requestMessage, CancellationToken cancellationToken = default)
Parameters
requestMessage
IMessagethe message to send
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
SendAndReceiveAsync(D, IMessage, CancellationToken)
Send a request message and receive the reply from the given destination.
public virtual Task<IMessage> SendAndReceiveAsync(D destination, IMessage requestMessage, CancellationToken cancellationToken = default)
Parameters
destination
Dthe target destination
requestMessage
IMessagethe message to send
cancellationToken
CancellationTokentoken used to signal cancelation