Skip to content

17 feat abstractroutingdatasource implementation for multitenancy#39

Merged
kaushalaroraharman merged 3 commits intoeclipse-ecsp:17-feat-abstractroutingdatasource-implementation-for-multitenancyfrom
ihussainbadshah:17-feat-abstractroutingdatasource-implementation-for-multitenancy
Dec 18, 2025
Merged

17 feat abstractroutingdatasource implementation for multitenancy#39
kaushalaroraharman merged 3 commits intoeclipse-ecsp:17-feat-abstractroutingdatasource-implementation-for-multitenancyfrom
ihussainbadshah:17-feat-abstractroutingdatasource-implementation-for-multitenancy

Conversation

@ihussainbadshah
Copy link
Contributor

Please refer to our contributing docs for any questions on submitting a pull request.
Issues are required for both bug fixes and features.

Resolves #17


Describe behaviour before the change

Resolves the review comments

Describe behaviour after the change

Resolves the review comments

Pull request checklist

  • I have read the CONTRIBUTING.md
  • My code follows the code style of this project
  • Tests for the changes have been added (for bug fixes / features)
  • All new and existing tests passed.
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

  • Yes
  • No

/** Configurations for default tenant. */
@Autowired(required = false)
private DatabaseProperties defaultDbProperties;
@Qualifier("tenants")
Copy link
Contributor

@kaushalaroraharman kaushalaroraharman Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change name to tenantConfigMap

// Initialize TenantContext with multitenancy flag
TenantContext.initialize(isMultitenancyEnabled);

if (!isMultitenancyEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep these removed changes for multitenancy check

*/
@Bean("credentialsProvider")
public Map<String, CredentialsProvider> getCredentialsProvider() {
if (!isMultitenancyEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep this check for multitenancy. Read default tenant properties from tenantConfig.get(defaultTenatID)

@Scheduled(fixedDelayString = "${" + PostgresDbConstants.POSTGRES_REFRESH_CHECK_INTERVAL
+ ":86400000}")
public void postgresCredsRefreshJob() throws SQLException, InterruptedException {
Map<String, TenantDatabaseProperties> tenants = multiTenantDbProperties.getTenants();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add check for multitenancy enabler similar to as in above methods.

*/
@Bean
@ConfigurationProperties(prefix = "tenant")
public Map<String, TenantDatabaseProperties> tenants() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be renamed to tenantConfigMap

@PostConstruct
public void init() {
healthCheckList = new ArrayList<>();
if (!isMultitenancyEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check needs to remain there

@kaushalaroraharman kaushalaroraharman merged commit c20716a into eclipse-ecsp:17-feat-abstractroutingdatasource-implementation-for-multitenancy Dec 18, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants