You can debug the broker just like you'd debug any remote Java application: http://www.codeproject.com/Articles/795423/Remote-Debug-Java-Applications-From-Eclipse
Make sure you download the source code for the exact version of ActiveMQ that you're using so you can attach source and step through properly; otherwise line numbers won't match up and it'll be a very frustrating experience. Tim On Jun 9, 2015 7:43 AM, "Tim Bain" <tb...@alumni.duke.edu> wrote: > Can you put a breakpoint on the call to socket.close() in > TcpTransport.doStop() ( > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.activemq/activemq-client/5.11.1/org/apache/activemq/transport/tcp/TcpTransport.java#TcpTransport.doStop%28org.apache.activemq.util.ServiceStopper%29) > and see whether it's actually calling close() on the socket and also > whether it's succeeding? > > Tim > > On Mon, Jun 8, 2015 at 6:30 AM, tariq zafar <tariq.zafa...@yahoo.co.in> > wrote: > >> I am having an issue with activemq broker. My requirement is that whenever >> the same client requests for a connection again then I should close the >> existing connection with that client and start a new one. For this >> purpose I >> have written a plugin that calls old connection closure getting the >> connection details that were saved in two maps earlier (for >> ConnectionContext and ConnectionInfo respectively) when that connection >> was >> created. >> >> I call these apis >> >> * >> >> ((TransportConnection)localConnectionContext.getConnection()).processRemoveConnection(); >> //localConnectionContext is got from connContext save in map. >> ((TransportConnection)localConnectionContext.getConnection()).stop(); >> * >> >> Using this code whenever I connect through another client with same client >> id in jconsole I can see remote address for the client getting changed and >> old remote address getting removed. >> >> However, my connection is getting closed only on activemq level and not on >> tcp level. Using netstat -a I can still see old connections that were made >> through same client in establishes state. I am using a websocket >> connection. >> What tcp setting should I do in activemq.xml that old sockets get closed >> on >> tcp level? >> >> >> >> -- >> View this message in context: >> http://activemq.2283324.n4.nabble.com/Regarding-activemq-sockets-not-getting-closed-tp4697390.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> > >