调整kafka约束

This commit is contained in:
zenghongyao 2025-04-15 11:15:42 +08:00
parent e672a6800d
commit 6409afa98e
2 changed files with 9 additions and 3 deletions

View File

@ -180,4 +180,10 @@ public class SampleAppService : CollectBusAppService, ISampleAppService
var aa = LazyServiceProvider.GetKeyedService<IProtocolPlugin>("TestProtocolPlugin"); var aa = LazyServiceProvider.GetKeyedService<IProtocolPlugin>("TestProtocolPlugin");
return aa == null; return aa == null;
} }
//[AllowAnonymous]
//public async Task KafkaAsync()
//{
//}
} }

View File

@ -7,10 +7,10 @@ using System.Threading.Tasks;
namespace JiShe.CollectBus.Kafka.Producer namespace JiShe.CollectBus.Kafka.Producer
{ {
public interface IProducerService<TKey, TValue> public interface IProducerService
{ {
Task ProduceAsync(string topic, TKey key, TValue value); Task ProduceAsync<TKey, TValue>(string topic, TKey key, TValue value);
Task ProduceAsync(string topic, TValue value); Task ProduceAsync<TKey,TValue>(string topic, TValue value);
void Dispose(); void Dispose();
} }
} }