But, Why would there be a setClientId() at the connection factory level ?
setClientId() on the connection factory is used to administratively set the client id, to prevent consumer applications from setting it manually; in fact, according to JMS spec, if client id is set by the client when it was already set by the factory, an exception is thrown.
Can we say one should NOT use the setClientId() on a Single/CachingConnectionFactory?
If you need to create durable subscriptions for different subscribers, each with its own client id, use subscriber.setClientId(), because if you use connectionFactory.setClientId() and attempt to create multiple connections from the same factory with client id already set, the factory will throw an exception complaining that "connection clientId is already connected."
Personally, I like having flexibility and complete control in my code, so I use subscriber.setClientId()