我正在使用Spring Embedded Kafka Broker和 MockSchemaRegistryClient为我们的 kafka 系统构建集成测试。我正在为我们的 Stream 拓扑之一构建测试,使用 Streams API (KStreamBuilder) 构建。这个特殊的拓扑有一个 KStream (stream1) 馈入 KTable (table1)。
当我将输入输入到 stream1 时遇到错误,该错误源自 table1 的 KTableProcessor:
Exception in thread "mortgage-kafka-consumers-it-c1dd9185-ce16-415c-ad82-293c1281c897-StreamThread-1" org.apache.kafka.streams.errors.StreamsException: Exception caught in process. taskId=0_0, processor=KSTREAM-SOURCE-0000000001, topic=streaming.mortgage.application_party, partition=0, offset=0
at org.apache.kafka.streams.processor.internals.StreamTask.process(StreamTask.java:202)
at org.apache.kafka.streams.processor.internals.AssignedTasks$2.apply(AssignedTasks.java:342)
at org.apache.kafka.streams.processor.internals.AssignedTasks.applyToRunningTasks(AssignedTasks.java:415)
at org.apache.kafka.streams.processor.internals.AssignedTasks.process(AssignedTasks.java:334)
at org.apache.kafka.streams.processor.internals.StreamThread.processAndPunctuate(StreamThread.java:624)
at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:513)
at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:480)
at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:457)
Caused by: org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id 6
**Caused by: java.io.IOException: Cannot get schema from schema registry!**
at io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient.getSchemaBySubjectAndIdFromRegistry(MockSchemaRegistryClient.java:106)
at io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient.getBySubjectAndID(MockSchemaRegistryClient.java:149)
at …Run Code Online (Sandbox Code Playgroud) apache-kafka apache-kafka-streams confluent-schema-registry embedded-kafka
我们有一个 kafka 集群,运行着存储在 Confluence 的 Schema-registry 中的 Avro schema。在最近重新部署(其中一个)我们的流应用程序时,我们开始在单个主题(EmailSent)上看到不兼容的架构错误。这是唯一失败的主题,每当向该主题提交新的 EmailSent 事件时,我们都会收到错误。
Caused by:org.apache.kafka.common.errors.SerializationException: Error registering Avro schema: {"type":"record","name":"EmailSent","namespace":"com.company_name.communications.schemas","fields":[{"name":"customerId","type":"long","doc":"Customer's ID in the customers service"},{"name":"messageId","type":"long","doc":"The message id of the sent email"},{"name":"sentTime","type":{"type":"string","avro.java.string":"String"},"doc":"The campaign sent time in format 'yyyy-MM-dd HH:mm:ss.SSS'"},{"name":"campaignId","type":"long","doc":"The id of the campaign in the marketing suite"},{"name":"appId","type":["null","long"],"doc":"The app id associated with the sent email, if the email was related to a specific application","default":null}],"version":1}
Caused by:io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Schema being registered is incompatible with an earlier schema; error code: 409; error code: 409
at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:170)
at …Run Code Online (Sandbox Code Playgroud) avro apache-kafka apache-kafka-streams confluent-schema-registry
我正在使用Bootstrap样式构建一个.net Web应用程序.我有一个配备日期选择器的文本框方案,我想避免日期字符串验证的麻烦.我想我可以简单地检查空字符串值(无输入)作为唯一必要的验证和禁用键盘输入.这样,唯一可能的输入是通过datepicker.
我唯一的问题是将disabled属性应用于datepicker框会禁用单击,并通过单击文本框显示日期选择器.
因此我的问题是:如何在仍允许点击的同时禁用文本框的输入?
javascript jquery textbox disabled-input bootstrap-datepicker
我在Swift中与服务器通信,检索图像数据.传入的数据被编码为base64字符串.我能够正确接收和显示编码的字符串.当我去使用NSData该类将字符串解码回二进制数据并显示...
println(NSData(base64EncodedString: imageString, options: NSDataBase64DecodingOptions(0)))
Run Code Online (Sandbox Code Playgroud)
输出是
nil
nil
nil
nil
nil
nil
Run Code Online (Sandbox Code Playgroud)
每个收到的图像一个.
我也试过了
println(NSData(base64EncodedString: imageString, options: nil))
Run Code Online (Sandbox Code Playgroud)
和相同的结果.沿路有什么我想念的吗?我会把图像串放好但是它们很长......
我正在创建一个有两个微调器的android活动.我理解如何onItemSelectedListener使用onItemSelected回调函数实现一个微调器:
public void onItemSelected(AdapterView<?> parent, View view,
int pos, long id) {
Spinner spinner = (Spinner) findViewById(R.id.spinnerOneOfTwo);
spinner.setOnItemSelectedListener(this);
//do things with selection...
}
Run Code Online (Sandbox Code Playgroud)
但是,如果我有多个微调器怎么办?在我看来,我需要一个单独的功能,但由于两个微调器都设置为回调,onItemSelected()我不能采取这种方法.有没有办法告诉哪个微调器正在调用该onItemSelected()函数?也许微调器正在调用的参数键之一?然后我可以将其ID设置为我的微调器变量ID的参数?
我知道有一种方法(我绝对不是唯一一个在一个活动中放置多个微调器的人),任何提示都非常感谢!
经历了与这一次的长期斗争.我正在使用ASP.NET Web API来提供与数据库的简洁HTTP/JSON交互.我有一个实体名称Reservation with,如下所示:
// Reservation
public class Reservation
{
public int ID { get; set; } // ID (Primary key)
public int EquipmentID { get; set; } // EquipmentID
public string Username { get; set; } // Username
public DateTime BeginDateTime { get; set; } // BeginDateTime
public int? Duration { get; set; } // Duration
public int? ReservationStateID { get; set; } // ReservationStateID
public DateTime? CheckInDateTime { get; set; } // CheckInDateTime
public string Note { get; …Run Code Online (Sandbox Code Playgroud)