Search in sources :

Example 1 with IncrementIdGenerator

use of com.paascloud.core.generator.IncrementIdGenerator in project paascloud-master by paascloud.

the class RegistryCenterFactory method startup.

/**
 * Startup.
 *
 * @param paascloudProperties the paascloud properties
 * @param host                the host
 * @param app                 the app
 */
public static void startup(PaascloudProperties paascloudProperties, String host, String app) {
    CoordinatorRegistryCenter coordinatorRegistryCenter = createCoordinatorRegistryCenter(paascloudProperties.getZk());
    RegisterDto dto = new RegisterDto(app, host, coordinatorRegistryCenter);
    Long serviceId = new IncrementIdGenerator(dto).nextId();
    IncrementIdGenerator.setServiceId(serviceId);
    registerMq(paascloudProperties, host, app);
}
Also used : RegisterDto(com.paascloud.core.registry.base.RegisterDto) IncrementIdGenerator(com.paascloud.core.generator.IncrementIdGenerator) CoordinatorRegistryCenter(com.paascloud.core.registry.base.CoordinatorRegistryCenter)

Aggregations

IncrementIdGenerator (com.paascloud.core.generator.IncrementIdGenerator)1 CoordinatorRegistryCenter (com.paascloud.core.registry.base.CoordinatorRegistryCenter)1 RegisterDto (com.paascloud.core.registry.base.RegisterDto)1