confluent-kafka-dotnet
Show / Hide Table of Contents

Class SubjectNameStrategyExtensions

Extension methods for the SubjectNameStrategy type.

Inheritance
object
SubjectNameStrategyExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Confluent.SchemaRegistry
Assembly: Confluent.SchemaRegistry.dll
Syntax
public static class SubjectNameStrategyExtensions

Methods

ConstructKeySubjectName(SubjectNameStrategy, string, string)

Helper method to construct the key subject name given the specified parameters.

Declaration
[Obsolete("SubjectNameStrategy should now be specified via serializer configuration. This method will be removed in a future release.")]
public static string ConstructKeySubjectName(this SubjectNameStrategy strategy, string topic, string recordType = null)
Parameters
Type Name Description
SubjectNameStrategy strategy
string topic
string recordType
Returns
Type Description
string

ConstructValueSubjectName(SubjectNameStrategy, string, string)

Helper method to construct the value subject name given the specified parameters.

Declaration
[Obsolete("SubjectNameStrategy should now be specified via serializer configuration. This method will be removed in a future release.")]
public static string ConstructValueSubjectName(this SubjectNameStrategy strategy, string topic, string recordType = null)
Parameters
Type Name Description
SubjectNameStrategy strategy
string topic
string recordType
Returns
Type Description
string

ToAsyncDelegate(SubjectNameStrategy, ISchemaRegistryClient, IEnumerable<KeyValuePair<string, string>>)

Provide an async functional implementation corresponding to the enum value.

Declaration
public static AsyncSubjectNameStrategyDelegate ToAsyncDelegate(this SubjectNameStrategy strategy, ISchemaRegistryClient schemaRegistryClient = null, IEnumerable<KeyValuePair<string, string>> config = null)
Parameters
Type Name Description
SubjectNameStrategy strategy

The subject name strategy.

ISchemaRegistryClient schemaRegistryClient

Optional. Required when strategy is Associated. The schema registry client to use for lookups.

IEnumerable<KeyValuePair<string, string>> config

Optional. Used when strategy is Associated. The configuration.

Returns
Type Description
AsyncSubjectNameStrategyDelegate

An AsyncSubjectNameStrategyDelegate.

ToAsyncDelegate(SubjectNameStrategy, ISchemaRegistryClient, IEnumerable<KeyValuePair<string, string>>, out AssociatedNameStrategy)

EXPERIMENTAL: subject to change or removal.

Provide an async functional implementation corresponding to the enum value, additionally exposing the AssociatedNameStrategy instance backing it, if any.

The instance is needed to supply the Kafka cluster id resolver after construction - refer to SetClusterIdResolver(Func<Task<string>>).

Declaration
public static AsyncSubjectNameStrategyDelegate ToAsyncDelegate(this SubjectNameStrategy strategy, ISchemaRegistryClient schemaRegistryClient, IEnumerable<KeyValuePair<string, string>> config, out AssociatedNameStrategy associatedNameStrategy)
Parameters
Type Name Description
SubjectNameStrategy strategy

The subject name strategy.

ISchemaRegistryClient schemaRegistryClient

Optional. Required when strategy is Associated. The schema registry client to use for lookups.

IEnumerable<KeyValuePair<string, string>> config

Optional. Used when strategy is Associated. The configuration.

AssociatedNameStrategy associatedNameStrategy

The strategy instance backing the returned delegate when strategy is Associated, otherwise null.

Returns
Type Description
AsyncSubjectNameStrategyDelegate

An AsyncSubjectNameStrategyDelegate.

ToDelegate(SubjectNameStrategy)

Provide a functional implementation corresponding to the enum value.

Declaration
[Obsolete("Superseded by ToAsyncDelegate. This method cannot be used with SubjectNameStrategy.Associated.")]
public static SubjectNameStrategyDelegate ToDelegate(this SubjectNameStrategy strategy)
Parameters
Type Name Description
SubjectNameStrategy strategy

The subject name strategy.

Returns
Type Description
SubjectNameStrategyDelegate

A SubjectNameStrategyDelegate.

In this article