Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add withClientId to ProducerSettings #1470

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/src/main/scala/akka/kafka/ProducerSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ class ProducerSettings[K, V] @InternalApi private[kafka] (
)
def producerFactory: ProducerSettings[K, V] => Producer[K, V] = _ => createKafkaProducer()

/**
* An id string to pass to the server when making requests. The purpose of this is to be able to track the source
* of requests beyond just ip/port by allowing a logical application name to be included in server-side request logging.
*/
def withClientId(clientId: String): ProducerSettings[K, V] =
withProperty(ProducerConfig.CLIENT_ID_CONFIG, clientId)

/**
* A comma-separated list of host/port pairs to use for establishing the initial connection to the Kafka cluster.
*/
Expand Down