I’m running EventStore version 24.10. I’m using the Go client to connect to the server.
I’m writing an unhappy path integration test in which a service consumes a message from ESDB, fails to process it, and parks it.
From the test, I want to check that the message was parked and I also want to check that the parked message is the one I expected. To do this I use the go client to read from the corresponding parked message stream, which in my case is $persistentsubscription-testStream::testGroup-parked"
.
When I read from the stream I get the following event (the screenshot below is from my IDE debugger)
The problem is that the event doesn’t contain the parked message content. The Data field only contains
0@testStream
and the UserMetadata field contains
{
"added": "2025-03-14T10:43:38.2933966+00:00",
"reason": "Client explicitly NAK'ed message.\ni dont like this message"
}
If I checked in the Admin UI I can see the parked message content which is
{
"thisIsA": "rawTestEvent"
}
Why did this happen? Is this an issue with the Go client?
Hi,
Could you provide details of how you are reading that parked message stream? Are you familiar with link-to events? I’m going to assume that ResolveLinkTos is not set to True
.
It’s the way the database works, remember we’re an append-only immutable store.
We don’t “move” the events to a special queue or streams from the subscriptions : we point to it.
What you’re seeing in your read operation is a linkto
event : essentially a pointer to another event
0@testStream
means Event number 0
of testStream
If you want to read the parked message and have both the linkto
& the linked to event you need to set ResolveLinkTos : true
Here’s a table summarizing what is where in the resolved_event
When facing a… |
ResolveLink |
Event |
Link |
OrginalEvent |
regular event |
true |
the event |
null |
the event |
regular event |
false |
the event |
null |
the event |
link event |
true |
the event pointed by the link |
the link itself |
the link |
link event |
false |
the link |
null |
the link |
link event (pointing to a deleted event) |
true |
null |
the link |
the link |
link event (pointing to a deleted event) |
false |
the link |
null |
the link |
Thank you guys for the quick replay and for the explanation. Indeed, ResolveLinkTos: true,
was the option I was missing when reading from the stream. With that option set to true I was able to read the parked message.
1 Like