Skip to content

1.3.0.release causes jms.InvalidClientIDException after devtools restart #4526

@peterdnight

Description

@peterdnight

Works on initial start, but not after a devtools restart. Seems JmsTemplate is not disconnecting the previous connection as part of the restart. I am setting the clientID, and now have added a System.currentTimeMillis to the end of the clientID I am setting as a workaround.

So while i am getting a nice devtools restart, I did confirm connections are increasing (via active mq console) that every time devtools restart occurs , another connection is getting added.

Ideally - devTools should be removing the old connection and construct a new one.

SingleConnectionFactory connectionFactory = new SingleConnectionFactory();
        connectionFactory.setReconnectOnException( true );
        connectionFactory
                .setClientId( ... + System.currentTimeMillis() );

Without adding a currentTimeMillis to get a unique client id, the following exception will occur on restarts; but as noted above - connections are leaking when this is done.

org.springframework.jms.InvalidClientIDException: Broker: localhost - Client: MyDesktop-MYPC-JMS-SENDER already connected from tcp://10.116.103.99:55631; nested exception is javax.jms.InvalidClientIDException: Broker: localhost - Client: MyDesktop-MYPC-JMS-SENDER already connected from tcp://10.116.103.99:55631
    at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:282) ~[spring-jms-4.2.3.RELEASE.jar:4.2.3.RELEASE]

Metadata

Metadata

Assignees

Labels

status: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions