在我的spring kafka consumer中,我们试图更新cassandra表的integer列,从应用程序日志中我可以看到一切正常,但是当我检查cassandra表时,值没有更新。下面是我用来更新我的记录栏的cassandra模板。
public boolean updaetCassandraTable(String primaryKey1, String primaryKey2, String primaryKey3,
String column_to_update1, String column_to_update2){
Update update = QueryBuilder.update("Table_to_update");
update.where(eq("primaryKey1", primaryKey1))
.and(eq("primaryKey2", primaryKey2))
.and(eq("primaryKey3", primaryKey3))
.with(set("column_to_update1", column_to_update1))
.and(set("column_to_update2", column_to_update2));
return cassandraTemplate.getCqlOperations().execute(update);
}
另外,如果我关闭了消费者,让消息堆积在主题中,然后如果我重新启动消费者,那么所有堆积的消息都会得到很好的处理。只有当消息被立即消费和处理时,问题才会发生。
可能是服务器的时差造成的?任何帮助都将不胜感激。
暂无答案!
目前还没有任何答案,快来回答吧!