Skip to content

Commit 86c6029

Browse files
committed
Set port to default when URI uses amqp (plain)
(cherry picked from commit 6748f53) Conflicts: src/main/java/com/rabbitmq/client/ConnectionFactory.java
1 parent 5073005 commit 86c6029

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public void setVirtualHost(String virtualHost) {
350350
public void setUri(URI uri)
351351
throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException {
352352
if ("amqp".equals(uri.getScheme().toLowerCase())) {
353-
// nothing special to do
353+
setPort(DEFAULT_AMQP_PORT);
354354
} else if ("amqps".equals(uri.getScheme().toLowerCase())) {
355355
setPort(DEFAULT_AMQP_OVER_SSL_PORT);
356356
// SSL context factory not set yet, we use the default one
@@ -1442,6 +1442,7 @@ public void setMaxInboundMessageBodySize(int maxInboundMessageBodySize) {
14421442
*
14431443
* @return the connection factory
14441444
* @see #netty()
1445+
* @since 5.27.0
14451446
*/
14461447
public ConnectionFactory useNetty() {
14471448
this.netty = true;

0 commit comments

Comments
 (0)