Skip to main content

Kafka Topic

Overview

The page outlines the parameters that should be included in your listener configuration when setting up a real time sync with a Kafka stream source. This process currently supports JSON string or AVRO serialized format. To listen in on multiple topics, you will need to configure multiple listener configs.

Configuring the sync

All of the confiuration parameters and variables for a Kafka real-time sync are the same as those outlined in the Kafka batch sync documentation. The only difference is that you must also set up your listener configuration as per the next section.

The Listener configuration

info

In Cinchy v5.7+, configuring the listener can be done directly in the Connections UI, however for multiple listener requirements you must still add additional configurations in the Listener Config table.

To listen in on multiple topics, you will need to configure multiple listener configs.

To set up an Stream Source, you must set up a Listener Configuration. The below table describes the parameters and their relevant descriptions.

The following column parameters can be found in the Listener Config table:

ParameterDescriptionExample
NameMandatory. Provide a name for your listener config. real-time sync
Event Connector TypeMandatory. Select your Connector type from the drop-down menu.
TopicMandatory. This field is expecting a JSON formatted value specific to the connector type you are configuring.See the Topic tab.
Connection AttributesMandatory. This field is expecting a JSON formatted value specific to the connector type you are configuring.See the Connection Attributes tab.
StatusMandatory. Set to "Enabled" to activate the listener. Leave on "Disabled" until you are ready to start syncing.Enabled/Disabled
Running StatusRead-only. Shows the current state of the listener as Starting, Running, or Failed. This is automatically managed by the system. For more information, see the Listener status section.Running
ActiveManaged by User/System. Indicates whether the listener is set to retry after failure ("Yes") or has stopped attempting to sync and requires user intervention ("No").Yes/No
Data Sync ConfigMandatory. This drop-down will list all the data syncs on your platform. Select the one that you want to use for your real-time sync.CDC Data Sync
Subscription Expires OnSalesforce Stream Sources only. This field is a timestamp that's auto populated when it has successfully subscribed to a topic.
MessageAuto-populated. This field reports errors that occur during the sync.
Auto Offset ResetEarliest, Latest, None. Determines where to start reading events if there is no last message ID or if it's invalid. Can be adjusted post-configuration. Learn moreEarliest ,Latest, None

Broker TLS

Supply TLS material as PEM content rather than as files on the listener host. Set securityProtocol to Ssl for a connection whose only credential is the client certificate, or to SaslSsl to combine TLS with a SASL mechanism.

ParameterDescription
sslCaPemThe CA chain that signs the broker's certificate, as PEM content. Needed when the broker's certificate is not signed by a public CA.
sslCertificatePemThe client certificate this listener presents, as PEM content. Required for mutual TLS.
sslKeyPemThe private key for that client certificate, as PEM content.
sslKeyPasswordThe passphrase for the private key, if the key is encrypted.

Example: mutual TLS, with the certificate as the only credential

{
"bootstrapServers": "broker.example.com:9093",
"securityProtocol": "Ssl",
"sslCaPem": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
"sslCertificatePem": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
"sslKeyPem": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
}

Note that saslMechanism is absent. Setting it to a mechanism you do not intend to use, or to a value the listener cannot read, is rejected when the configuration loads.

OAUTHBEARER

Set saslMechanism to OAuthBearer and securityProtocol to SaslSsl, then choose how the listener obtains its token with saslOauthbearerMethod:

ValueMeaning
Defaultlibrdkafka builds an unsecured token from saslOauthbearerConfig, rather than Cinchy fetching one. See Default method.
OidcCinchy fetches a token from saslOauthbearerTokenEndpointUrl, using either a client secret or a signed JWT client assertion.

Default method

Default selects librdkafka's built-in unsecured token handler, which assembles a token from saslOauthbearerConfig without contacting a provider. Nothing signs that token, so a broker accepts it only where it has been configured to trust unsecured JWTs. Use this for development and testing against a local broker, and Oidc everywhere else.

ParameterDescription
saslOauthbearerConfigThe token's contents, as space-separated name=value pairs. The names recognized are principal, principalClaimName (defaults to sub), scope, scopeClaimName (defaults to scope) and lifeSeconds (defaults to 3600). A scope takes a comma-separated list. An extension_NAME=value pair travels to the broker as a SASL extension.
enableSaslOauthbearerUnsecureJwtMandatory for Default. Set it to true to turn the handler on. It defaults to false, which leaves the client with no way to produce a token, and authentication fails.

Example: unsecured token, against a development broker

{
"bootstrapServers": "localhost:9092",
"securityProtocol": "SaslPlaintext",
"saslMechanism": "OAuthBearer",
"saslOauthbearerMethod": "Default",
"enableSaslOauthbearerUnsecureJwt": true,
"saslOauthbearerConfig": "principal=cinchy-listener scope=kafka lifeSeconds=600"
}

Token endpoint

ParameterDescription
saslOauthbearerTokenEndpointUrlMandatory for Oidc. The token endpoint. Must be HTTPS, except on a loopback address.
saslOauthbearerClientIdMandatory for Oidc. The client ID registered with your identity provider.
saslOauthbearerClientSecretThe client secret, for providers that issue one. Leave it out when using a client assertion.
saslOauthbearerScopeThe scope requested from the token endpoint, if your provider requires one.
saslOauthbearerExtensionsSASL extensions sent to the broker with the token, as key=value pairs separated by commas. A value cannot contain a comma.

Signed JWT client assertion

Provide a private key instead of a client secret and Cinchy signs an RFC 7523 section 2.2 client assertion (private_key_jwt) for each token request. This is what providers mean when they say they do not issue client secrets.

