mirror of https://github.com/apache/activemq.git
Don't link the AMQP max frame size to the TransportConnector maxFrameSize value.
This commit is contained in:
parent
3afde7bac7
commit
b2e6a41661
|
@ -125,19 +125,12 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
|
|||
public AmqpProtocolConverter(AmqpTransport transport) {
|
||||
this.amqpTransport = transport;
|
||||
|
||||
int maxFrameSize = AmqpWireFormat.DEFAULT_MAX_FRAME_SIZE;
|
||||
|
||||
// AMQ-4914 - Setting the max frame size to large stalls out the QPid
|
||||
// client on sends or
|
||||
// consume due to no session credit. Once fixed we should set this value
|
||||
// using
|
||||
// the configured maxFrameSize on the URI.
|
||||
// int maxFrameSize = transport.getWireFormat().getMaxFrameSize() >
|
||||
// Integer.MAX_VALUE ?
|
||||
// Integer.MAX_VALUE : (int)
|
||||
// transport.getWireFormat().getMaxFrameSize();
|
||||
int maxFrameSize = transport.getWireFormat().getMaxAmqpFrameSize();
|
||||
if (maxFrameSize > AmqpWireFormat.NO_AMQP_MAX_FRAME_SIZE) {
|
||||
this.protonTransport.setMaxFrameSize(maxFrameSize);
|
||||
}
|
||||
|
||||
this.protonTransport.setMaxFrameSize(maxFrameSize);
|
||||
this.protonTransport.bind(this.protonConnection);
|
||||
this.protonConnection.collect(eventCollector);
|
||||
updateTracer();
|
||||
|
|
|
@ -34,10 +34,12 @@ import org.fusesource.hawtbuf.Buffer;
|
|||
|
||||
public class AmqpWireFormat implements WireFormat {
|
||||
|
||||
public static final int DEFAULT_MAX_FRAME_SIZE = 1024 * 1024 * 1;
|
||||
public static final long DEFAULT_MAX_FRAME_SIZE = Long.MAX_VALUE;
|
||||
public static final int NO_AMQP_MAX_FRAME_SIZE = -1;
|
||||
|
||||
private int version = 1;
|
||||
private long maxFrameSize = DEFAULT_MAX_FRAME_SIZE;
|
||||
private int maxAmqpFrameSize = NO_AMQP_MAX_FRAME_SIZE;
|
||||
|
||||
@Override
|
||||
public ByteSequence marshal(Object command) throws IOException {
|
||||
|
@ -116,4 +118,12 @@ public class AmqpWireFormat implements WireFormat {
|
|||
public void setMaxFrameSize(long maxFrameSize) {
|
||||
this.maxFrameSize = maxFrameSize;
|
||||
}
|
||||
|
||||
public int getMaxAmqpFrameSize() {
|
||||
return maxAmqpFrameSize;
|
||||
}
|
||||
|
||||
public void setMaxAmqpFrameSize(int maxAmqpFrameSize) {
|
||||
this.maxAmqpFrameSize = maxAmqpFrameSize;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ import javax.jms.Topic;
|
|||
|
||||
import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
|
||||
import org.junit.After;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
|
|
Loading…
Reference in New Issue