Skip to content

Commit

Permalink
Merge pull request #1227 from microsoft/fix-spring-boot-starter-with-…
Browse files Browse the repository at this point in the history
…lazy-init

Fix Spring Boot Starter failing with lazy init
  • Loading branch information
trask authored Apr 13, 2020
2 parents eef3517 + d9fd986 commit d989207
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public TelemetryConfiguration telemetryConfiguration() {
if (telemetryProcessors != null) {
telemetryConfiguration.getTelemetryProcessors().addAll(telemetryProcessors);
}
initializeTelemetryChannel(telemetryConfiguration);
initializeComponents(telemetryConfiguration);
initializePerformanceCounterContainer();
return telemetryConfiguration;
Expand All @@ -173,9 +174,7 @@ public TelemetryClient telemetryClient(TelemetryConfiguration configuration) {



@Bean
@ConditionalOnMissingBean
public TelemetryChannel telemetryChannel(TelemetryConfiguration configuration) {
private void initializeTelemetryChannel(TelemetryConfiguration configuration) {
InProcess inProcess = applicationInsightsProperties.getChannel().getInProcess();
final InProcessTelemetryChannel channel;
if (StringUtils.isNotEmpty(inProcess.getEndpointAddress())) {
Expand All @@ -189,7 +188,6 @@ public TelemetryChannel telemetryChannel(TelemetryConfiguration configuration) {
}

configuration.setChannel(channel);
return channel;
}

@Bean
Expand Down

0 comments on commit d989207

Please sign in to comment.