Skip to content

Commit c67de49

Browse files
committed
Merge branch '7.11' of github.com:gchq/stroom
2 parents 0142e8d + 96e92bc commit c67de49

13 files changed

Lines changed: 97 additions & 232 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ DO NOT ADD CHANGES HERE - ADD THEM USING log_change.sh
1313
~~~
1414

1515

16+
## [v7.11.0] - 2026-03-04
17+
18+
* Bug : Change proxy event store to close its appenders on app shutdown.
19+
20+
* Bug : Fix missing docker managed volues for proxy `zip_file_ingest` and `zip_file_ingest_failed` directories.
21+
22+
* Bug : Fix NPE in downstreamHostConfig ctor if there is no hostname, which is a possibility.
23+
24+
* Bug : Fix incorrect path for /datafeed in the ProxyWelcomeServlet response.
25+
26+
* Bug : Move the `/queues` proxy endpoint from the app port to the admin port.
27+
28+
* Bug **#5424** : Change the `receiptCheckMode` `RECEIVE_ALL` to no longer check for the existence of the feed. Add the `receiptCheckMode` `FEED_EXISTENCE` to perform a feed existence check.
29+
30+
* Bug : Fix `subPathTemplate.enabled` defaulting to `false` if subPathTemplate has been set in the yaml, but enabled has not.
31+
32+
* Bug : Fix bug in proxy which will throw an error if subPathTemplate contains repeated vars, e.g. `${year}/${year}-${month}`.
33+
34+
1635
## [v7.11-beta.25] - 2026-02-13
1736

1837
* Bug **#5392** : Fix PlanB segfault.
@@ -2014,7 +2033,8 @@ DO NOT ADD CHANGES HERE - ADD THEM USING log_change.sh
20142033
* Issue **#3830** : Add S3 data storage option.
20152034

20162035

2017-
[Unreleased]: https://github.com/gchq/stroom/compare/v7.11-beta.25...HEAD
2036+
[Unreleased]: https://github.com/gchq/stroom/compare/v7.11.0...HEAD
2037+
[v7.11.0]: https://github.com/gchq/stroom/compare/v7.11-beta.25...v7.11.0
20182038
[v7.11-beta.25]: https://github.com/gchq/stroom/compare/v7.11-beta.24...v7.11-beta.25
20192039
[v7.11-beta.24]: https://github.com/gchq/stroom/compare/v7.11-beta.23...v7.11-beta.24
20202040
[v7.11-beta.23]: https://github.com/gchq/stroom/compare/v7.11-beta.22...v7.11-beta.23

