
io.infinitic.transport.pulsar.schemas.schemaDefinition.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinitic-transport-pulsar Show documentation
Show all versions of infinitic-transport-pulsar Show documentation
Infinitic Orchestration Framework
/**
* "Commons Clause" License Condition v1.0
*
* The Software is provided to you by the Licensor under the License, as defined
* below, subject to the following condition.
*
* Without limiting other conditions in the License, the grant of rights under the
* License will not include, and the License does not grant to you, the right to
* Sell the Software.
*
* For purposes of the foregoing, “Sell” means practicing any or all of the rights
* granted to you under the License to provide to third parties, for a fee or
* other consideration (including without limitation fees for hosting or
* consulting/ support services related to the Software), a product or service
* whose value derives, entirely or substantially, from the functionality of the
* Software. Any license notice or attribution required by the License must also
* include this Commons Clause License Condition notice.
*
* Software: Infinitic
*
* License: MIT License (https://opensource.org/licenses/MIT)
*
* Licensor: infinitic.io
*/
package io.infinitic.transport.pulsar.schemas
import io.infinitic.common.serDe.avro.AvroSerDe
import org.apache.pulsar.client.api.schema.SchemaDefinition
import kotlin.reflect.KClass
fun schemaDefinition(klass: KClass): SchemaDefinition =
SchemaDefinition.builder()
.withJsonDef(AvroSerDe.schema(klass).toString())
.withSchemaReader(KSchemaReader(klass))
.withSchemaWriter(KSchemaWriter(klass))
.withSupportSchemaVersioning(true)
.withJSR310ConversionEnabled(true)
.build()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy