[ARTEMIS-1450] Support InitialMessagePacketSize on JMS ConnectionFactoryConfiguration
JIRA: https://issues.apache.org/jira/browse/ARTEMIS-1450
This commit is contained in:
parent
f364dd072b
commit
5401ec383f
|
@ -185,4 +185,8 @@ public interface ConnectionFactoryConfiguration extends EncodingSupport {
|
|||
String getDeserializationWhiteList();
|
||||
|
||||
void setDeserializationWhiteList(String whiteList);
|
||||
|
||||
int getInitialMessagePacketSize();
|
||||
|
||||
ConnectionFactoryConfiguration setInitialMessagePacketSize(int size);
|
||||
}
|
||||
|
|
|
@ -122,6 +122,8 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
|
|||
|
||||
private String deserializationWhiteList;
|
||||
|
||||
private int initialMessagePacketSize = ActiveMQClient.DEFAULT_INITIAL_MESSAGE_PACKET_SIZE;
|
||||
|
||||
// Static --------------------------------------------------------
|
||||
|
||||
// Constructors --------------------------------------------------
|
||||
|
@ -881,6 +883,18 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
|
|||
return protocolManagerFactoryStr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInitialMessagePacketSize() {
|
||||
return initialMessagePacketSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionFactoryConfiguration setInitialMessagePacketSize(int size) {
|
||||
this.initialMessagePacketSize = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
// Public --------------------------------------------------------
|
||||
|
||||
// Package protected ---------------------------------------------
|
||||
|
|
|
@ -1209,6 +1209,8 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
|
|||
cf.setProtocolManagerFactoryStr(cfConfig.getProtocolManagerFactoryStr());
|
||||
cf.setDeserializationBlackList(cfConfig.getDeserializationBlackList());
|
||||
cf.setDeserializationWhiteList(cfConfig.getDeserializationWhiteList());
|
||||
cf.setInitialMessagePacketSize(cfConfig.getInitialMessagePacketSize());
|
||||
|
||||
return cf;
|
||||
}
|
||||
|
||||
|
|
|
@ -225,7 +225,8 @@ public class ConnectionFactorySerializationTest extends JMSTestBase {
|
|||
ArrayList<String> connectorNames = new ArrayList<>();
|
||||
connectorNames.add(main.getName());
|
||||
connectorNames.add(main2.getName());
|
||||
ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl().setName("MyConnectionFactory").setHA(b).setConnectorNames(connectorNames).setClientID("clientID").setClientFailureCheckPeriod(-1).setConnectionTTL(-2).setFactoryType(JMSFactoryType.CF).setCallTimeout(-3).setCallFailoverTimeout(-4).setCacheLargeMessagesClient(b).setMinLargeMessageSize(-5).setConsumerWindowSize(-6).setConsumerMaxRate(-7).setConfirmationWindowSize(-8).setProducerWindowSize(-9).setProducerMaxRate(-10).setBlockOnAcknowledge(b).setBlockOnDurableSend(b).setBlockOnNonDurableSend(b).setAutoGroup(b).setPreAcknowledge(b).setLoadBalancingPolicyClassName("foobar").setTransactionBatchSize(-11).setDupsOKBatchSize(-12).setUseGlobalPools(b).setScheduledThreadPoolMaxSize(-13).setThreadPoolMaxSize(-14).setRetryInterval(-15).setRetryIntervalMultiplier(-16).setMaxRetryInterval(-17).setReconnectAttempts(-18).setFailoverOnInitialConnection(b).setGroupID("groupID");
|
||||
ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl().setName("MyConnectionFactory").setHA(b).setConnectorNames(connectorNames).setClientID("clientID").setClientFailureCheckPeriod(-1).setConnectionTTL(-2).setFactoryType(JMSFactoryType.CF).setCallTimeout(-3).setCallFailoverTimeout(-4).setCacheLargeMessagesClient(b).setMinLargeMessageSize(-5).setConsumerWindowSize(-6).setConsumerMaxRate(-7).setConfirmationWindowSize(-8).setProducerWindowSize(-9).setProducerMaxRate(-10).setBlockOnAcknowledge(b).setBlockOnDurableSend(b).setBlockOnNonDurableSend(b).setAutoGroup(b).setPreAcknowledge(b).setLoadBalancingPolicyClassName("foobar").setTransactionBatchSize(-11).setDupsOKBatchSize(-12).setUseGlobalPools(b).setScheduledThreadPoolMaxSize(-13).setThreadPoolMaxSize(-14).setRetryInterval(-15).setRetryIntervalMultiplier(-16).setMaxRetryInterval(-17).setReconnectAttempts(-18).setFailoverOnInitialConnection(b).setGroupID("groupID")
|
||||
.setInitialMessagePacketSize(1499);
|
||||
|
||||
jmsServer.createConnectionFactory(false, configuration, "/MyConnectionFactory");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue