諾爾,我測試了相同的連接變量:
def setupSchemaRegistry (schemaRegistryUrl:字符串,confluentRegistryApiKey:字符串,confluentRegistrySecret:字符串):CachedSchemaRegistryClient = {val道具= (“basic.auth.credentials地圖。源”- >“USER_INFO”、“basic.auth.user.info”- >“$ confluentRegistryApiKey:美元confluentRegistrySecret”、“schema.registry.basic.auth.credentials。源”- >“USER_INFO”/ /嚐試這個版本就可以肯定的是“schema.registry。url”- > schemaRegistryUrl,“schema.registry.basic.auth.user.info”- >“$ confluentRegistryApiKey:美元confluentRegistrySecret”)。asJava / / val restService = new restService (schemaRegistryUrl) / /模式的格式注冊憑證下麵是confluentRegistryApiKey: confluentRegistrySecret println (s”模式注冊信息schemaRegistryUrl confluentRegistryApiKey美元$ confluentRegistrySecret ") / /也試過的版本,我通過restService內部相反,等新的CachedSchemaRegistryClient(100年schemaRegistryUrl道具)}val schemaRegistry = setupSchemaRegistry (schemaRegistryUrl、confluentRegistryApiKey confluentRegistrySecret) val res = schemaRegistry.getSchemaById(數量)/ /得到401
磚運行時:9.1
彙合的客戶機6.2.1
為什麼它會失敗在scala中,隻是從磚集群?我不能解釋!
我將會很高興任何幫助