Skip to content

Commit 6748f53

Browse files
committed
Set port to default when URI uses amqp (plain)
1 parent 0a82b11 commit 6748f53

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
@@ -351,7 +351,7 @@ public ConnectionFactory setVirtualHost(String virtualHost) {
351351
public ConnectionFactory setUri(URI uri)
352352
throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException {
353353
if ("amqp".equals(uri.getScheme().toLowerCase())) {
354-
// nothing special to do
354+
setPort(DEFAULT_AMQP_PORT);
355355
} else if ("amqps".equals(uri.getScheme().toLowerCase())) {
356356
setPort(DEFAULT_AMQP_OVER_SSL_PORT);
357357
// SSL context factory not set yet, we use the default one
@@ -1886,6 +1886,7 @@ public ConnectionFactory setTrafficListener(TrafficListener trafficListener) {
18861886
*
18871887
* @return the connection factory
18881888
* @see #netty()
1889+
* @since 5.27.0
18891890
*/
18901891
public ConnectionFactory useNetty() {
18911892
this.netty = true;

0 commit comments

Comments
 (0)