added more configurations

This commit is contained in:
Christopher Moyer 2023-01-02 21:32:32 -05:00
parent 9df4f9edf4
commit d4583748ca
3 changed files with 4 additions and 1 deletions

View file

@ -60,7 +60,8 @@ public class CamelConfiguration extends RouteBuilder {
.filter(exchange -> exchange.getIn().getBody(JsoCall.class).getPoint() != null) .filter(exchange -> exchange.getIn().getBody(JsoCall.class).getPoint() != null)
.process(exchange -> { .process(exchange -> {
JsoCall jsoCall = exchange.getIn().getBody(JsoCall.class); JsoCall jsoCall = exchange.getIn().getBody(JsoCall.class);
if (Point2D.distance(jsoCall.getPoint().getLat(), appProperties.myLat(), jsoCall.getPoint().getLng(), appProperties.myLong()) >= 2.0) { if (Point2D.distance(jsoCall.getPoint().getLat(), appProperties.myLat(), jsoCall.getPoint().getLng(), appProperties.myLong())
>= appProperties.telegramNotificationThreshold()) {
exchange.setRouteStop(true); exchange.setRouteStop(true);
} }
}) })

View file

@ -11,4 +11,5 @@ public interface AppProperties {
String googleApiKey(); String googleApiKey();
double myLat(); double myLat();
double myLong(); double myLong();
double telegramNotificationThreshold();
} }

View file

@ -4,6 +4,7 @@ app.google-api-key=${GOOGLE_API_KEY}
app.my-lat=30.3025061 app.my-lat=30.3025061
app.my-long=-81.6436614 app.my-long=-81.6436614
app.telegram-notification-threshold=2.0
RABBITMQ_IP=192.168.1.117 RABBITMQ_IP=192.168.1.117
POSTGRES_IP=192.168.1.17 POSTGRES_IP=192.168.1.17