nats.net
nats.net copied to clipboard
JetStream CreateOrUpdateConsumerAsync throw NatsJSApiException if FilterSubject contains '.'
Observed behavior
When my code like this
var consumer = await _natsJSStream.CreateOrUpdateConsumerAsync(new ConsumerConfig()
{
FilterSubject = "a.b.c"
});
Throw Exception:
NATS.Client.JetStream.NatsJSApiException:“Consumer create request did not match filtered subject from create subject”
If we use this code ,it works
var consumer = await _natsJSStream.CreateOrUpdateConsumerAsync(new ConsumerConfig()
{
FilterSubject = "a_b_c"
});
Expected behavior
FilterSubject should be able to input any character
Server and client version
nats-server: v2.10.11 (widows amd64) NATS.Net 2.1.3
Host environment
No response
Steps to reproduce
This throw Exception
var config = new StreamConfig(name: "test", subjects: new[] {
"a.b.c"
});
_natsJSStream = await _natsJSContext.CreateStreamAsync(config);
var consumer = await _natsJSStream.CreateOrUpdateConsumerAsync(new ConsumerConfig()
{
FilterSubject = "a.b.c"
});
It works:
var config = new StreamConfig(name: "test", subjects: new[] {
"a_b_c"
});
_natsJSStream = await _natsJSContext.CreateStreamAsync(config);
var consumer = await _natsJSStream.CreateOrUpdateConsumerAsync(new ConsumerConfig()
{
FilterSubject = "a_b_c"
});