mirror of https://github.com/apache/activemq.git
need to call free on the amqp resources now to ensure their state data is all cleaned up.
This commit is contained in:
parent
1abc95b6a4
commit
3afde7bac7
|
@ -32,6 +32,7 @@ import javax.jms.InvalidSelectorException;
|
||||||
import org.apache.activemq.command.ActiveMQDestination;
|
import org.apache.activemq.command.ActiveMQDestination;
|
||||||
import org.apache.activemq.command.ActiveMQMessage;
|
import org.apache.activemq.command.ActiveMQMessage;
|
||||||
import org.apache.activemq.command.ActiveMQTempQueue;
|
import org.apache.activemq.command.ActiveMQTempQueue;
|
||||||
|
import org.apache.activemq.command.ActiveMQTempTopic;
|
||||||
import org.apache.activemq.command.Command;
|
import org.apache.activemq.command.Command;
|
||||||
import org.apache.activemq.command.ConnectionError;
|
import org.apache.activemq.command.ConnectionError;
|
||||||
import org.apache.activemq.command.ConnectionId;
|
import org.apache.activemq.command.ConnectionId;
|
||||||
|
@ -53,7 +54,6 @@ import org.apache.activemq.command.SessionId;
|
||||||
import org.apache.activemq.command.SessionInfo;
|
import org.apache.activemq.command.SessionInfo;
|
||||||
import org.apache.activemq.command.ShutdownInfo;
|
import org.apache.activemq.command.ShutdownInfo;
|
||||||
import org.apache.activemq.command.TransactionInfo;
|
import org.apache.activemq.command.TransactionInfo;
|
||||||
import org.apache.activemq.command.ActiveMQTempTopic;
|
|
||||||
import org.apache.activemq.selector.SelectorParser;
|
import org.apache.activemq.selector.SelectorParser;
|
||||||
import org.apache.activemq.util.IOExceptionSupport;
|
import org.apache.activemq.util.IOExceptionSupport;
|
||||||
import org.apache.activemq.util.IdGenerator;
|
import org.apache.activemq.util.IdGenerator;
|
||||||
|
@ -83,7 +83,6 @@ import org.apache.qpid.proton.engine.Connection;
|
||||||
import org.apache.qpid.proton.engine.Delivery;
|
import org.apache.qpid.proton.engine.Delivery;
|
||||||
import org.apache.qpid.proton.engine.EndpointState;
|
import org.apache.qpid.proton.engine.EndpointState;
|
||||||
import org.apache.qpid.proton.engine.Event;
|
import org.apache.qpid.proton.engine.Event;
|
||||||
import org.apache.qpid.proton.engine.Event.Type.*;
|
|
||||||
import org.apache.qpid.proton.engine.Link;
|
import org.apache.qpid.proton.engine.Link;
|
||||||
import org.apache.qpid.proton.engine.Receiver;
|
import org.apache.qpid.proton.engine.Receiver;
|
||||||
import org.apache.qpid.proton.engine.Sasl;
|
import org.apache.qpid.proton.engine.Sasl;
|
||||||
|
@ -310,6 +309,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
|
||||||
} else if (remoteState == EndpointState.CLOSED) {
|
} else if (remoteState == EndpointState.CLOSED) {
|
||||||
((AmqpDeliveryListener) link.getContext()).onClose();
|
((AmqpDeliveryListener) link.getContext()).onClose();
|
||||||
link.close();
|
link.close();
|
||||||
|
link.free();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,6 +481,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
|
||||||
session.setContext(null);
|
session.setContext(null);
|
||||||
}
|
}
|
||||||
session.close();
|
session.close();
|
||||||
|
session.free();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onLinkOpen(Link link) {
|
private void onLinkOpen(Link link) {
|
||||||
|
|
|
@ -46,11 +46,9 @@ import org.apache.activemq.broker.jmx.ConnectorViewMBean;
|
||||||
import org.apache.activemq.broker.jmx.QueueViewMBean;
|
import org.apache.activemq.broker.jmx.QueueViewMBean;
|
||||||
import org.apache.activemq.transport.amqp.joram.ActiveMQAdmin;
|
import org.apache.activemq.transport.amqp.joram.ActiveMQAdmin;
|
||||||
import org.apache.activemq.util.Wait;
|
import org.apache.activemq.util.Wait;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.objectweb.jtests.jms.framework.TestConfig;
|
import org.objectweb.jtests.jms.framework.TestConfig;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -309,6 +307,7 @@ public class JMSClientTest extends JMSClientTestSupport {
|
||||||
final Message m = session.createTextMessage("Sample text");
|
final Message m = session.createTextMessage("Sample text");
|
||||||
|
|
||||||
Testable t = new Testable() {
|
Testable t = new Testable() {
|
||||||
|
@Override
|
||||||
public synchronized void run() {
|
public synchronized void run() {
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < 30; ++i) {
|
for (int i = 0; i < 30; ++i) {
|
||||||
|
@ -343,6 +342,7 @@ public class JMSClientTest extends JMSClientTestSupport {
|
||||||
|
|
||||||
|
|
||||||
Testable t = new Testable() {
|
Testable t = new Testable() {
|
||||||
|
@Override
|
||||||
public synchronized void run() {
|
public synchronized void run() {
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
@ -400,6 +400,7 @@ public class JMSClientTest extends JMSClientTestSupport {
|
||||||
|
|
||||||
final MessageConsumer consumer=session.createConsumer(queue);
|
final MessageConsumer consumer=session.createConsumer(queue);
|
||||||
Testable t = new Testable() {
|
Testable t = new Testable() {
|
||||||
|
@Override
|
||||||
public synchronized void run() {
|
public synchronized void run() {
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
@ -433,6 +434,7 @@ public class JMSClientTest extends JMSClientTestSupport {
|
||||||
|
|
||||||
final MessageConsumer consumer=session.createConsumer(queue);
|
final MessageConsumer consumer=session.createConsumer(queue);
|
||||||
Testable t = new Testable() {
|
Testable t = new Testable() {
|
||||||
|
@Override
|
||||||
public synchronized void run() {
|
public synchronized void run() {
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
@ -466,6 +468,7 @@ public class JMSClientTest extends JMSClientTestSupport {
|
||||||
final MessageConsumer consumer=session.createConsumer(queue);
|
final MessageConsumer consumer=session.createConsumer(queue);
|
||||||
|
|
||||||
Testable t = new Testable() {
|
Testable t = new Testable() {
|
||||||
|
@Override
|
||||||
public synchronized void run() {
|
public synchronized void run() {
|
||||||
try {
|
try {
|
||||||
Message m = consumer.receive(1);
|
Message m = consumer.receive(1);
|
||||||
|
|
Loading…
Reference in New Issue