This commit is contained in:
Clebert Suconic 2021-02-07 11:16:31 -05:00
commit eb273d1073
2 changed files with 28 additions and 1 deletions

View File

@ -2059,7 +2059,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
// Default bridge conf
int confirmationWindowSize = getTextBytesAsIntBytes(brNode, "confirmation-window-size", ActiveMQDefaultConfiguration.getDefaultBridgeConfirmationWindowSize(), Validators.POSITIVE_INT);
int producerWindowSize = getTextBytesAsIntBytes(brNode, "producer-window-size", ActiveMQDefaultConfiguration.getDefaultBridgeConfirmationWindowSize(), Validators.POSITIVE_INT);
int producerWindowSize = getTextBytesAsIntBytes(brNode, "producer-window-size", ActiveMQDefaultConfiguration.getDefaultBridgeProducerWindowSize(), Validators.POSITIVE_INT);
long retryInterval = getLong(brNode, "retry-interval", ActiveMQClient.DEFAULT_RETRY_INTERVAL, Validators.GT_ZERO);

View File

@ -260,6 +260,33 @@ public class FileConfigurationParserTest extends ActiveMQTestBase {
assertEquals("helloworld", bconfig.getPassword());
}
@Test
public void testDefaultBridgeProducerWindowSize() throws Exception {
FileConfigurationParser parser = new FileConfigurationParser();
String configStr = firstPart +
"<bridges>\n" +
" <bridge name=\"my-bridge\">\n" +
" <queue-name>sausage-factory</queue-name>\n" +
" <forwarding-address>mincing-machine</forwarding-address>\n" +
" <static-connectors>\n" +
" <connector-ref>remote-connector</connector-ref>\n" +
" </static-connectors>\n" +
" </bridge>\n" +
"</bridges>\n"
+ lastPart;
ByteArrayInputStream input = new ByteArrayInputStream(configStr.getBytes(StandardCharsets.UTF_8));
Configuration config = parser.parseMainConfig(input);
List<BridgeConfiguration> bridgeConfigs = config.getBridgeConfigurations();
assertEquals(1, bridgeConfigs.size());
BridgeConfiguration bconfig = bridgeConfigs.get(0);
assertEquals(ActiveMQDefaultConfiguration.getDefaultBridgeProducerWindowSize(), bconfig.getProducerWindowSize());
}
@Test
public void testParsingOverflowPageSize() throws Exception {
testParsingOverFlow("<address-settings>" + "\n" + "<address-setting match=\"#\">" + "\n" + "<page-size-bytes>2147483648</page-size-bytes>\n" + "</address-setting>" + "\n" + "</address-settings>" + "\n");