Previously I was having a problem retrieving the last sample of all available instances on a topic. My java listener was only able to retrieve one sample of the last written/updated instance and my Qos settings were:
reliability kind = reliable reliability
max samples per instance = 1
max samples = 2000
max instances = 2000
durability kind = persistent durability
direct communication = true
history kind = keep last history
history depth = 1
ownership kind = exclusive
I found a bug in the writer which was using the same instance handle to write the 2nd instance, resulting in the reader only being able to retrieve only one sample.
I am glad you were able to solve that - it is a hard problem to track down. Did you find the problem through code inspection?