We now can shutdown a connection that is blocked on send due to queue limits.
Stats tracking code added recently was causing a NPE at times. Added a gaurd against the NPE
git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-4.1@511089 13f79535-47bb-0310-9956-ffa450edef68
Enhanced the JMX stats so that the enqueue and dequeue attributes on the connection object actually reflect what's been enqueued and dequeued on it. Also fixed stats on Topics so they make sense.
git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-4.1@511084 13f79535-47bb-0310-9956-ffa450edef68
You can now disable a connection from watching topic advisories by setting the 'watchTopicAdvisories' option on the ActiveMQConnectionFactory to true.
For large networks were lots of temporary topic consumers are being created and destroyed, this can result in lower overhead since those events do not need to get replicated to all the connections on the network.
This improves the handling of temp destination over networks but it relaxed a few restrictions to get around timing issues with the networks. If a message is sent to non-existant temp destination, the temp destination will be created so that the message is not dropped. This could potentially create temp destinations for connections that will never get re-established.
git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-4.1@511082 13f79535-47bb-0310-9956-ffa450edef68
Fixing memory leak that could occur if a connection attemp is not successful (for example if the broker is down and failover is not being used).
If the client app loops re-attempting to reconnect and continues to fail, the leak to lead to a OOM exception quickly.
git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-4.1@511081 13f79535-47bb-0310-9956-ffa450edef68
Flag a ConnectionContext as being a network connection if it sends us a BrokerInfo.
Disable flow control if the producer is on a network connection.. trying to get around a network deadlock.
git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-4.1@511080 13f79535-47bb-0310-9956-ffa450edef68
When a message send blocks on a destination level usage manager, it blocks all publishers on the same connection even publishers that are publishing to destinations who's limits have not been reached. In some scenarios, this can result in a deadlock since it prevents publishing to a destination that could otherwise receive messages.
This patch delays sending the repsone to sync publishers until the destination usage allows the message to be sent but does not block on the send. This allows other producers on the same connection to get serviced but flow controls the producers on full destinations by delaying the send response.
In order to take advantage of this new producer flow control which avoid the described deadlock, sync sends must be used. To force sync sends for all send requests, a new 'useSyncSend' option should be set to true on the ActiveMQConnectionFactory.
Hopefully a future version this patch will be developed that provides the same feaure but works with async sends and a producer ack to flow control the producer.
git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-4.1@511078 13f79535-47bb-0310-9956-ffa450edef68
Created a ReconnectTest that showed problems with the synchronization used when a client reconnects to a server via failover before the server detects the client failure.
- InactivityMonitor : Better syncronization so that an inactivty exception is only raised once.
- Connection: Added serviceExceptionAsync() method and change all methods that are dispatching to use this instead of serviceException() to avoid possible deadlock that can occur during connection shutdown.
- MockTransport: finer grained sychonization to avoid deadlocks.
- PrefetchSubscription: it is possible it will get duplicate acks on a failover reconnect
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@471837 13f79535-47bb-0310-9956-ffa450edef68