I still can't understand how this would work. Looking at the ShellSpout implementation, I can't see how this can work. If a spout receives a next message, it calls querySubprocess(). This function is a loop that sends a single message to the non-JVM program attached to it and then waits to receive messages until the non-JVM program sends a sync.

If next and ack can be received concurrently from Storm, it means that there can be two execution threads in the querySubprocess function at the same time. This would mean that the non-JVM program can receive an ack message, even while it is sending messages as a response to a next message. It is explicitly stated in the Storm multilang protocol that this can't happen.