@NotEmpty
private String httpServerPath;
+ @Valid
+ private String serviceIp;
+
@Valid
@NotNull
private DataSourceFactory database = new DataSourceFactory();
public void setHttpServerPath(String httpServerPath) {
this.httpServerPath = httpServerPath;
}
+
+ @JsonProperty
+ public String getServiceIp() {
+ return serviceIp;
+ }
+
+ @JsonProperty
+ public void setServiceIp(String serviceIp) {
+ this.serviceIp = serviceIp;
+ }
}
*/
package org.openo.commontosca.catalog.common;
+import org.openo.commontosca.catalog.common.Config;
import org.openo.commontosca.catalog.externalservice.msb.MicroserviceBusConsumer;
import org.openo.commontosca.catalog.externalservice.msb.ServiceRegisterEntity;
import org.slf4j.Logger;
catalogEntity.setProtocol("REST");
catalogEntity.setVersion("v1");
catalogEntity.setUrl("/openoapi/catalog/v1");
- catalogEntity.setSingleNode(null, "8200", 0);
+ catalogEntity.setSingleNode(Config.getConfigration().getServiceIp(), "8200", 0);
catalogEntity.setVisualRange("1");
serviceEntityList.add(catalogEntity);
ServiceRegisterEntity httpServiceEntity = new ServiceRegisterEntity();
httpServiceEntity.setProtocol("REST");
httpServiceEntity.setVersion("v1");
httpServiceEntity.setUrl("/");
- httpServiceEntity.setSingleNode(null, "8201", 0);
+ httpServiceEntity.setSingleNode(Config.getConfigration().getServiceIp(), "8201", 0);
httpServiceEntity.setVisualRange("1");
serviceEntityList.add(httpServiceEntity);
}
import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
import org.glassfish.jersey.client.ClientConfig;
+import org.openo.commontosca.catalog.db.util.CatalogDbUtil;
import org.openo.commontosca.catalog.common.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
public static boolean registerService(ServiceRegisterEntity entity) {
ClientConfig config = new ClientConfig();
+ LOG.info("microservice register body:" + CatalogDbUtil.objectToString(entity));
try {
MicroserviceBusRest resourceserviceproxy =
ConsumerFactory.createConsumer(Config.getConfigration().getMsbServerAddr(), config,