Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #78 from patientsknowbest/feature/improve_test_con…
Browse files Browse the repository at this point in the history
…trol_registration

Trigger registration ASAP.
  • Loading branch information
utamas committed Dec 2, 2021
2 parents df0ae00 + d74755b commit f489b5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<version.guava>30.1.1-jre</version.guava>
<version.apache-commons-io>2.6</version.apache-commons-io>
<javax.javaee-api.version>8.0</javax.javaee-api.version>
<avro.version>1.10.2</avro.version>
<avro.version>1.11.0</avro.version>
<commons.compress.version>1.21</commons.compress.version>
<camel.version>3.12.0</camel.version>
<logback.version>1.2.3</logback.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ public void configure() throws Exception {
getContext().getGlobalOptions().put("CamelJacksonEnableTypeConverter", "true");
getContext().getGlobalOptions().put("CamelJacksonTypeConverterToPojo", "true");
var selfUrl = new URL(config().getApplicationTestControlCallbackURL());
var testControlUrl = new URL(config().getTestControlUrl());


restConfiguration().host("0.0.0.0").port(selfUrl.getPort()).component("netty-http").bindingMode(RestBindingMode.json);

if (config().getEnableTestControlRegistration()) {
var testControlUrl = new URL(config().getTestControlUrl());

// Maybe replace this with a proper service discovery system later.
from("timer:startup?repeatCount=1")
// https://camel.apache.org/components/3.12.x/timer-component.html#_firing_as_soon_as_possible
// https://camel.apache.org/components/3.12.x/timer-component.html#_endpoint_query_option_synchronous
from("timer:startup?delay=-1&repeatCount=1&synchronous=true")
.routeId("startupMessage")
.routeProperty(ROUTE_PROPERTY_IS_TEST_CONTROL, Boolean.TRUE.toString())
.setBody(constant(ImmutableStartup.builder()
Expand Down

0 comments on commit f489b5f

Please sign in to comment.