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 1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
66
66
* using the supplied properties and intializes key and trust manager factories, using
67
67
* algorithm {@code SunX509} by default. These are then used to initialize an
68
68
* {@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 ).
70
70
* <p>
71
71
* Override {@link #createSSLContext()} to create and/or perform further modification of
72
72
* the context.
@@ -672,6 +672,16 @@ public void setEnableHostnameVerification(boolean enable) {
672
672
this .enableHostnameVerification = enable ;
673
673
}
674
674
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
+
675
685
protected String getKeyStoreAlgorithm () {
676
686
return this .keyStoreAlgorithm ;
677
687
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2014-2019 the original author or authors.
2
+ * Copyright 2014-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -76,13 +76,15 @@ public void test() throws Exception {
76
76
@ Test
77
77
public void testAlgNoProps () throws Exception {
78
78
RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean ();
79
+ fb .setMaxInboundMessageBodySize (1000 );
79
80
ConnectionFactory rabbitCf = spy (TestUtils .getPropertyValue (fb , "connectionFactory" , ConnectionFactory .class ));
80
81
new DirectFieldAccessor (fb ).setPropertyValue ("connectionFactory" , rabbitCf );
81
82
fb .setUseSSL (true );
82
83
fb .setSslAlgorithm ("TLSv1.2" );
83
84
fb .afterPropertiesSet ();
84
85
fb .getObject ();
85
86
verify (rabbitCf ).useSslProtocol (Mockito .any (SSLContext .class ));
87
+ assertThat (rabbitCf ).hasFieldOrPropertyWithValue ("maxInboundMessageBodySize" , 1000 );
86
88
}
87
89
88
90
@ Test
You can’t perform that action at this time.
0 commit comments