Class PublishEndpoint
- Namespace
- MassTransit.Transports
- Assembly
- MassTransit.Abstractions.dll
The publish endpoint delivers messages to the topic/exchange/whatever based upon the publish topology of the broker, by message type.
public class PublishEndpoint : IPublishEndpoint, IPublishObserverConnector
- Inheritance
-
PublishEndpoint
- Implements
- Inherited Members
- Extension Methods
Constructors
PublishEndpoint(IPublishEndpointProvider)
public PublishEndpoint(IPublishEndpointProvider provider)
Parameters
provider
IPublishEndpointProvider
Properties
PublishEndpointProvider
protected IPublishEndpointProvider PublishEndpointProvider { get; set; }
Property Value
Methods
ConnectPublishObserver(IPublishObserver)
public ConnectHandle ConnectPublishObserver(IPublishObserver observer)
Parameters
observer
IPublishObserver
Returns
GetPublishSendEndpoint<T>()
protected virtual Task<ISendEndpoint> GetPublishSendEndpoint<T>() where T : class
Returns
Type Parameters
T
Publish(object, IPipe<PublishContext>, CancellationToken)
Publishes an object as a message, using the message type specified. If the object cannot be cast to the specified message type, an exception will be thrown.
public Task Publish(object message, IPipe<PublishContext> publishPipe, CancellationToken cancellationToken)
Parameters
message
objectThe message object
publishPipe
IPipe<PublishContext>cancellationToken
CancellationToken
Returns
Publish(object, CancellationToken)
Publishes an object as a message, using the message type specified. If the object cannot be cast to the specified message type, an exception will be thrown.
public Task Publish(object message, CancellationToken cancellationToken)
Parameters
message
objectThe message object
cancellationToken
CancellationToken
Returns
Publish(object, Type, IPipe<PublishContext>, CancellationToken)
Publishes an object as a message, using the message type specified. If the object cannot be cast to the specified message type, an exception will be thrown.
public Task Publish(object message, Type messageType, IPipe<PublishContext> publishPipe, CancellationToken cancellationToken)
Parameters
message
objectThe message object
messageType
TypeThe type of the message (use message.GetType() if desired)
publishPipe
IPipe<PublishContext>cancellationToken
CancellationToken
Returns
Publish(object, Type, CancellationToken)
Publishes an object as a message, using the message type specified. If the object cannot be cast to the specified message type, an exception will be thrown.
public Task Publish(object message, Type messageType, CancellationToken cancellationToken)
Parameters
message
objectThe message object
messageType
TypeThe type of the message (use message.GetType() if desired)
cancellationToken
CancellationToken
Returns
Publish<T>(object, IPipe<PublishContext<T>>, CancellationToken)
Publish<T>(T, CancellationToken): this overload further takes an action; it allows you to set PublishContext meta-data. Also Publish<T>(T, CancellationToken).
public Task Publish<T>(object values, IPipe<PublishContext<T>> publishPipe, CancellationToken cancellationToken) where T : class
Parameters
values
objectThe dictionary of values to become hydrated and published under the type of the interface.
publishPipe
IPipe<PublishContext<T>>cancellationToken
CancellationToken
Returns
Type Parameters
T
The type of the message to publish
Publish<T>(object, IPipe<PublishContext>, CancellationToken)
Publish<T>(T, CancellationToken): this overload further takes an action; it allows you to set PublishContext meta-data. Also Publish<T>(T, CancellationToken).
public Task Publish<T>(object values, IPipe<PublishContext> publishPipe, CancellationToken cancellationToken) where T : class
Parameters
values
objectThe dictionary of values to become hydrated and published under the type of the interface.
publishPipe
IPipe<PublishContext>cancellationToken
CancellationToken
Returns
Type Parameters
T
The type of the message to publish
Publish<T>(object, CancellationToken)
Publish<T>(T, CancellationToken): this is a "dynamically" typed overload - give it an interface as its type parameter, and a loosely typed dictionary of values and the MassTransit underlying infrastructure will populate an object instance with the passed values. It actually does this with DynamicProxy in the background.
public Task Publish<T>(object values, CancellationToken cancellationToken) where T : class
Parameters
values
objectThe dictionary of values to place in the object instance to implement the interface.
cancellationToken
CancellationToken
Returns
Type Parameters
T
The type of the interface or non-sealed class with all-virtual members.
Publish<T>(T, IPipe<PublishContext<T>>, CancellationToken)
Publishes a message to all subscribed consumers for the message type as specified by the generic parameter. The second parameter allows the caller to customize the outgoing publish context and set things like headers on the message.
Read up on publishing: http://readthedocs.org/docs/masstransit/en/latest/overview/publishing.html
public Task Publish<T>(T message, IPipe<PublishContext<T>> publishPipe, CancellationToken cancellationToken) where T : class
Parameters
message
TThe messages to be published
publishPipe
IPipe<PublishContext<T>>cancellationToken
CancellationToken
Returns
Type Parameters
T
The type of the message
Publish<T>(T, IPipe<PublishContext>, CancellationToken)
Publishes a message to all subscribed consumers for the message type as specified by the generic parameter. The second parameter allows the caller to customize the outgoing publish context and set things like headers on the message.
Read up on publishing: http://readthedocs.org/docs/masstransit/en/latest/overview/publishing.html
public Task Publish<T>(T message, IPipe<PublishContext> publishPipe, CancellationToken cancellationToken) where T : class
Parameters
message
TThe messages to be published
publishPipe
IPipe<PublishContext>cancellationToken
CancellationToken
Returns
Type Parameters
T
The type of the message
Publish<T>(T, CancellationToken)
Publishes a message to all subscribed consumers for the message type as specified by the generic parameter. The second parameter allows the caller to customize the outgoing publish context and set things like headers on the message.
Read up on publishing: http://readthedocs.org/docs/masstransit/en/latest/overview/publishing.html
public Task Publish<T>(T message, CancellationToken cancellationToken) where T : class
Parameters
message
TThe messages to be published
cancellationToken
CancellationToken
Returns
Type Parameters
T
The type of the message