Skip to content

Commit

Permalink
Configure streams' basePath
Browse files Browse the repository at this point in the history
Use lighty.io's restconfServletContextPath as basePath
for NETCONF streams configuration.

JIRA: LIGHTY-290
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
  • Loading branch information
ihrasko committed May 6, 2024
1 parent dc145c0 commit dcfd979
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 @@ -95,7 +95,8 @@ public CommunityRestConf(final DOMDataBroker domDataBroker,
@Override
protected boolean initProcedure() {
final Stopwatch stopwatch = Stopwatch.createStarted();
final StreamsConfiguration streamsConfiguration = RestConfConfigUtils.getStreamsConfiguration();
final StreamsConfiguration streamsConfiguration = RestConfConfigUtils
.getStreamsConfiguration(restconfServletContextPath);

LOG.info("Starting RestconfApplication with configuration {}", streamsConfiguration);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ public static RestConfConfiguration getDefaultRestConfConfiguration() {
return new RestConfConfiguration();
}

public static StreamsConfiguration getStreamsConfiguration() {
return new StreamsConfiguration(MAXIMUM_FRAGMENT_LENGTH, IDLE_TIMEOUT, HEARTBEAT_INTERVAL, USE_SSE);
public static StreamsConfiguration getStreamsConfiguration(final String restconfServletContextPath) {
// we use, for example "/rests" as restconfServletContextPath but NETCONF expects just "rests" as basePath
final var basePath = restconfServletContextPath.substring(1);
return new StreamsConfiguration(MAXIMUM_FRAGMENT_LENGTH, IDLE_TIMEOUT, HEARTBEAT_INTERVAL, USE_SSE, basePath);
}
}

0 comments on commit dcfd979

Please sign in to comment.