Hi,
This is hard, as you may have multiple procservers spread across multiple servers, so they cannot know if they are the first one without communicating. Some ideas:
A. Let your stage persist its state to a DB, Memcached, Apache Zookeper or similar, to flag whether the first doc has been processed or not
B. Let your feeding logic be the one to know whether it's the first batch of docs or not, and submit a dummy doc which doc which triggers the wanted behavious, before sending the real documents.
Cominvent AS - www.cominvent.com
High-end FAST ESP consulting and training
Jan Høydahl - Gründer & senior architect