-
1. Re: Connection.setClientID() not throwing InvalidClientIDException on a duplicate ClientID?
clebert.suconic May 6, 2010 11:35 AM (in response to fbroek)Your test basically is:
public void testDuplicate() throws Exception {Connection c1 = null;Connection c2 = null;try {c1 = cf.createConnection();c1.setClientID("Duplicated");try {c2 = cf.createConnection();c2.setClientID("Duplicated");fail("HornetQ is allowing duplicate clients!");} catch (InvalidClientIDException e) {}Which I think it's ok...
You just can't have duplicate Topics. We are 100% TCK. I don't think this is illegal.
-
2. Re: Connection.setClientID() not throwing InvalidClientIDException on a duplicate ClientID?
timfox May 6, 2010 11:42 AM (in response to clebert.suconic)The test does not seem valid to me.
The JMS spec does not prevent the same client id being used set on different connections. The client id identifies the client and a particular client can own man connections.
-
3. Re: Connection.setClientID() not throwing InvalidClientIDException on a duplicate ClientID?
fbroek May 7, 2010 4:56 AM (in response to timfox)In that case I'm a bit puzzled, as the Javadoc for Connection.setClientID() says:
"If another connection with the same
clientID
is already running when this method is called, the JMS provider should detect the duplicate ID and throw anInvalidClientIDException
." (taken from http://java.sun.com/javaee/6/docs/api/javax/jms/Connection.html#setClientID%28java.lang.String%29 ) -
4. Re: Connection.setClientID() not throwing InvalidClientIDException on a duplicate ClientID?
clebert.suconic May 7, 2010 11:35 AM (in response to fbroek)This is probably an optional thing, as the TCK is passing.
The main thing here is to not accept duplicate subscriptions on a topic, and that's working fine.