Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ public ServiceConfig<T> build(Consumer<ServiceConfig<T>> configConsumer){
serviceConfig.setRef(this.ref);
serviceConfig.setGroup(applicationConfig.getName());
serviceConfig.setVersion("1.0.0");
serviceConfig.setFilter("-default");

serviceConfig.setExecutor(executor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.dubbo.rpc.Exporter;
import org.apache.dubbo.rpc.ExporterListener;
import org.apache.dubbo.rpc.Filter;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.RpcException;
import org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder;
import org.apache.dubbo.rpc.listener.ListenerExporterWrapper;
Expand Down Expand Up @@ -56,7 +57,13 @@ public abstract class AbstractRegistryCenterExporterListener implements Exporter
@Override
public void exported(Exporter<?> exporter) throws RpcException {
ListenerExporterWrapper listenerExporterWrapper = (ListenerExporterWrapper) exporter;
FilterChainBuilder.CallbackRegistrationInvoker callbackRegistrationInvoker = (FilterChainBuilder.CallbackRegistrationInvoker) listenerExporterWrapper.getInvoker();

Invoker invoker = listenerExporterWrapper.getInvoker();
if (!(invoker instanceof FilterChainBuilder.CallbackRegistrationInvoker)) {
exportedExporters.add(exporter);
return;
}
Comment on lines +62 to +65
Copy link
Member

Choose a reason for hiding this comment

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

What is this scene? Can you give me a note?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is for tesing.

FilterChainBuilder.CallbackRegistrationInvoker callbackRegistrationInvoker = (FilterChainBuilder.CallbackRegistrationInvoker) invoker;
if (callbackRegistrationInvoker == null ||
callbackRegistrationInvoker.getInterface() != getInterface()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private void afterExport() {
// 1. InjvmExporter
// 2. DubboExporter with service-discovery-registry protocol
// 3. DubboExporter with registry protocol
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 5);
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 7);
// The exported exporter contains MultipleRegistryCenterExportProviderFilter
Assertions.assertTrue(exporterListener.getFilters().contains(filter));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private void afterExport() {
// The MultipleRegistryCenterInjvmService is exported
Assertions.assertTrue(serviceListener.getExportedServices().get(0).isExported());
// The exported exporter is only one
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 1);
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 3);
// The exported exporter contains MultipleRegistryCenterInjvmFilter
Assertions.assertTrue(exporterListener.getFilters().contains(filter));
}
Expand Down Expand Up @@ -189,4 +189,4 @@ public void tearDown() throws IOException {
serviceListener = null;
logger.info(getClass().getSimpleName() + " testcase is ending...");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private void afterExport() {
// 1. InjvmExporter
// 2. DubboExporter with service-discovery-registry protocol
// 3. DubboExporter with registry protocol
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 3);
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 5);
// The exported exporter contains SingleRegistryCenterExportProviderFilter
Assertions.assertTrue(exporterListener.getFilters().contains(filter));
// The consumer can be notified and get provider's metadata through metadata mapping info.
Expand Down Expand Up @@ -244,4 +244,4 @@ public void tearDown() throws IOException {
logger.info(getClass().getSimpleName() + " testcase is ending...");
registryProtocolListener = null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private void afterExport() {
// The SingleRegistryCenterInjvmService is exported
Assertions.assertTrue(serviceListener.getExportedServices().get(0).isExported());
// The exported exporter is only one
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 1);
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 3);
// The exported exporter contains SingleRegistryCenterInjvmFilter
Assertions.assertTrue(exporterListener.getFilters().contains(filter));
}
Expand Down Expand Up @@ -188,4 +188,4 @@ public void tearDown() throws IOException {
serviceListener = null;
logger.info(getClass().getSimpleName() + " testcase is ending...");
}
}
}