Skip to content

Add remote service ranking#839

Open
xuzhenbao wants to merge 8 commits intoapache:masterfrom
xuzhenbao:add_remote_service_ranking
Open

Add remote service ranking#839
xuzhenbao wants to merge 8 commits intoapache:masterfrom
xuzhenbao:add_remote_service_ranking

Conversation

@xuzhenbao
Copy link
Copy Markdown
Contributor

@xuzhenbao xuzhenbao commented Mar 17, 2026

The PR is used to resolve the issue #776. However, there are some adjustments to the implementation.

I have defined a configuration property CELIX_RSA_IMPORTED_SERVICE_RANKING_OFFSETS. This property is used to specify the offset values for the imported service ranking. The value of this property is a comma-separated list of <config type>=<ranking offset>. It allows user to configure the ranking of imported services based on the configuration type of service. For example, if the user wants to set a higher ranking for imported services with the configuration type "celix.remote.admin.shm" than the imported services with the configuration type "celix.remote.admin.http", and the imported services rankings are lower than the local services(The default ranking of local service is 0.), you can set the property as follows:"celix.remote.admin.shm=-1,celix.remote.admin.http=-2".

@PengZheng PengZheng requested a review from pnoltes March 18, 2026 06:52
@xuzhenbao
Copy link
Copy Markdown
Contributor Author

In the current implementation, if the same service is imported by multiple Remote Service Admins (RSA), I will remove the imported service with the lower ranking. Is this redundant? Because the ranking is a property of the service, and the service consumer can get the service with the higher ranking as needed.
I think I should remove this part of the logic.

@xuzhenbao
Copy link
Copy Markdown
Contributor Author

In the current implementation, if the same service is imported by multiple Remote Service Admins (RSA), I will remove the imported service with the lower ranking. Is this redundant? Because the ranking is a property of the service, and the service consumer can get the service with the higher ranking as needed. I think I should remove this part of the logic.

I have revised the code implementation, retaining all the imported services. And the service ranking of imported services is set according to the configuration property CELIX_RSA_IMPORTED_SERVICE_RANKING_OFFSETS.

Copy link
Copy Markdown
Contributor

@pnoltes pnoltes left a comment

Choose a reason for hiding this comment

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

LGTM, just a small nitpick


//The prefix of the config property which is used to store the interfaces of a port. e.g. CELIX_RSA_INTERFACES_OF_PORT_8080. The value is a comma-separated list of interface names.
#define CELIX_RSA_INTERFACES_OF_PORT_PREFIX "CELIX_RSA_INTERFACES_OF_PORT_"
//The config property for the ranking offset of imported services. The value is a comma-separated list of <config type>=<ranking offset>. e.g. CELIX_RSA_IMPORTED_SERVICE_RANKING_OFFSETS="celix.remote.admin.shm=-1,org.amdatu.remote.admin.http=-2". The ranking offset will be added to the original service ranking of the imported service. This allows the user to configure the ranking of imported services based on different configuration types.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nitpick: split up the comment over multiple lines (ColumnLimit in .clang-format is 120).

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