private void overrideConfigFromSsmParameters()

in src/main/java/com/amazonaws/fixengineonaws/FixEngineConfig.java [312:337]


    private void overrideConfigFromSsmParameters() {
    	LOGGER.info("FIXENGINECONFIG ****OVERRIDE CONFIG FROM SSM PARAMETERS starting");
    	Map.Entry<String, String> sessionProperty = findSessionSetting("<", false, sessionSettings);
    	while(sessionProperty != null) {
    		String propertyVal = (String)sessionProperty.getValue();
	    	Matcher m = Pattern.compile("<(.+?)>").matcher(propertyVal);
	    	while (m.find()) {
	    		String token = m.group();
	    		String ssmParameterName = token.replace("<", "").replace(">", "");
	    		LOGGER.info("FIXENGINECONFIG OVERRIDE CONFIG FROM SSM PARAMETERS in [" + propertyVal + "] getting ready to replace [" + token + "]");
	        	String ssmParamVal = getSsmParameter(ssmParameterName);
	        	String newValue = propertyVal.replace(token,ssmParamVal);
	        	LOGGER.info("FIXENGINECONFIG OVERRIDE CONFIG FROM SSM PARAMETERS in [" + propertyVal + "] replaced [" + token + "] with [" + ssmParamVal + "] to get [" + newValue + "]");
	        	propertyVal = newValue;
	        	sessionProperty.setValue(newValue);            		
	    	}
	    	sessionProperty = findSessionSetting("<", false, sessionSettings);
	    }
    	
        // This is a wourkaround for a bug in sessionSettings where simply setting properties in the "session" section 
        // gets reflected in the underlying Hashtables and toString() but not in the date it exposes to the Fix SocketAcceptor/SocketInitiator constructor
        // resulting in token strings like "<TargetCompID>" being used by the resulting FIX engine instead of the overridden values
        sessionSettings = cloneSessionSettings(sessionSettings);
        
//        LOGGER.info("FIXENGINECONFIG INITIALIZE PARAMETERS: rewrote new SessionSettings after overriding: " + sessionSettings);
    }