Skip to content

Commit

Permalink
Use DefaultRoutingService on missing bean
Browse files Browse the repository at this point in the history
  • Loading branch information
solita-sabinaf committed Dec 11, 2024
1 parent d5d4534 commit 7bd7820
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

import java.math.BigDecimal;
import java.util.ArrayList;
import org.springframework.context.annotation.Profile;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Component;

/**
* Fallback implementation in case routing profile not specified
*/
@Component
@Profile("!routing")
@ConditionalOnMissingBean(
value = RoutingService.class,
ignored = DefaultRoutingService.class
)
public class DefaultRoutingService implements RoutingService {

public RouteGeometry getRouteGeometry(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.context.annotation.Profile;

@Configuration
@Profile("routing")
@Profile("osrm-routing-service")
public class OsrmConfiguration {

@Bean
Expand Down

0 comments on commit 7bd7820

Please sign in to comment.