This message was deleted.
# general
s
This message was deleted.
d
Does the topic in question already exist, or are you expecting it to be auto-created when you produce the messages? if the former, it has a schema associated with it, and you must either publish messages that conform to that schema or disable schema enforcement on the topic.
m
Yes, it's the former. The error messages and the examples I see for other clients seem to indicate that the client needs to know the schema somehow, not just have the message conform. But maybe I'm mistaken? Here's the schema if it helps:
Copy code
{
  "type": "record",
  "name": "enum_test_schema",
  "namespace": "default",
  "fields": [
    {
      "name": "color",
      "type": {
        "type": "enum",
        "name": "Color",
        "symbols": [
          "unknown",
          "green",
          "red"
        ]
      },
      "default": "unknown"
    }
  ]
}
d
Got it. So you are interested in how to publish schema’ed messages from the command line, is that correct?
m
yes
d
You can use the
--value-schema
flag on the produce command to specify JSON, AVRO, String, or bytes. Then pass in a compatible payload for the message
So something like
client produce <topic> --value-schema JSON --messages "{'color':'red'}"
m
I tried that flag and it errors on
AVRO
,
avro
,
JSON
,
json
, etc
despite the
--help
text suggesting those values
ERROR org.apache.pulsar.client.cli.PulsarClientTool - Invalid schema type: AVRO
d
Does enclosing AVRO in quotes make a difference? “AVRO”, or ‘AVRO’ ?
m
nope, same thing
d
Which client version are you using?
m
at this point I've nearly gotten this working in Python, so maybe not worth digging into this anymore if it is version-specific
I was hoping I was just missing a flag or something
thanks for your help, David
d
No problem. FWIW, given the recent departures within the Pulsar team at DataStax, you might want to avoid their tooling, as the maintenance/updates on those might be lacking going forward.
m
Ok, thanks for the heads up. I'm trying to duplicate a customer issue so not thinking too hard about tooling at the moment.
👍 1