wangeDear commented on issue #14229:
URL: https://github.com/apache/dubbo/issues/14229#issuecomment-2126398303
Using the dubbo spring boot demo of the official github, I updated the yml
configuration file as follows. After startup, the service is not registered
with nacos.
```
spring:
application:
name: dubbo-springboot-demo-provider
dubbo:
application:
name: ${spring.application.name}
protocol:
name: dubbo
port: -1
registry:
id: nacos-registry
address: nacos://10.133.128.64:8848?namespace=svtf_test
config-center:
address: nacos://10.133.128.64:8848?namespace=svtf_test
metadata-report:
address: nacos://10.133.128.64:8848?namespace=svtf_test
metrics:
protocol: prometheus
enable-jvm: true
enable-registry: true
aggregation:
enabled: true
prometheus:
exporter:
enabled: true
enable-metadata: true
services:
demoService:
interface: org.apache.dubbo.springboot.demo.DemoService
ref: demoServiceImpl
logging:
pattern:
level: '%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]'
```
DemoServiceImpl:
```
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.springboot.demo.provider;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;
import org.apache.dubbo.springboot.demo.DemoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
//@DubboService
@Service
public class DemoServiceImpl implements DemoService {
private static final Logger logger =
LoggerFactory.getLogger(DemoServiceImpl.class);
@Override
public String sayHello(String name) {
logger.info("Hello " + name + ", request from consumer: "
+ RpcContext.getContext().getRemoteAddress());
return "Hello " + name;
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]