Description
I'm trying to use the solrJ TopicStream class to listen for data in a collection by referencing its alias. It complains about there not being any slices for that alias. On investigation it looked like the code in solrj was explicitly NOT looking at aliases in topic stream.
I made some minor changes and rebuilt and it seems to work.
in two places where getSlices is called, I set the useAlias flag to true
protected void constructStreams() throws IOException {
try {
ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();
Slice[] slices = CloudSolrStream.getSlices(this.collection, zkStateReader, true);
and also here
private void getCheckpoints() throws IOException {
this.checkpoints = new HashMap<>();
ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();
Slice[] slices = CloudSolrStream.getSlices(this.collection, zkStateReader, true);
I don't know how many versions this affects but I'm sure its a bunch. Also I hit the same errors using the REST api as I did using Solrj, so this would probably not affect that