[Client] JSONSchema not able to encode message in case class (scala)
See original GitHub issueClient Library version: 2.5.0
Describe the bug The producer is not able to produce JSON data with the content of the case class. Only empty values are getting passed to the broker. This is primarily because the JSON encoder not able to encode the message properly.
Code snippet
case class Student(name: String, roll: Int)
val client: PulsarClient = PulsarClient.builder()
.serviceUrl("pulsar://localhost:6650")
.build();
val producer = client.newProducer(JSONSchema.of(classOf[Student]))
.topic("foobar")
.sendTimeout(3, TimeUnit.SECONDS).create
def produce(msg: Student) = {
producer.send(msg)
}
Expected behavior Should encode the data available in case class and send it to the broker for the pulsar consumer.
Desktop (please complete the following information):
- Mac: [e.g. iOS]
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
JSONSchema values not sent when using Scala Case class
I have a Scala Kafka Producer code where I am using a case class to initialize values and trying to send it using...
Read more >endpoints4s/endpoints4s - Gitter
Getting circe encoder out of JsonSchema is possible, but the other way? ... wasn't aware of this message, I started working ond #283...
Read more >JSON Schema Serializer and Deserializer
This document describes how to use JSON Schema with the Apache Kafka® Java client and console tools. Both the JSON Schema serializer and...
Read more >JSON Schemas - endpoints4s
sealed trait Shape case class Circle(radius: Double) extends Shape case class ... A possible JSON schema for this data type consists in using...
Read more >JSON - Wikipedia
Any valid JSON file is a valid JavaScript ( .js ) file, even though it makes no changes to a web page on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yjshen Would you please help take a look when you have time?
Can someone close this issue? @yjshen solution works fine.