Couple Questions

Just working through the example, when I’m reading an item from the queue (i.e. streams/newstream/0) the item stays in the queue - using DELETE at the item-id level does not appear to work, so a couple questions:

  1. How do you remove item “0” from streams/newstream - or am I just doing it wrong?

  2. The “subscriber” example is just polling - does Event Source support a push model for notifying workers as the queue has new items added or is polling the only supported approach out of the box?

  3. What is the recommended pattern for data consistency - i.e. how do I ensure that if a client consumes an item from the queue but crashes, the work does not become lost?

Looks really straight forward and nice, looking forward to working with Event Store in the future :).

If you are trying to treat it as a queue then you should use the
competing consumer http api not reading from streams over atom (they
are very similar but competing consumers allows multiple clients and
handles timeouts/retries etc).




As a related question, if I'm using competing consumers and autoAc is set to true, when does the acknowledgement occur? How does this effect consumers that may crash?

If autoack is set to true it occurs as soon as your handler returns.
In terms of how it affects consumers it depends on what your consumer
does, if it processes synchronously the message will be retried either
when the connection fails (if a fail is seen) or when the timeout

Hi Greg,

Thanks, so when would you set autoAc to false? If I do this, what do I need to call to acknowledge a message?

there is an acknowledge method

Thanks Greg - pardon if I’ve missed the obvious but is there a sample code snippet to show this use case in action?

The http competing consumer API?
shows the http flow using curl (scroll down to reading stream).

That’ll do - thanks again :slight_smile:

Main thing is to have the consumer post to the rel link:

          "relation": "ack"

This will acknowledge the message. If the message has not been acked
based on configuraiton settings of the subscription (see competing
consumers server docs) the message will become eligible to be read

This will also work with N consumers over http. You can also monitor
the status of the subscription (how far consumers are etc) either via
the dashboard or via the http uri to the subscription.



Greg - how are you expecting that auth is handled in the request - I’m trying to create a stream via Postman and getting the response (401) - Basic auth doesn’t seem to be supported, so is there a particular form for Authorization we’re using (i.e. :)?

PUT /subscriptions/newstream/test HTTP/1.1


Content-Type: application/json

Authorization: admin:changeit

Cache-Control: no-cache

Postman-Token: 0ac402b6-e2d8-1551-04d7-0f78ae5784f4



basic auth is supported why are you doing a put?

From the docs:


Would you be able to paste a request header as an example - using basic auth gets me a 500 ISE .

Ok this works - using url encoded name/pwd instead of Authorization header seems to work fine anyhow.

Ah I read the uri wrong … yes that is a put to create the subscription.

Basic auth should work (curl etc doesn’t have an issue)