Class CorrelationFilter
- Namespace
- Microsoft.Azure.ServiceBus
- Assembly
- Microsoft.Azure.ServiceBus.dll
Represents the correlation filter expression.
public sealed class CorrelationFilter : Filter
- Inheritance
-
CorrelationFilter
- Inherited Members
Remarks
A CorrelationFilter holds a set of conditions that are matched against one of more of an arriving message's user and system properties. A common use is a match against the CorrelationId property, but the application can also choose to match against ContentType, Label, MessageId, ReplyTo, ReplyToSessionId, SessionId, To, and any user-defined properties. A match exists when an arriving message's value for a property is equal to the value specified in the correlation filter. For string expressions, the comparison is case-sensitive. When specifying multiple match properties, the filter combines them as a logical AND condition, meaning all conditions must match for the filter to match.
The CorrelationFilter provides an efficient shortcut for declarations of filters that deal only with correlation equality. In this case the cost of the lexigraphical analysis of the expression can be avoided. Not only will correlation filters be optimized at declaration time, but they will also be optimized at runtime. Correlation filter matching can be reduced to a hashtable lookup, which aggregates the complexity of the set of defined correlation filters to O(1).
Constructors
CorrelationFilter()
Initializes a new instance of the CorrelationFilter class with default values.
public CorrelationFilter()
CorrelationFilter(string)
Initializes a new instance of the CorrelationFilter class with the specified correlation identifier.
public CorrelationFilter(string correlationId)
Parameters
correlationId
stringThe identifier for the correlation.
Exceptions
- ArgumentException
Thrown when the
correlationId
is null or empty.
Properties
ContentType
Content type of the message.
public string ContentType { get; set; }
Property Value
- string
The content type of the message.
CorrelationId
Identifier of the correlation.
public string CorrelationId { get; set; }
Property Value
- string
The identifier of the correlation.
Label
Application specific label.
public string Label { get; set; }
Property Value
- string
The application specific label.
MessageId
Identifier of the message.
public string MessageId { get; set; }
Property Value
- string
The identifier of the message.
Remarks
Max MessageId size is 128 chars.
Properties
Application specific properties of the message.
public IDictionary<string, object> Properties { get; }
Property Value
- IDictionary<string, object>
The application specific properties of the message.
Remarks
Only following value types are supported: byte, sbyte, char, short, ushort, int, uint, long, ulong, float, double, decimal, bool, Guid, string, Uri, DateTime, DateTimeOffset, TimeSpan, Stream, byte[], and IList / IDictionary of supported types
ReplyTo
Address of the queue to reply to.
public string ReplyTo { get; set; }
Property Value
- string
The address of the queue to reply to.
ReplyToSessionId
Session identifier to reply to.
public string ReplyToSessionId { get; set; }
Property Value
- string
The session identifier to reply to.
Remarks
Max size of ReplyToSessionId is 128.
SessionId
Session identifier.
public string SessionId { get; set; }
Property Value
- string
The session identifier.
Remarks
Max size of sessionId is 128 chars.
To
Address to send to.
public string To { get; set; }
Property Value
- string
The address to send to.
Methods
ToString()
Converts the value of the current instance to its equivalent string representation.
public override string ToString()
Returns
- string
A string representation of the current instance.