i have properties like this
connection.local=0.0.0.0 i write it on application.properties and at application-local.properties it is correct or not ?
but when i want to get this value with annotation
i use plain java for build apps. and use spring context for get value and annotations
@Component
@Scope("singleton")
@Slf4j
@Configuration
public class SocketEngine extends Thread {
/**
* This is to make sure that the server is running and trying even when
* idxdatafeed disconnects
*/
@Value("${connection.local}")
private String connectionLocalhost;
public void run() {
while (true) {
Socket server = null;
String firstData="xvabv";
try {
log.info("Connecting to server " + connectionLocalhost+"!");
server = new Socket(connectionLocalhost, 9010);
server.setSoTimeout(10000);
PrintWriter writer= new PrintWriter(server.getOutputStream());
i got value of connectionLocal is null why like that ?