You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Roronoa-Zoro (via GitHub)" <gi...@apache.org> on 2025/07/10 03:41:27 UTC

[D] customized ServiceInstanceCustomizer in dubbo 2.7.15 is not invoked [dubbo]

GitHub user Roronoa-Zoro created a discussion: customized ServiceInstanceCustomizer in dubbo 2.7.15 is not invoked

### Pre-check

- [X] I am sure that all the content I provide is in English.


### Apache Dubbo Component

Java SDK (apache/dubbo)

### Details

dubbo 2.7.15
jdk 8
I want to add a parameter when service is exported, and I have this class.
```java
@Activate(group = CommonConstants.PROVIDER)
public class ParamServiceInstanceCustomizer implements ServiceInstanceCustomizer {
    static {
        System.err.println("ParamServiceInstanceCustomizer loaded====================");
    }

    @Override
    public void customize(ServiceInstance serviceInstance) {
        serviceInstance.getMetadata().put("dubbo.hello", "value22");
    }
}
```
and I try to put it under META-INF/dubbo/org.apache.dubbo.registry.client.ServiceInstanceCustomizer or META-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceInstanceCustomizer
and content is “param=com.example.demo.dubbo.ParamServiceInstanceCustomizer”

but this ParamServiceInstanceCustomizer  is not invoked when server starts up, even if the dubbo internal class: ServiceInstanceMetadataCustomizer is also not invoked,

can anyone help ? Thanks

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)


GitHub link: https://github.com/apache/dubbo/discussions/15533

----
This is an automatically sent email for notifications@dubbo.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@dubbo.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [D] customized ServiceInstanceCustomizer in dubbo 2.7.15 is not invoked [dubbo]

Posted by "Roronoa-Zoro (via GitHub)" <gi...@apache.org>.
GitHub user Roronoa-Zoro added a comment to the discussion: customized ServiceInstanceCustomizer in dubbo 2.7.15 is not invoked

I also test with this code, result is empty
```java
List<ServiceInstanceCustomizer> customizers = ExtensionLoader.getExtensionLoader(ServiceInstanceCustomizer.class).getLoadedExtensionInstances();
```

GitHub link: https://github.com/apache/dubbo/discussions/15533#discussioncomment-13715665

----
This is an automatically sent email for notifications@dubbo.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@dubbo.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [D] customized ServiceInstanceCustomizer in dubbo 2.7.15 is not invoked [dubbo]

Posted by "Roronoa-Zoro (via GitHub)" <gi...@apache.org>.
GitHub user Roronoa-Zoro edited a discussion: customized ServiceInstanceCustomizer in dubbo 2.7.15 is not invoked

### Pre-check

- [X] I am sure that all the content I provide is in English.


### Apache Dubbo Component

Java SDK (apache/dubbo)

### Details

dubbo 2.7.15
jdk 8
I want to add a parameter/metadata when service is exported, and I have this class.
![image](https://github.com/user-attachments/assets/9dfac200-7230-4a9b-8f5d-1b9c5a19bc10)

```java
@Activate(group = CommonConstants.PROVIDER)
public class ParamServiceInstanceCustomizer implements ServiceInstanceCustomizer {
    static {
        System.err.println("ParamServiceInstanceCustomizer loaded====================");
    }

    @Override
    public void customize(ServiceInstance serviceInstance) {
        serviceInstance.getMetadata().put("dubbo.hello", "value22");
    }
}
```
and I try to put it under META-INF/dubbo/org.apache.dubbo.registry.client.ServiceInstanceCustomizer or META-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceInstanceCustomizer
and content is “param=com.example.demo.dubbo.ParamServiceInstanceCustomizer”

but this ParamServiceInstanceCustomizer  is not invoked when server starts up, even if the dubbo internal class: ServiceInstanceMetadataCustomizer is also not invoked,

can anyone help ? Thanks

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)


GitHub link: https://github.com/apache/dubbo/discussions/15533

----
This is an automatically sent email for notifications@dubbo.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@dubbo.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org