将 DotNetCore.CAP 从 2.2.5.2 升级至 2.4.0 之后日志中出现大量的告警:
[Warning] Processor '"DotNetCore.CAP.Processor.NeedRetryMessageProcessor"' failed. Retrying...
System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'Version'.
at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__122_0(Task`1 result)
...
at DotNetCore.CAP.SqlServer.SqlServerStorageConnection.GetPublishedMessagesOfNeedRetry()
at DotNetCore.CAP.Processor.NeedRetryMessageProcessor.ProcessPublishedAsync(IStorageConnection connection, ProcessingContext context)
at DotNetCore.CAP.Processor.NeedRetryMessageProcessor.ProcessAsync(ProcessingContext context)
at DotNetCore.CAP.Processor.InfiniteRetryProcessor.ProcessAsync(ProcessingContext context)
请问如何解决?
给 Cap.Published 与 Cap.Received 表增加 Version 字段后解决
ALTER TABLE Cap.Published ADD
Version varchar(10) NOT NULL CONSTRAINT DF_Published_Version DEFAULT 'v1'
ALTER TABLE Cap.Received ADD
Version varchar(10) NOT NULL CONSTRAINT DF_Received_Version DEFAULT 'v1'