crazylab opened a new issue #6213: [Client] JSONSchema not able to encode 
message in case class (scala)
URL: https://github.com/apache/pulsar/issues/6213
 
 
   Client 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**
   ```scala
   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]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to