MongoDB Connection pool issue

Below is the code snippet and we are using spring boot2.5 and mongodb driver 4.2.3

org.mongodb
bson
4.2.3


org.mongodb
mongodb-driver-core
4.2.3


org.mongodb
mongodb-driver-legacy
4.2.3


org.mongodb
mongodb-driver-reactivestreams
4.2.3


org.mongodb
mongodb-driver-sync
4.2.3

@Bean
public MongoDatabaseFactory mongoDbFactory() throws NoSuchAlgorithmException {
	SSLContext sslContext = SSLContext.getDefault();
	int port = Integer.parseInt(mongoDbPort);

	log.info("~~~~~~~~~~~~~~~~~~~~~~~~~mongoDbFactory()====>");
	TestConnectionPoolListener connectionPoolListener = new TestConnectionPoolListener();

	MongoClientSettings settings = MongoClientSettings.builder() // .applyToSocketSettings(builder ->
																	// builder.applySettings(socketSettings))
			.applyToClusterSettings(
					builder -> builder.hosts(Arrays.asList(new ServerAddress(maasReplicaSetHost1, port),
							new ServerAddress(maasReplicaSetHost2, port),
							new ServerAddress(maasReplicaSetHost3, port))))
			
			.credential(MongoCredential.createCredential(mongoDbuserNm, mongoDbAuthDb, mongoDbPassword.toCharArray()))
			.retryReads(true).retryWrites(true)

			.applyToSslSettings(builder -> {
				builder.enabled(true);
				builder.context(sslContext);
			})

			.applyToConnectionPoolSettings(connPoolBuilder -> ConnectionPoolSettings.builder() 
					// .maxWaitTime(5, TimeUnit.MILLISECONDS)
					.minSize(30)
					.maxSize(50) 
					.maxConnectionIdleTime(0, TimeUnit.SECONDS)
					.maxConnectionLifeTime(0, TimeUnit.SECONDS)
					// .maxWaitTime(60, TimeUnit.SECONDS)
					//.addConnectionPoolListener(connectionPoolListener).build()
					.addConnectionPoolListener(new JMXConnectionPoolListener()).build()
					)

			.build();

	MongoClient mongoClient = MongoClients.create(settings);
	return new SimpleMongoClientDatabaseFactory(mongoClient, dataPipelineDB);
}

@Bean
public MongoTemplate mongoTemplate() throws NoSuchAlgorithmException {
	MongoTemplate mongoTemplate = new MongoTemplate(mongoDbFactory());
	return mongoTemplate;
}

@Bean
MongoTransactionManager transactionManager(MongoDatabaseFactory mongoDbFactory) {
	return new MongoTransactionManager(mongoDbFactory);
}

The problem we are facing is the connectionpool is not being created. from the logs it is observed that when ever the application is hit for the first time for db operation at that time the connection is being opened. this is impacting the performance.

why connectionpool is not being created here? can someone please help?