Interface IBrokerMessageIdentifier
Represents the primary identifier used by the message broker to recognize the exact message.
It can represent a Kafka offset, a RabbitMQ delivery tag or other similar constructs.
The IBrokerMessageOffset interface should be implemented whenever possible to allow the exactly-one delivery using the OffsetStoreExactlyOnceStrategy.
If the message broker doesn't provide any message identifier, a local one can be created (e.g.
Guid.NewGuid()
) but this will prevent some features to work properly.
Inherited Members
Namespace: Silverback.Messaging.Broker
Assembly: Silverback.Integration.dll
Syntax
public interface IBrokerMessageIdentifier : IEquatable<IBrokerMessageIdentifier>
Remarks
The classes implementing this interface should also implement a public constructor accepting key and value as string arguments.
Properties
| Improve this doc View sourceKey
Gets the unique key of the queue, topic or partition the message was produced to or consumed from.
Declaration
string Key { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
The classes implementing this interface should also implement a public constructor accepting key and value as string arguments.
Value
Gets the identifier value.
Declaration
string Value { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
The classes implementing this interface should also implement a public constructor accepting key and value as string arguments.
Methods
| Improve this doc View sourceToLogString()
Gets a string that can be used to log the offset value.
Declaration
string ToLogString()
Returns
Type | Description |
---|---|
string | A string representing the offset value. |
Remarks
This string should contain all identifiers except the endpoint name.
ToVerboseLogString()
Gets a string that can be used to log the offset value.
Declaration
string ToVerboseLogString()
Returns
Type | Description |
---|---|
string | A string representing the offset value. |
Remarks
This string must include the endpoint name, if the identifier value isn't unique across different endpoints.