@Singleton public class DefaultSchemaHandler extends Object
Constructor and Description |
---|
DefaultSchemaHandler(io.micronaut.context.BeanContext context) |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
bodyType(io.micronaut.core.type.Argument<?> body) |
org.apache.pulsar.client.api.Schema<?> |
decideSchema(io.micronaut.core.type.Argument<?> body,
io.micronaut.core.type.Argument<?> key,
io.micronaut.core.annotation.AnnotationValue<?> topicAnnotation,
String target)
Resolve which schema to use for ser/der.
|
public DefaultSchemaHandler(io.micronaut.context.BeanContext context)
context
- BeanContext for fetching extra resolverspublic org.apache.pulsar.client.api.Schema<?> decideSchema(io.micronaut.core.type.Argument<?> body, @Nullable io.micronaut.core.type.Argument<?> key, io.micronaut.core.annotation.AnnotationValue<?> topicAnnotation, String target)
body
- argument that represents message bodykey
- if message is of type key-value a key should be passed; otherwise use nulltopicAnnotation
- annotation corresponding to one of the Pulsar annotations: consumer, reader, producer.target
- name of the method, field, or other that represent where the error might be in case of it.public static Class<?> bodyType(io.micronaut.core.type.Argument<?> body)