Class AbstractDestinationResolvingMessagingTemplate<D>
public abstract class AbstractDestinationResolvingMessagingTemplate<D> : AbstractMessagingTemplate<D>, IDestinationResolvingMessageSendingOperations<D>, IMessageSendingOperations<D>, IDestinationResolvingMessageReceivingOperations<D>, IMessageReceivingOperations<D>, IDestinationResolvingMessageRequestReplyOperations<D>, IMessageRequestReplyOperations<D>
Type Parameters
D
- Inheritance
-
AbstractDestinationResolvingMessagingTemplate<D>
- Implements
- Derived
- Inherited Members
Constructors
AbstractDestinationResolvingMessagingTemplate(IApplicationContext)
public AbstractDestinationResolvingMessagingTemplate(IApplicationContext context)
Parameters
context
IApplicationContext
Properties
ApplicationContext
public virtual IApplicationContext ApplicationContext { get; }
Property Value
DestinationResolver
public IDestinationResolver<D> DestinationResolver { get; set; }
Property Value
Methods
ConvertAndSend(string, object)
Resolve the given destination name to a destination, convert the payload object to serialized form, possibly using a message converter, wrap it as a message and send it to the resolved destination.
public virtual void ConvertAndSend(string destinationName, object payload)
Parameters
ConvertAndSend(string, object, IMessagePostProcessor)
Resolve the given destination name to a destination, convert the payload object to serialized form, possibly using a message converter, wrap it as a message, apply the post processor, and send it to the resolved destination.
public virtual void ConvertAndSend(string destinationName, object payload, IMessagePostProcessor postProcessor)
Parameters
destinationName
stringthe destination name to resolve
payload
objectthe payload to send
postProcessor
IMessagePostProcessorthe post processor to apply
ConvertAndSend(string, object, IDictionary<string, object>)
Resolve the given destination name to a destination, convert the payload object to serialized form, possibly using a message converter, wrap it as a message with the given headers, and send it to the resolved destination.
public virtual void ConvertAndSend(string destinationName, object payload, IDictionary<string, object> headers)
Parameters
destinationName
stringthe destination name to resolve
payload
objectthe payload to send
headers
IDictionary<string, object>the headers to send
ConvertAndSend(string, object, IDictionary<string, object>, IMessagePostProcessor)
Resolve the given destination name to a destination, convert the payload object to serialized form, possibly using a message converter, wrap it as a message with the given headers, apply the post processor and send it to the resolved destination.
public virtual void ConvertAndSend(string destinationName, object payload, IDictionary<string, object> headers, IMessagePostProcessor postProcessor)
Parameters
destinationName
stringthe destination name to resolve
payload
objectthe payload to send
headers
IDictionary<string, object>the headers to send
postProcessor
IMessagePostProcessorthe post processor to apply
ConvertAndSendAsync(string, object, IMessagePostProcessor, CancellationToken)
Resolve the given destination name to a destination, convert the payload object to serialized form, possibly using a message converter, wrap it as a message, apply the post processor, and send it to the resolved destination.
public virtual Task ConvertAndSendAsync(string destinationName, object payload, IMessagePostProcessor postProcessor, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe destination name to resolve
payload
objectthe payload to send
postProcessor
IMessagePostProcessorthe post processor to apply
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task
a task to signal completion
ConvertAndSendAsync(string, object, IDictionary<string, object>, IMessagePostProcessor, CancellationToken)
Resolve the given destination name to a destination, convert the payload object to serialized form, possibly using a message converter, wrap it as a message with the given headers, apply the post processor and send it to the resolved destination.
public virtual Task ConvertAndSendAsync(string destinationName, object payload, IDictionary<string, object> headers, IMessagePostProcessor postProcessor, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe destination name to resolve
payload
objectthe payload to send
headers
IDictionary<string, object>the headers to send
postProcessor
IMessagePostProcessorthe post processor to apply
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task
a task to signal completion
ConvertAndSendAsync(string, object, IDictionary<string, object>, CancellationToken)
Resolve the given destination name to a destination, convert the payload object to serialized form, possibly using a message converter, wrap it as a message with the given headers, and send it to the resolved destination.
public virtual Task ConvertAndSendAsync(string destinationName, object payload, IDictionary<string, object> headers, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe destination name to resolve
payload
objectthe payload to send
headers
IDictionary<string, object>the headers to send
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task
a task to signal completion
ConvertAndSendAsync(string, object, CancellationToken)
Resolve the given destination name to a destination, convert the payload object to serialized form, possibly using a message converter, wrap it as a message and send it to the resolved destination.
public virtual Task ConvertAndSendAsync(string destinationName, object payload, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe destination name to resolve
payload
objectthe payload to send
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task
a task to signal completion
ConvertSendAndReceiveAsync<T>(string, object, IMessagePostProcessor, CancellationToken)
Resolve the given destination name, convert the payload request object to serialized form, possibly using a message converter and then wrap it as a message, apply the post process, and send it to the resolved destination, receive a reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(string destinationName, object request, IMessagePostProcessor requestPostProcessor, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe name of the target destination
request
objectthe payload for the request message
requestPostProcessor
IMessagePostProcessorpost process for the request message
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the type of the reply
ConvertSendAndReceiveAsync<T>(string, object, IDictionary<string, object>, IMessagePostProcessor, CancellationToken)
Resolve the given destination name, convert the payload request object to serialized form, possibly using a message converter and then wrap it as a message with the given headers, apply the post process, and send it to the resolved destination, receive a reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(string destinationName, object request, IDictionary<string, object> headers, IMessagePostProcessor requestPostProcessor, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe name of the target destination
request
objectthe payload for the request message
headers
IDictionary<string, object>the headers to include in the message
requestPostProcessor
IMessagePostProcessorpost process for the request message
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the type of the reply
ConvertSendAndReceiveAsync<T>(string, object, IDictionary<string, object>, CancellationToken)
Resolve the given destination name, convert the payload request object to serialized form, possibly using a message converter and then wrap it as a message with the given headers and send it to the resolved destination, receive a reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(string destinationName, object request, IDictionary<string, object> headers, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe name of the target destination
request
objectthe payload for the request message
headers
IDictionary<string, object>the headers to include in the message
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the type of the reply
ConvertSendAndReceiveAsync<T>(string, object, CancellationToken)
Resolve the given destination name, convert the payload request object to serialized form, possibly using a message converter and then wrap it as a message and send it to the resolved destination, receive a reply and convert its body to the specified target type.
public virtual Task<T> ConvertSendAndReceiveAsync<T>(string destinationName, object request, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe name of the target destination
request
objectthe payload for the request message
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the type of the reply
ConvertSendAndReceive<T>(string, object)
Resolve the given destination name, convert the payload request object to serialized form, possibly using a message converter and then wrap it as a message and send it to the resolved destination, receive a reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(string destinationName, object request)
Parameters
destinationName
stringthe name of the target destination
request
objectthe payload for the request message
Returns
- T
the converted payload of the reply message, possibly null
Type Parameters
T
the type of the reply
ConvertSendAndReceive<T>(string, object, IMessagePostProcessor)
Resolve the given destination name, convert the payload request object to serialized form, possibly using a message converter and then wrap it as a message, apply the post process, and send it to the resolved destination, receive a reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(string destinationName, object request, IMessagePostProcessor requestPostProcessor)
Parameters
destinationName
stringthe name of the target destination
request
objectthe payload for the request message
requestPostProcessor
IMessagePostProcessorpost process for the request message
Returns
- T
the converted payload of the reply message, possibly null
Type Parameters
T
the type of the reply
ConvertSendAndReceive<T>(string, object, IDictionary<string, object>)
Resolve the given destination name, convert the payload request object to serialized form, possibly using a message converter and then wrap it as a message with the given headers and send it to the resolved destination, receive a reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(string destinationName, object request, IDictionary<string, object> headers)
Parameters
destinationName
stringthe name of the target destination
request
objectthe payload for the request message
headers
IDictionary<string, object>the headers to include in the message
Returns
- T
the converted payload of the reply message, possibly null
Type Parameters
T
the type of the reply
ConvertSendAndReceive<T>(string, object, IDictionary<string, object>, IMessagePostProcessor)
Resolve the given destination name, convert the payload request object to serialized form, possibly using a message converter and then wrap it as a message with the given headers, apply the post process, and send it to the resolved destination, receive a reply and convert its body to the specified target type.
public virtual T ConvertSendAndReceive<T>(string destinationName, object request, IDictionary<string, object> headers, IMessagePostProcessor requestPostProcessor)
Parameters
destinationName
stringthe name of the target destination
request
objectthe payload for the request message
headers
IDictionary<string, object>the headers to include in the message
requestPostProcessor
IMessagePostProcessorpost process for the request message
Returns
- T
the converted payload of the reply message, possibly null
Type Parameters
T
the type of the reply
Receive(string)
Resolve the given destination and receive a message from it
public virtual IMessage Receive(string destinationName)
Parameters
destinationName
stringthe destination name to resolve
Returns
- IMessage
the received message
ReceiveAndConvertAsync<T>(string, CancellationToken)
Resolve the given destination, receive a message from it, convert the payload to the specified target type
public virtual Task<T> ReceiveAndConvertAsync<T>(string destinationName, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe destination name to resolve
cancellationToken
CancellationTokena token used to cancel the operation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the target type
ReceiveAndConvert<T>(string)
Resolve the given destination, receive a message from it, convert the payload to the specified target type
public virtual T ReceiveAndConvert<T>(string destinationName)
Parameters
destinationName
stringthe destination name to resolve
Returns
- T
the received message
Type Parameters
T
the target type
ReceiveAsync(string, CancellationToken)
Resolve the given destination and receive a message from it
public virtual Task<IMessage> ReceiveAsync(string destinationName, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe destination name to resolve
cancellationToken
CancellationTokena token used to cancel the operation
Returns
ResolveDestination(string)
protected D ResolveDestination(string destinationName)
Parameters
destinationName
string
Returns
- D
Send(string, IMessage)
Resolve the given destination name to a destination and send a message to it.
public virtual void Send(string destinationName, IMessage message)
Parameters
SendAndReceive(string, IMessage)
Resolve the given destination name to a destination and send the given message, receive a reply and return it.
public virtual IMessage SendAndReceive(string destinationName, IMessage requestMessage)
Parameters
destinationName
stringthe name of the target destination
requestMessage
IMessagethe message to send
Returns
- IMessage
the received message or null if nothing received
SendAndReceiveAsync(string, IMessage, CancellationToken)
Resolve the given destination name to a destination and send the given message, receive a reply and return it.
public virtual Task<IMessage> SendAndReceiveAsync(string destinationName, IMessage requestMessage, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe name of the target destination
requestMessage
IMessagethe message to send
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
SendAsync(string, IMessage, CancellationToken)
Resolve the given destination name to a destination and send a message to it.
public virtual Task SendAsync(string destinationName, IMessage message, CancellationToken cancellationToken = default)
Parameters
destinationName
stringthe destination name to resolve
message
IMessagethe message to send
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task
a task to signal completion