Refactor to clense task name

When using Spring Boot, the id of the application context can be a colon
delimited string of values.  By default, Spring Cloud Task uses this
value as the task name.  However, when using JMX, this can cause issues.
This commit updates the SimpleTaskNameResolver to clense the colons and
replace them with underscores.

Resolves #280
This commit is contained in:
Michael Minella
2017-03-29 15:55:00 -05:00
committed by Glenn Renfro
parent fec40fd3f8
commit ac41b8c26d
2 changed files with 15 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ public class SimpleTaskNameResolver implements TaskNameResolver, ApplicationCont
return configuredName;
}
else {
return context.getId();
return context.getId().replace(":", "_");
}
}
}