ParameterDescription
saslOauthbearerAssertionPrivateKeyPemThe signing key as PEM content. Its presence, with the default grant, selects the client assertion flow.
saslOauthbearerAssertionPrivateKeyFileA path to the signing key on the listener host, as an alternative to PEM content.
saslOauthbearerAssertionPrivateKeyPassphraseThe passphrase for the signing key, if the key is encrypted.
saslOauthbearerAssertionAlgorithmRS256 (default), RS384, RS512, PS256, PS384, PS512, ES256, ES384 or ES512. Financial-grade providers reject RS256 and require PS256 or ES256.
saslOauthbearerGrantTypeClientCredentials (default) sends the assertion as client authentication. JwtBearer sends it as the authorization grant itself (RFC 7523 section 2.1), which few providers accept.

Identifying your key to the provider

A provider that holds more than one registered public key needs a hint to know which one verifies the assertion. Providers commonly begin to require this at the first key rotation, not at first registration.

ParameterDescription
saslOauthbearerAssertionKeyIdEmitted as the assertion's kid header. Populate it only when the provider publishes that key ID, since a kid a provider cannot resolve fails outright.
saslOauthbearerAssertionCertificatePemThe certificate matching the signing key, as PEM content or a file path. Its thumbprint is emitted in the header named below.
saslOauthbearerAssertionThumbprintHeaderx5t (SHA-1, the default) or x5t#S256 (SHA-256). RFC 7515 ties the digest to the header name, so this one setting picks both.
saslOauthbearerAssertionX5tThumbprintA pre-computed thumbprint, for providers that publish the thumbprint rather than the certificate. Takes precedence over the certificate above.

Provider-specific extras

ParameterDescription
saslOauthbearerAssertionClaimIssThe assertion's iss claim. Defaults to the client ID, which is what OIDC requires.
saslOauthbearerAssertionClaimSubThe assertion's sub claim. Defaults to the client ID.
saslOauthbearerAssertionClaimAudThe assertion's aud claim. Defaults to the token endpoint URL. Some providers require their issuer identifier instead.
saslOauthbearerAssertionClaimExpSecondsHow long the assertion is valid, in seconds. Defaults to 300.
saslOauthbearerAssertionClaimNbfSecondsSubtracted from the signing time to produce an nbf claim. Omit it and no nbf is sent.
saslOauthbearerAssertionClaimJtiIncludeWhether to include a unique jti claim. Defaults to true, and providers that detect replay require it.
saslOauthbearerAssertionAdditionalClaimsExtra claims merged into the assertion, as a JSON object. A claim named here overrides the standard claim of the same name.
saslOauthbearerTokenRequestParametersExtra form parameters on the token request, as a JSON object. Some providers require an audience or resource parameter.
saslOauthbearerTokenRequestHeadersExtra HTTP headers on the token request, as a JSON object. Values can be stored encrypted.

Token endpoint behind mutual TLS

Some providers require a client certificate to reach the token endpoint. That certificate is separate from the broker connection.

ParameterDescription
saslOauthbearerTokenEndpointCertificatePemThe client certificate for the token endpoint, as PEM content or a file path.
saslOauthbearerTokenEndpointCertificateKeyPemIts private key, as PEM content or a file path.
saslOauthbearerTokenEndpointCertificateKeyPassphraseThe passphrase for that key, if it is encrypted.

Example: OAUTHBEARER with a signed JWT client assertion

{
"bootstrapServers": "broker.example.com:9095",
"securityProtocol": "SaslSsl",
"saslMechanism": "OAuthBearer",
"saslOauthbearerMethod": "Oidc",
"saslOauthbearerTokenEndpointUrl": "https://idp.example.com/oauth2/token",
"saslOauthbearerClientId": "cinchy-listener",
"saslOauthbearerAssertionPrivateKeyPem": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----",
"saslOauthbearerAssertionAlgorithm": "PS256",
"saslOauthbearerAssertionKeyId": "cinchy-signing-key-1",
"saslOauthbearerAssertionClaimJtiInclude": true,
"saslOauthbearerScope": "kafka",
"sslCaPem": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
}

The minimum for a standards-conformant provider is bootstrapServers, securityProtocol, saslMechanism, saslOauthbearerMethod, saslOauthbearerTokenEndpointUrl, saslOauthbearerClientId and one of saslOauthbearerClientSecret or saslOauthbearerAssertionPrivateKeyPem. Everything else in the tables above exists for providers that ask for more than the specification requires.

Storing values encrypted

Each of the values listed below can be pasted as plaintext or as an encrypted string. The listener detects which it has and decrypts when the configuration loads, so no key or flag accompanies the value in the JSON.

To encrypt a value, run the CLI's encrypt command against the instance that will run the listener, then paste the string it returns in place of the plaintext. Your Cinchy instance performs the encryption rather than the CLI, so a string encrypted on one environment cannot be decrypted on another.

These values can be encrypted:

CategoryKeys
ConnectionbootstrapServers
SASL credentialssaslUsername, saslPassword, saslOauthbearerConfig, saslOauthbearerClientSecret
Client assertionsaslOauthbearerAssertionPrivateKeyPem, saslOauthbearerAssertionPrivateKeyPassphrase
Token endpoint TLSsaslOauthbearerTokenEndpointCertificateKeyPem, saslOauthbearerTokenEndpointCertificateKeyPassphrase, and the values inside saslOauthbearerTokenRequestHeaders
Broker TLSsslCaPem, sslCertificatePem, sslKeyPem, sslKeyPassword
KerberossaslKerberosPrincipal, saslKerberosServiceName