Skip to content

Commit d2a032a

Browse files
authored
Rename namespace qualifiers for exposed services (#896)
1 parent db4d0c1 commit d2a032a

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

services-gateway/src/main/java/io/scalecube/services/gateway/http/HttpGatewayAcceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private static ServiceReference matchFileRequest(List<ServiceReference> list) {
186186
return null;
187187
}
188188
final var sr = list.get(0);
189-
if ("application/scalecube-file".equals(sr.tags().get("Content-Type"))) {
189+
if ("application/file".equals(sr.tags().get("Content-Type"))) {
190190
return sr;
191191
} else {
192192
return null;
@@ -202,7 +202,7 @@ private Mono<Void> handleFileRequest(
202202
(signal, flux) -> {
203203
final var qualifier = message.qualifier();
204204
final var map =
205-
DynamicQualifier.from("v1/scalecube.endpoints/:endpointId/files/:name")
205+
DynamicQualifier.from("v1/endpoints/:endpointId/files/:name")
206206
.matchQualifier(qualifier);
207207
if (map == null) {
208208
throw new RuntimeException("Wrong qualifier: " + qualifier);

services-gateway/src/main/java/io/scalecube/services/gateway/websocket/HeartbeatService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@Service(HeartbeatService.NAMESPACE)
1212
public interface HeartbeatService {
1313

14-
String NAMESPACE = "v1/scalecube.websocket";
14+
String NAMESPACE = "v1/heartbeat";
1515

1616
@ServiceMethod
1717
Mono<Long> ping(long value);

services-gateway/src/test/java/io/scalecube/services/gateway/files/FileDownloadTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void testExportReport() throws IOException {
129129
.block(TIMEOUT);
130130
assertNotNull(reportResponse, "reportResponse");
131131
assertNotNull(reportResponse.reportPath(), "reportResponse.reportPath");
132-
assertTrue(reportResponse.reportPath().matches("^v1/scalecube.endpoints/.*/files/.*$"));
132+
assertTrue(reportResponse.reportPath().matches("^v1/endpoints/.*/files/.*$"));
133133

134134
final var file =
135135
downloadFile("http://localhost:" + httpAddress.port() + "/" + reportResponse.reportPath());
@@ -152,7 +152,7 @@ void testFileExpired() throws InterruptedException {
152152
.block(TIMEOUT);
153153
assertNotNull(reportResponse, "reportResponse");
154154
assertNotNull(reportResponse.reportPath(), "reportResponse.reportPath");
155-
assertTrue(reportResponse.reportPath().matches("^v1/scalecube.endpoints/.*/files/.*$"));
155+
assertTrue(reportResponse.reportPath().matches("^v1/endpoints/.*/files/.*$"));
156156

157157
// Download file first time
158158

@@ -198,7 +198,7 @@ void testFileNotFound() {
198198
serviceCall.api(ReportService.class).exportReport(new ExportReportRequest()).block(TIMEOUT);
199199
assertNotNull(reportResponse, "reportResponse");
200200
assertNotNull(reportResponse.reportPath(), "reportResponse.reportPath");
201-
assertTrue(reportResponse.reportPath().matches("^v1/scalecube.endpoints/.*/files/.*$"));
201+
assertTrue(reportResponse.reportPath().matches("^v1/endpoints/.*/files/.*$"));
202202

203203
final var reportPath = reportResponse.reportPath();
204204
final var s = reportPath.substring(reportPath.lastIndexOf("/"));
@@ -226,7 +226,7 @@ void testWrongFileName() {
226226
serviceCall.api(ReportService.class).exportReport(new ExportReportRequest()).block(TIMEOUT);
227227
assertNotNull(reportResponse, "reportResponse");
228228
assertNotNull(reportResponse.reportPath(), "reportResponse.reportPath");
229-
assertTrue(reportResponse.reportPath().matches("^v1/scalecube.endpoints/.*/files/.*$"));
229+
assertTrue(reportResponse.reportPath().matches("^v1/endpoints/.*/files/.*$"));
230230

231231
final var reportPath = reportResponse.reportPath();
232232
final var s = reportPath.substring(reportPath.lastIndexOf("/"));
@@ -253,7 +253,7 @@ void testYetAnotherWrongFileName() {
253253
serviceCall.api(ReportService.class).exportReport(new ExportReportRequest()).block(TIMEOUT);
254254
assertNotNull(reportResponse, "reportResponse");
255255
assertNotNull(reportResponse.reportPath(), "reportResponse.reportPath");
256-
assertTrue(reportResponse.reportPath().matches("^v1/scalecube.endpoints/.*/files/.*$"));
256+
assertTrue(reportResponse.reportPath().matches("^v1/endpoints/.*/files/.*$"));
257257

258258
final var reportPath = reportResponse.reportPath();
259259
final var s = reportPath.substring(reportPath.lastIndexOf("/"));

services/src/main/java/io/scalecube/services/files/FileStreamer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
/**
1010
* System service interface for streaming files after they have been added locally with {@link
11-
* FileService#addFile(AddFileRequest)}. NOTE: this is system service inerface, clients are not
11+
* FileService#addFile(AddFileRequest)}. NOTE: this is system service interface, clients are not
1212
* supposed to inject it into their app services and call it directly.
1313
*/
1414
@Service(FileStreamer.NAMESPACE)
1515
public interface FileStreamer {
1616

17-
String NAMESPACE = "v1/scalecube.endpoints";
17+
String NAMESPACE = "v1/endpoints";
1818

19-
@Tag(key = "Content-Type", value = "application/scalecube-file")
19+
@Tag(key = "Content-Type", value = "application/file")
2020
@RestMethod("GET")
2121
@ServiceMethod("${microservices:id}/files/:name")
2222
Flux<byte[]> streamFile();

0 commit comments

Comments
 (0)