stroom-core-shared/src/main/java/stroom/receive/rules/shared/ReceiptCheckMode.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,34 @@ public enum ReceiptCheckMode {
2727
/**
2828
* The feed status (RECEIVE|DROP|REJECT) for the feed of the received data will be checked by calling
2929
* the downstream stroom/proxy.
30+
* If auto content creation is enabled on stroom, then when the check is performed,
31+
* the feed will be auto-created (if various conditions for that are met) and the data will then
32+
* be accpeted.
3033
*/
3134
FEED_STATUS(true),
3235
/**
3336
* The meta attributes from the headers will be checked against the receipt policy rules to determine
3437
* whether the data should be accepted for receipt, rejected or silently dropped. ALL downstream
3538
* stroom-proxy instances in the chain must also use this mode if this mode is set.
39+
* <p>
40+
* This mode will also check if the feed exists. If the feed does not exist the data will be rejected.
41+
* If auto content creation is enabled on stroom, then when the check is performed,
42+
* the feed will be auto-created (if various conditions for that are met) and this
43+
* filter will then return true.
3644
*/
3745
RECEIPT_POLICY(true),
3846
/**
39-
* No check is performed. All data is accepted for receipt (subject to other checks
40-
* like presence of stream type).
47+
* This mode will check if the feed exists. If the feed does not exist the data will be rejected.
48+
* If it does exist it will be accepted regardless of the feed status.
49+
* <p>
50+
* If auto content creation is enabled on stroom, then when the check is performed,
51+
* the feed will be auto-created (if various conditions for that are met) and this
52+
* filter will then return true.
53+
*/
54+
FEED_EXISTENCE(true),
55+
/**
56+
* No feed or receipt policy checks are performed.
57+
* All data is accepted for receipt (subject to other checks like presence of stream type).
4158
*/
4259
RECEIVE_ALL(true),
4360
/**

stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/guice/ProxyModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ protected void configure() {
113113
ServletBinder.create(binder())
114114
.bind(DebugServlet.class)
115115
.bind(ProxyStatusServlet.class)
116-
.bind(ProxyQueueMonitoringServlet.class)
117116
.bind(ProxyWelcomeServlet.class)
118117
.bind(ReceiveDataServlet.class);
119118

120119
AdminServletBinder.create(binder())
120+
.bind(ProxyQueueMonitoringServlet.class)
121121
.bind(FilteredHealthCheckServlet.class);
122122

123123
RestResourcesBinder.create(binder())

stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/ForwardFileDestinationImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.util.Set;
4343
import java.util.concurrent.atomic.AtomicLong;
4444
import java.util.function.Function;
45+
import java.util.stream.Collectors;
4546

4647
public class ForwardFileDestinationImpl implements ForwardFileDestination {
4748

@@ -104,7 +105,10 @@ public ForwardFileDestinationImpl(final Path storeDir,
104105
final String[] vars = pathCreator.findVars(pathTemplate);
105106
if (NullSafe.hasItems(vars)) {
106107
staticBaseDir = null;
107-
varsInTemplate = Set.of(vars);
108+
// Do this rather than Set.of() because vars can be repeated in the arr
109+
// which caused Set.of() to throw.
110+
varsInTemplate = NullSafe.stream(vars)
111+
.collect(Collectors.toSet());
108112
} else {
109113
staticBaseDir = resolveSubPath(pathTemplate);
110114
FileUtil.ensureDirExists(staticBaseDir);

stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/PathTemplateConfig.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
@JsonPropertyOrder(alphabetic = true)
3636
public class PathTemplateConfig extends AbstractConfig implements IsProxyConfig {
3737

38+
public static final boolean DEFAULT_ENABLED_SATE = true;
3839
public static final TemplatingMode DEFAULT_TEMPLATING_MODE = TemplatingMode.REPLACE_UNKNOWN_PARAMS;
3940
public static final String DATE_AND_FEED_TEMPLATE = "${year}${month}${day}/${feed}";
4041
public static final PathTemplateConfig DEFAULT = new PathTemplateConfig(
@@ -50,18 +51,18 @@ public class PathTemplateConfig extends AbstractConfig implements IsProxyConfig
5051
private final TemplatingMode templatingMode;
5152

5253
public PathTemplateConfig(final String pathTemplate) {
53-
this(true, pathTemplate, DEFAULT_TEMPLATING_MODE);
54+
this(DEFAULT_ENABLED_SATE, pathTemplate, DEFAULT_TEMPLATING_MODE);
5455
}
5556

5657
public PathTemplateConfig(final String pathTemplate,
5758
final TemplatingMode templatingMode) {
58-
this(true, pathTemplate, templatingMode);
59+
this(DEFAULT_ENABLED_SATE, pathTemplate, templatingMode);
5960
}
6061

61-
public PathTemplateConfig(@JsonProperty("enabled") final boolean enabled,
62+
public PathTemplateConfig(@JsonProperty("enabled") final Boolean enabled,
6263
@JsonProperty("pathTemplate") final String pathTemplate,
6364
@JsonProperty("templatingMode") final TemplatingMode templatingMode) {
64-
this.enabled = enabled;
65+
this.enabled = Objects.requireNonNullElse(enabled, DEFAULT_ENABLED_SATE);
6566
this.templatingMode = Objects.requireNonNullElse(templatingMode, DEFAULT_TEMPLATING_MODE);
6667
this.pathTemplate = Objects.requireNonNullElse(pathTemplate, DATE_AND_FEED_TEMPLATE);
6768
}

stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/RemoteFeedStatusService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public GetFeedStatusResponse getFeedStatus(final GetFeedStatusRequestV2 request)
156156
private FeedStatus getDefaultFeedStatus() {
157157
final ReceiveDataConfig receiveDataConfig = receiveDataConfigProvider.get();
158158
return switch (receiveDataConfig.getReceiptCheckMode()) {
159-
case FEED_STATUS, RECEIPT_POLICY -> switch (receiveDataConfig.getFallbackReceiveAction()) {
159+
case FEED_STATUS, RECEIPT_POLICY, FEED_EXISTENCE -> switch (receiveDataConfig.getFallbackReceiveAction()) {
160160
case RECEIVE -> FeedStatus.Receive;
161161
case REJECT -> FeedStatus.Reject;
162162
case DROP -> FeedStatus.Drop;

stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/servlet/ProxyQueueMonitoringServlet.java

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
import stroom.proxy.repo.queue.QueueMonitors;
2020
import stroom.proxy.repo.store.FileStores;
21-
import stroom.util.shared.IsServlet;
22-
import stroom.util.shared.ResourcePaths;
21+
import stroom.util.shared.IsAdminServlet;
2322
import stroom.util.shared.Unauthenticated;
2423

2524
import jakarta.inject.Inject;
@@ -34,10 +33,9 @@
3433
import java.util.Set;
3534

3635
@Unauthenticated
37-
public class ProxyQueueMonitoringServlet extends HttpServlet implements IsServlet {
36+
public class ProxyQueueMonitoringServlet extends HttpServlet implements IsAdminServlet {
3837

39-
private static final Set<String> PATH_SPECS = Set.of(
40-
ResourcePaths.addLegacyUnauthenticatedServletPrefix("/queues"));
38+
private static final Set<String> PATH_SPECS = Set.of("/queues");
4139

4240
private final Provider<QueueMonitors> queueMonitorsProvider;
4341
private final Provider<FileStores> fileStoresProvider;
@@ -49,28 +47,27 @@ public ProxyQueueMonitoringServlet(final Provider<QueueMonitors> queueMonitorsPr
4947
this.fileStoresProvider = fileStoresProvider;
5048
}
5149

52-
5350
@Override
5451
protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
5552
throws ServletException, IOException {
5653
final QueueMonitors queueMonitors = queueMonitorsProvider.get();
5754
final Writer writer = response.getWriter();
5855
writer.write("<html>\n" +
59-
"<head>\n" +
60-
"<style>\n" +
61-
"body {\n" +
62-
"\tfont-family: arial, tahoma, verdana;\n" +
63-
"}\n" +
64-
"</style>\n" +
65-
"</head>\n" +
66-
"<body>\n");
56+
"<head>\n" +
57+
"<style>\n" +
58+
"body {\n" +
59+
"\tfont-family: arial, tahoma, verdana;\n" +
60+
"}\n" +
61+
"</style>\n" +
62+
"</head>\n" +
63+
"<body>\n");
6764
writer.write("<h1>Queues</h1>");
6865
writer.write(queueMonitors.log());
6966
writer.write("<h1>File Stores</h1>");
7067
writer.write(fileStoresProvider.get().log());
7168

7269
writer.write("</body>\n" +
73-
"</html>");
70+
"</html>");
7471
writer.close();
7572
}
7673

stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/servlet/ProxyWelcomeServlet.java

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package stroom.proxy.app.servlet;
1818

19+
import stroom.receive.common.ReceiveDataServlet;
1920
import stroom.util.date.DateUtil;
2021
import stroom.util.shared.BuildInfo;
2122
import stroom.util.shared.IsServlet;
@@ -53,34 +54,40 @@ protected void doGet(final HttpServletRequest request, final HttpServletResponse
5354
final BuildInfo buildInfo = buildInfoProvider.get();
5455
final Writer writer = response.getWriter();
5556
writer.write("<html>\n" +
56-
"<head>\n" +
57-
"<style>\n" +
58-
"body {\n" +
59-
"\tfont-family: arial, tahoma, verdana;\n" +
60-
"}\n" +
61-
"</style>\n" +
62-
"</head>\n" +
63-
"<body>\n" +
64-
"<h1>Stroom Proxy " +
65-
buildInfo.getBuildVersion() +
66-
" built on " +
67-
DateUtil.createNormalDateTimeString(buildInfo.getBuildTime()) +
68-
"</h1>\n" +
69-
"\n" +
70-
"<p>Send data to " +
71-
getURL(request) +
72-
"datafeed</p>\n" +
73-
"\n" +
74-
"</body>\n" +
75-
"</html>");
57+
"<head>\n" +
58+
"<style>\n" +
59+
"body {\n" +
60+
"\tfont-family: arial, tahoma, verdana;\n" +
61+
"}\n" +
62+
"</style>\n" +
63+
"</head>\n" +
64+
"<body>\n" +
65+
"<h1>Stroom Proxy " +
66+
buildInfo.getBuildVersion() +
67+
" built on " +
68+
DateUtil.createNormalDateTimeString(buildInfo.getBuildTime()) +
69+
"</h1>\n" +
70+
"\n" +
71+
"<p>Send data to " +
72+
getDataFeedURL(request) +
73+
"</p>\n" +
74+
"\n" +
75+
"</body>\n" +
76+
"</html>");
7677
writer.close();
7778
}
7879

79-
private String getURL(final HttpServletRequest request) {
80+
private String getDataFeedURL(final HttpServletRequest request) {
8081
String url = request.getRequestURL().toString();
82+
// First remove the /ui part
83+
url = url.replace(PATH_PART, "");
8184
if (!url.endsWith("/")) {
8285
url += "/";
8386
}
87+
// Add the /datafeed part
88+
url += ReceiveDataServlet.DATA_FEED_PATH_PART;
89+
// Remove any double slashes
90+
url = url.replaceAll("(?<!:)//", "/");
8491
return url;
8592
}
8693

stroom-receive/stroom-receive-common/src/main/java/stroom/receive/common/AttributeMapFilterFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ private List<AttributeMapFilter> getReceiptCheckFilters(final ReceiptCheckMode r
119119
case RECEIPT_POLICY -> List.of(
120120
dataReceiptPolicyAttrMapFilterFactoryProvider.get().create(),
121121
feedExistenceAttributeMapFilterProvider.get());
122+
case FEED_EXISTENCE -> List.of(feedExistenceAttributeMapFilterProvider.get());
122123
// Receiving everything
123-
case RECEIVE_ALL -> List.of(
124-
feedExistenceAttributeMapFilterProvider.get());
124+
case RECEIVE_ALL -> List.of(ReceiveAllAttributeMapFilter.getInstance());
125125
case REJECT_ALL -> List.of(RejectAllAttributeMapFilter.getInstance());
126126
case DROP_ALL -> List.of(DropAllAttributeMapFilter.getInstance());
127127
};

stroom-receive/stroom-receive-common/src/main/java/stroom/receive/common/FeedExistenceAttributeMapFilter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131

3232
/**
3333
* Checks whether the Feed in the {@link AttributeMap} exists or not.
34-
* If it does not exist then the filter will return false.
34+
* If it does not exist then the filter will throw a {@link StroomStreamException} with
35+
* statusCode {@link StroomStatusCode#FEED_IS_NOT_DEFINED}.
36+
* <p>
3537
* If auto content creation is enabled on stroom, then when the check is performed,
3638
* the feed will be auto-created (if various conditions for that are met) and this
3739
* filter will then return true.

0 commit comments

Comments
 (0)