What is summary value after a linkTo ?

Hi all,

I’ve created a projection to get some kind of eventbus, focused on only domain events (and not system events).

This way, I’m not forced to use $all directly and pollute my TCP connection (for a catchupSubscription) with useless events.

fromAll()

.whenAny(function(state, event) {

if (event.streamId[0] !== ‘$’) {

linkTo(‘eventbus’, event);

}

});

``

So when I append some events to a stream, these events are linked to eventbus stream.

This way, when I make the following curl command

curl -i http://127.0.0.1:2113/streams/eventbus?embed=body -H “accept:application/json”

``

I get these events. Here’s one of those :

{

  "eventId": "30d37dfd-c976-e541-a53a-32f39f34bae5",

  "eventType": "TEST_EVENT",

  "eventNumber": 2,

  "data": "{\"number\":2}",

  "metaData": "",

  "linkMetaData": "{\"$v\":\"5:-1:0:3\",\"$c\":2366470,\"$p\":2366470,\"$causedBy\":\"30d37dfd-c976-e541-a53a-32f39f34bae5\"}",

  "streamId": "testSub-54546",

  "isJson": true,

  "isMetaData": false,

  "isLinkMetaData": true,

  "positionEventNumber": 2,

  "positionStreamId": "eventbus",

  "title": "2@testSub-54546",

  "id": "http://127.0.0.1:2113/streams/testSub-54546/2",

  "updated": "2016-01-12T21:29:10.605494Z",

  "author": {

    "name": "EventStore"

  },

  "summary": "$>",

  "links": [

    {

      "uri": "http://127.0.0.1:2113/streams/testSub-54546/2",

      "relation": "edit"

    },

    {

      "uri": "http://127.0.0.1:2113/streams/testSub-54546/2",

      "relation": "alternate"

    }

  ]

}

``

The thing is : I don’t understand what I see in the summary field :

“summary”: “$>”

``

What does it mean ?

If I’m looking at the event in its original stream, here’s what I get

{

  "eventId": "30d37dfd-c976-e541-a53a-32f39f34bae5",

  "eventType": "TEST_EVENT",

  "eventNumber": 2,

  "data": "{\"number\":2}",

  "metaData": "",

  "streamId": "testSub-54546",

  "isJson": true,

  "isMetaData": false,

  "isLinkMetaData": false,

  "positionEventNumber": 2,

  "positionStreamId": "testSub-54546",

  "title": "2@testSub-54546",

  "id": "http://127.0.0.1:2113/streams/testSub-54546/2",

  "updated": "2016-01-12T21:29:10.574284Z",

  "author": {

    "name": "EventStore"

  },

  "summary": "TEST_EVENT",

  "links": [

    {

      "uri": "http://127.0.0.1:2113/streams/testSub-54546/2",

      "relation": "edit"

    },

    {

      "uri": "http://127.0.0.1:2113/streams/testSub-54546/2",

      "relation": "alternate"

    }

  ]

}

``

The summary here is the event type.

Actually, I’m using the following NodeJS client https://github.com/bmavity/ges-client, and I know that Eventstore does not support it.

And it appears that the client interprets the summary field as the event type (which might be a bad idea).

So I’m trying first to understand what this means, on the Eventstore side.

Thanks for your help

on a linkto the event happens to be $> (this is the type of a linkTo),
the summary field should not be being used in the way that it is here.
If the actual event type is wanted use:

curl -i -H "Accept:application/vnd.eventstore.atom+json"
"http://127.0.0.1:2113/streams/newstream2?embed=rich"

which will give you additional fields such as:

      "eventId": "fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4",
      "eventType": "event-type",
      "eventNumber": 0,
      "streamId": "newstream2",
      "isJson": true,
      "isMetaData": false,
      "isLinkMetaData": false,
      "positionEventNumber": 0,
      "positionStreamId": "newstream2",
      "title": "0@newstream2",
      "id": "http://127.0.0.1:2113/streams/newstream2/0",
      "updated": "2015-03-13T12:13:42.492473Z",
      "author": {
        "name": "EventStore"
      },

Greg

Thanks Greg,

Actually, that what I was expected.

But I made a mistake when talking about this nodejs client.

Actually, linkTo Events are not “resolved” by default.

When you subscribe to a stream using this client, and you provide the config resolveLinkTos to true, then you get the right event, with the original stream and event type