File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
main/java/org/springframework/amqp/rabbit/connection
test/java/org/springframework/amqp/rabbit/connection Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2020 the original author or authors.
2+ * Copyright 2002-2023 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
6666 * using the supplied properties and intializes key and trust manager factories, using
6767 * algorithm {@code SunX509} by default. These are then used to initialize an
6868 * {@link SSLContext} using the {@link #setSslAlgorithm(String) sslAlgorithm} (default
69- * TLSv1.1 ).
69+ * TLSv1.2, falling back to TLSv1.1, if 1.2 is not available ).
7070 * <p>
7171 * Override {@link #createSSLContext()} to create and/or perform further modification of
7272 * the context.
@@ -672,6 +672,16 @@ public void setEnableHostnameVerification(boolean enable) {
672672 this .enableHostnameVerification = enable ;
673673 }
674674
675+ /**
676+ * Set the maximum body size of inbound (received) messages in bytes.
677+ * @param maxInboundMessageBodySize the maximum size.
678+ * @since 2.4.15
679+ * @see com.rabbitmq.client.ConnectionFactory#setMaxInboundMessageBodySize(int)
680+ */
681+ public void setMaxInboundMessageBodySize (int maxInboundMessageBodySize ) {
682+ this .connectionFactory .setMaxInboundMessageBodySize (maxInboundMessageBodySize );
683+ }
684+
675685 protected String getKeyStoreAlgorithm () {
676686 return this .keyStoreAlgorithm ;
677687 }
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2019 the original author or authors.
2+ * Copyright 2014-2023 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -76,13 +76,15 @@ public void test() throws Exception {
7676 @ Test
7777 public void testAlgNoProps () throws Exception {
7878 RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean ();
79+ fb .setMaxInboundMessageBodySize (1000 );
7980 ConnectionFactory rabbitCf = spy (TestUtils .getPropertyValue (fb , "connectionFactory" , ConnectionFactory .class ));
8081 new DirectFieldAccessor (fb ).setPropertyValue ("connectionFactory" , rabbitCf );
8182 fb .setUseSSL (true );
8283 fb .setSslAlgorithm ("TLSv1.2" );
8384 fb .afterPropertiesSet ();
8485 fb .getObject ();
8586 verify (rabbitCf ).useSslProtocol (Mockito .any (SSLContext .class ));
87+ assertThat (rabbitCf ).hasFieldOrPropertyWithValue ("maxInboundMessageBodySize" , 1000 );
8688 }
8789
8890 @ Test
You can’t perform that action at this time.
0 commit comments