NATS can not be configure cap-msg-id if receiving messages
wi-chrfaber opened this issue · 4 comments
The problem is, when the NATS server issues messages that do not have "cap-msg-id"/"cap-msg-name", the CAP library has trouble receiving the messages. And I didn't find any configuration options to put it (like Kafka for example).
Error Messages
An exception occurred when process received message. Message:'DotNetCore.CAP.Messages.TransportMessage'. System.Collections.Generic.KeyNotFoundException: The given key 'cap-msg-id' was not present in the dictionary. at DotNetCore.CAP.Internal.ConsumerRegister.<>c__DisplayClass22_0.<<RegisterMessageProcessor>b__0>d.MoveNext()
Hi @wi-chrfaber ,
NATS does not provide CustomHeadersBuilder option yet, would you like to submit a PR? Just like Kafka or RabbitMQ.
CAP/src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs
Lines 122 to 129 in 4c2feeb
Thank you in advance.
Hi,
Yes, create a PR for this feature.
Thanks for the quick feedback.