I’m trying out competing consumers and have had some success but I’m not sure if my implementation is correct.
What I have are 3 different event types I want to load balance among X consumers.
So I created a projection:
fromStreams([’$et-Foo’, ‘$et-Bar’, ‘$et-Foobar’])
and called it main-consumer
This creates a new stream $projections-main-consumer-order with all the events of those types linked.
I then create a subscriber group to $projections-main-consumer-order - but the events I’m receiving are Link events only. Even with ResolveLinkTos. Im getting the $projection link event which is linked to the $by-event-type event projection which presumably would be linked to my actual event only ResolveLinkTo doesn’t go 2 levels deep.
The above code seems like it makes sense / would be fastest to me but doesn’t work.
If I create a projection like this:
fromStreams([’$et-Foo’, ‘$et-Bar’, ‘$et-Foobar’]).when(
Foo: function(e, s) { linkTo(‘main-consumer-temp-stream’, e); },
Bar: function(e, s) { linkTo(‘main-consumer-temp-stream’, e); },
FooBar: function(e, s) { linkTo(‘main-consumer-temp-stream’, e); }
);
and subscribe to main-consumer-temp-stream I get my events, but it seems like I’m adding more work for ES to do - and the consumer PINNED strategy seems to be double-deliverying a lot of events.
If I just want to load balance a set of event types among a bunch of consumers what is the recommended projection / configuration?