This commit is contained in:
Clebert Suconic 2017-10-06 18:39:27 -04:00
commit 8af0569521
4 changed files with 22 additions and 1 deletions

View File

@ -185,4 +185,8 @@ public interface ConnectionFactoryConfiguration extends EncodingSupport {
String getDeserializationWhiteList(); String getDeserializationWhiteList();
void setDeserializationWhiteList(String whiteList); void setDeserializationWhiteList(String whiteList);
int getInitialMessagePacketSize();
ConnectionFactoryConfiguration setInitialMessagePacketSize(int size);
} }

View File

@ -122,6 +122,8 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
private String deserializationWhiteList; private String deserializationWhiteList;
private int initialMessagePacketSize = ActiveMQClient.DEFAULT_INITIAL_MESSAGE_PACKET_SIZE;
// Static -------------------------------------------------------- // Static --------------------------------------------------------
// Constructors -------------------------------------------------- // Constructors --------------------------------------------------
@ -881,6 +883,18 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
return protocolManagerFactoryStr; return protocolManagerFactoryStr;
} }
@Override
public int getInitialMessagePacketSize() {
return initialMessagePacketSize;
}
@Override
public ConnectionFactoryConfiguration setInitialMessagePacketSize(int size) {
this.initialMessagePacketSize = size;
return this;
}
// Public -------------------------------------------------------- // Public --------------------------------------------------------
// Package protected --------------------------------------------- // Package protected ---------------------------------------------

View File

@ -1209,6 +1209,8 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
cf.setProtocolManagerFactoryStr(cfConfig.getProtocolManagerFactoryStr()); cf.setProtocolManagerFactoryStr(cfConfig.getProtocolManagerFactoryStr());
cf.setDeserializationBlackList(cfConfig.getDeserializationBlackList()); cf.setDeserializationBlackList(cfConfig.getDeserializationBlackList());
cf.setDeserializationWhiteList(cfConfig.getDeserializationWhiteList()); cf.setDeserializationWhiteList(cfConfig.getDeserializationWhiteList());
cf.setInitialMessagePacketSize(cfConfig.getInitialMessagePacketSize());
return cf; return cf;
} }

View File

@ -225,7 +225,8 @@ public class ConnectionFactorySerializationTest extends JMSTestBase {
ArrayList<String> connectorNames = new ArrayList<>(); ArrayList<String> connectorNames = new ArrayList<>();
connectorNames.add(main.getName()); connectorNames.add(main.getName());
connectorNames.add(main2.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"); jmsServer.createConnectionFactory(false, configuration, "/MyConnectionFactory");
} }