Suppose any one of the apps can consume. Then the apps will try to create an ephemeral znode, say "/consumerstarted" and will start consuming if creation succeeded. Whichever app creates the ephemeral node first, that will be the consumer. The other app will get "Zookeeper node already exist" kind of exception and will decide not to consume. Now from both the apps you should set a watch on the Znode and the watch listener will be fired when the node gets deleted (may be because of the owner app explicitly deleting the ephemeral node or the owner app shutdown, or owner app losing connection to Zookeeper). Then the apps should again try to become consumer by creating the ephemeral "/consumerstarted" Znode.
Another approach may be: All the apps registers their own ephemeral Znodes under some "folder" say "/allapps". The name of the Znodes may be some unique Id. Eg., /allapps/uuid1, /allapps/uuid2 etc. All the apps should put watches on their corresponding Znode for data changes. Whenever the data is set to something like "start consuming", the corresponding app should start consuming. You may set data from another program or Zookeeper CLI.
BTW, https://github.com/sgroschupf/zkclient is a very good Zookeeper client library.