Closed kss943 closed 4 years ago
Hi @kss943,
It seems that you are appending an ID to the stream name when you are writing the event, but only subscribing to TestStream
without the appended ID. Perhaps you want to subscribe to the category projection, $ce-TestStream
to receive all TestStream
events
@mmuller99
Did you mean to add $ce
in line of code below?
await client.subscribeToStream('$ce-TestStream', onEventAppeared, onDropped, false)
It doesn't work too.
Stream appeared at EventStore 'Stream Browser' but onEventAppeared function doesn't work.
Did the event appear on the $ce-TestStream
as well?
@mmuller99 I got this in Stream Browser but onEventAppeared function did not log it:
So neither onEventAppeared and onDropped got called at all? I do see that our Readme still states the handler as onEventAppeared(ev)
instead of what it is now onEventAppeared(subscription, ev)
.
@mmuller99
onDropped()
work, for example when i close EventStore container.
As i see this function is called after event creating (node event.js) in subscribeToStream.js file of library:
onEvent = function onEvent(sub, ev) {
var mappedEvent = (0, _mapEvents.default)([ev])[0];
if (mappedEvent) onEventAppeared(mappedEvent);
};
When the line var mappedEvent = (0, _mapEvents.default)([ev])[0];
starts executing it call this._log.error(err, "Exception during executing user callback: %s.", err.message);
in SubscriptionOperation.prototype._executeActions
which belongs to node-eventstore-client library.
err.message = "Unexpected token @ in JSON at position 1"
While using node-eventstore-client with its function subscribeToAll()
, onEventAppeared
is called
Thanks, I see you've opened up a PR for the readme fix. Would it be possible for you to please replicate your scenario with a failing test within the library?
I just started $by_category
projection via EventStore web interface and it works now.
Also added second parameter to onEventAppeared
and now this function work.
So, is it important always start $by_category
projection? Maybe that must be added to readme?
I have two files app.js:
event.js:
When i run node app.js and after that try to write stream node event.js function onEventAppeared don't react . What can i implement this ?