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 support for JSON Schema while producing a message #920

Closed
txs4444 opened this issue Nov 23, 2021 · 1 comment
Closed

Add support for JSON Schema while producing a message #920

txs4444 opened this issue Nov 23, 2021 · 1 comment

Comments

@txs4444
Copy link
Contributor

txs4444 commented Nov 23, 2021

Current behavior:

When producing message to topic and as a schema JSON Schema is chosen then exception is thrown because AvroSerializer is used regardless of schema type.

org.apache.avro.AvroRuntimeException: Not a record schema: null
	at org.apache.avro.generic.GenericData$Record.<init>(GenericData.java:215)
	at org.akhq.utils.AvroSerializer.recordSerializer(AvroSerializer.java:55)
	at org.akhq.modules.AvroSerializer.fromJsonToAvro(AvroSerializer.java:73)
	at org.akhq.modules.AvroSerializer.toAvro(AvroSerializer.java:60)
	at org.akhq.repositories.RecordRepository.produce(RecordRepository.java:612)
	at org.akhq.repositories.RecordRepository.produce(RecordRepository.java:493)
	at org.akhq.controllers.TopicController.produce(TopicController.java:142)
	at org.akhq.controllers.$TopicControllerDefinition$$exec4.invokeInternal(Unknown Source)
	at io.micronaut.context.AbstractExecutableMethod.invoke(AbstractExecutableMethod.java:151)
	at io.micronaut.context.DefaultBeanContext$4.invoke(DefaultBeanContext.java:482)
	at io.micronaut.web.router.AbstractRouteMatch.execute(AbstractRouteMatch.java:303)
	at io.micronaut.web.router.RouteMatch.execute(RouteMatch.java:121)
	at io.micronaut.http.server.netty.RoutingInBoundHandler.emitRouteResponse(RoutingInBoundHandler.java:1533)
	at io.micronaut.http.server.netty.RoutingInBoundHandler.access$2100(RoutingInBoundHandler.java:151)
	at io.micronaut.http.server.netty.RoutingInBoundHandler$6$1.request(RoutingInBoundHandler.java:1500)
	at io.reactivex.internal.subscriptions.SubscriptionHelper.deferredSetOnce(SubscriptionHelper.java:202)
	at io.reactivex.internal.operators.single.SingleFlatMapPublisher$SingleFlatMapPublisherObserver.onSubscribe(SingleFlatMapPublisher.java:107)
	at io.micronaut.http.server.netty.RoutingInBoundHandler$6.doSubscribe(RoutingInBoundHandler.java:1488)
	at io.micronaut.http.server.netty.RoutingInBoundHandler$6.lambda$subscribe$0(RoutingInBoundHandler.java:1482)
	at io.micrometer.core.instrument.composite.CompositeTimer.record(CompositeTimer.java:79)
	at io.micrometer.core.instrument.Timer.lambda$wrap$0(Timer.java:157)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Proposed solution:
#919

@txs4444
Copy link
Contributor Author

txs4444 commented Dec 6, 2021

The proposed solution was merged - closing the issue.

@txs4444 txs4444 closed this as completed Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant