注释 nsq

This commit is contained in:
GYJ 2025-01-09 17:17:36 +08:00
parent b58d3a7cf0
commit db504fb664
1 changed files with 14 additions and 14 deletions

View File

@ -12,18 +12,18 @@ import javax.annotation.PostConstruct;
@Service @Service
@Slf4j @Slf4j
public class NsqConfig { public class NsqConfig {
/** // /**
* 端口号 // * 端口号
*/ // */
@Value("${nsq.port}") // @Value("${nsq.port}")
private int port; // private int port;
//
@Value("${nsq.address}") // @Value("${nsq.address}")
private String address; // private String address;
//
@PostConstruct // @PostConstruct
public void startNSQChannel() { // public void startNSQChannel() {
new NSQConsumers(address, port, "test", "ch1", new Print2MessageHandlerAdapter()); // new NSQConsumers(address, port, "test", "ch1", new Print2MessageHandlerAdapter());
new NSQConsumers(address, port, "test", "ch2", new PrintMessageHandlerAdapter()); // new NSQConsumers(address, port, "test", "ch2", new PrintMessageHandlerAdapter());
} // }
} }