我正在测试发送genericord。但是下面的代码
let fullName = "Test k"
let uniEncoding = new UnicodeEncoding()
let str = uniEncoding.GetBytes("abcdefg")
use ms = new MemoryStream()
ms.Write(str, 0, str.Length)
let content = ms.ToArray()
let config = new Dictionary<string, Object>()
config.Add("bootstrap.servers", "10.0.0.2:9092")
config.Add("schema.registry.url", "http://bing.com")
let s = Schema.Parse(
"""{
"namespace": "nnnnnnnn",
"type": "record",
"name": "fffffnnnnnn",
"fields": [
{"name": "file_name", "type": "string"},
{"name": "time", "type": "string"},
{"name": "content", "type": "bytes"}
]
}""") :?> RecordSchema
use producer = new Producer<string, GenericRecord>(
config, new AvroSerializer<string>(), new AvroSerializer<GenericRecord>())
let record = new GenericRecord(s)
record.Add("file_name", fullName)
record.Add("time", DateTimeOffset.Now.ToString())
record.Add("content", content)
let dr = producer.ProduceAsync("Topic1", fullName, record).Result // error
0 // return an integer exit code
返回此错误
httprequestexception:[http://bing.com/]服务不可用[http://bing.com/]服务不可用-1
我应该设置什么值?
1条答案
按热度按时间wnavrhmk1#
好,
bing.com
不是架构注册表您需要下载confluent oss发行版并进行配置和运行(假设是linux,但是
bin\windows\
工程(其他)那你就用
http://schema-registry.server.name:8081/
有关更多信息,请参阅文档