mirror of
https://github.com/valitydev/wb-list-manager.git
synced 2024-11-06 09:45:18 +00:00
modify riak start
This commit is contained in:
parent
af2b7c3c7e
commit
a474d130a6
@ -22,10 +22,8 @@ public class RiakConfig {
|
|||||||
.withRemoteAddress(riakAddress)
|
.withRemoteAddress(riakAddress)
|
||||||
.withRemotePort(riakPort)
|
.withRemotePort(riakPort)
|
||||||
.build();
|
.build();
|
||||||
RiakCluster cluster = new RiakCluster.Builder(node)
|
return new RiakCluster.Builder(node)
|
||||||
.build();
|
.build();
|
||||||
cluster.start();
|
|
||||||
return cluster;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.rbkmoney.wb.list.manager.config;
|
||||||
|
|
||||||
|
import com.basho.riak.client.core.RiakCluster;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class RiakInitializer {
|
||||||
|
|
||||||
|
private final RiakCluster riakCluster;
|
||||||
|
|
||||||
|
@EventListener(value = ApplicationReadyEvent.class)
|
||||||
|
@Order
|
||||||
|
public void onStartup() {
|
||||||
|
log.info("Starting RiakCluster");
|
||||||
|
riakCluster.start();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user