Open falkolab opened 1 year ago
What kind of sink do you use? Is the previous event potentially still stuck in publishing due to retrying?
edit: overall I see 4 events, but only one published. I guess there should be Text=12, 13, 14, 15, shouldn't it?
I suppose I trying to listen as core pob/sub but in fact it's is jetStream so I need to have Consumers configured. The publisher doesn't receive ack from stream server. This is my assumption, I'm investigating this thoughts
edit: overall I see 4 events, but only one published. I guess there should be Text=12, 13, 14, 15, shouldn't it?
Yes, every time I restart the app, it sends the first "12" message and gets stuck on the publishing stage. I'm using the Openfaas CE installation, which doesn't use JetStream. I initially thought that you used Subject-Based Messaging. So, I believe we can close the issue, as I need to rethink my plans.
You can totally implement your own sink, however the pub-sub system doesn't have order guarantees, which is why I don't use it.
You can use redpanda or just run a nats docker container.
The idea was to link postgresql CDC to openfaas functions over nats-connect
(it translates nats messages to func call) but you use jetStream and nats-connect uses nats core pub-sub. Yes I see what you mean.
Please pay attention you use "CDC (Chance Data Capture)" in the project description and readme, I suppose it was typo, the correct is CDC (Change Data Capture)
Oh, good catch! Copy and paste for the win. Fixed it! Thanks again 💪
I have completed some investigations, and as a newbie in NATS and JetStream, I assumed that the stream would be created when publishing a message. However, that is not true. One will have to create the jetstream with wildcard subject for example: nats str add test_timescaledb_public --subjects "timescaledb.public.*" --max-msgs 1000
I would advice some improvement:
Add configurable deadline on event pushing to not existed stream in order to avoid stuck
// TODO add config param
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_, err = n.jetStreamContext.PublishMsg(
&nats.Msg{
Subject: topicName,
Header: header,
Data: envelopeData,
},
nats.Context(ctx),
)
What is weird is that the client returned an error headers not supported by this server
when the stream were not exist.
I'll create PR
I encountered a problem. The first change was successfully sent to the subscription topic, and I can read it, but the subsequent changes are getting stuck in the event-streamer.
I am debugging it and observing that it adds the task using rh.taskManager.EnqueueTask, but the task doesn't execute. The first change:
The second: