Competing consumers and projections

Two questions related to competing consumers

  1. How do we make sure we process events exactly once? If eventstore server crashes before checkpoint is written, there is a possibility duplicate events may be sent. Is it the responsibility of the subscriber(s) to handle this?

  2. How to enforce ordering (precedence requirement)? Say we have a publisher which writes two events- Event A and Event B and we have two subscribers. How to make sure Event B is processed only after Event A is processed. Should this be handled by the subscribers or is there some other way the event store can help?

Also one related to projections

Say we create a projection A and then we create a new projection B, how do we make sure projection B only contains events that have not been acknowledged?

inline.

Two questions related to competing consumers

1. How do we make sure we process events exactly once? If eventstore server
crashes before checkpoint is written, there is a possibility duplicate
events may be sent. Is it the responsibility of the subscriber(s) to handle
this?

You buy a magic bean and climb the bean stalk. exactly-once messaging
doesn't exist. You can simulate it varying ways but it doesn't exist
http://bravenewgeek.com/you-cannot-have-exactly-once-delivery/

2. How to enforce ordering (precedence requirement)? Say we have a publisher
which writes two events- Event A and Event B and we have two subscribers.
How to make sure Event B is processed only after Event A is processed.
Should this be handled by the subscribers or is there some other way the
event store can help?

You cant unless your consumers are interacting with each other for
obvious reasons (how long is the network path to each?). What you can
do is as example make sure all messages from the same stream go to the
same consumer. See pinned strategy.

Also one related to projections
Say we create a projection A and then we create a new projection B, how do
we make sure projection B only contains events that have not been
acknowledged?

I have no idea what you are asking

Also one related to projections

Say we create a projection A and then we create a new projection B, how do

we make sure projection B only contains events that have not been

acknowledged?

I have no idea what you are asking

Say, you have projection A which links Event A from Stream A to stream B. Subscriber receives it, processes and sends ack. Now, I create a new projection B. How do I filter out all existing Events (e.g. Event A) from Stream A for which ack has been received and link the remaining events to Stream C?

You would implement this on your own. How would we know to do this?
Stream B and Stream C are two different subscriptions.

Just to add the subscriber initially listens to Stream B. So Event A is processed and an ack sent.

Now we build a new projection from events in Stream A but want to filter out Event A. Is this even possible?

That is what we thought. Thanks for the confirmation