There appears to be a socket connection leak in hornetq. Over long period of time the number of opened sockets is growing and is never coming down. Taking a thread dump it is possible to see a large number of following threads:
"Old I/O server worker (parentId: 59149030, [id: 0x03868ae6, raggz/192.168.1.110:5445])" prio=10 tid=0x0000000000cd7800 nid=0x3925 runnable [0x00007f325c3bb000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:146)
at java.net.SocketInputStream.read(SocketInputStream.java:199)
To reproduce the issue one needs two JBoss EAP 5.1.2 instances with HornetQ 2.2.10. One instance hosts JMS destinations the other instance is configured as a remote jms provider and consumes messages from the first instances. On second instance deploy a number of MDBs that listen on remote destinations in instance one and then on receiving a messages send a message back to a remote destination on instance one.
Run the application for about 6-12 hours checking the number of open sockets on the first instance i.e. "lsof -p <pid> | grep TCP | wc -l". The number will steadily grow, it never goes down.