Sorry, earlier posting was truncated, some how.
We have a used a topic to post requests, that are sent to external application, by the Topic Subscriber. When we receive response back, we want to match the request to the response.
The way we thought we could achieve this is, by appending a uniqueID to the request and receiving the same ID back in the response (the external application guarantees to send that ID back). At the time of receiving the response create a durable subscriber to the same Topic above, and based on the ID of the response, receive the corresponding request from the Topic, using the message selector.
However, with what we have seen, message selector can only be supplied as constructor argument. And, message selector has to have some value. In our case, it ought to be some thing like ID = '12345'. But, we don't know '12345' until we have received a response back from external application on the fly.
With out having the second subscriber; we probably will loose the requests form the Topic by the time we receive responses back from external application, as they are received by the first subscriber.
Any suggestions/ ideas?