-
Notifications
You must be signed in to change notification settings - Fork 5
CASL-1358: Extensions local testing #522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Marcin-Here <[email protected]>
docs/drafts/EXTENSIONS_TESTING.md
Outdated
| The Naksha Hub (REST Service) receives requests through API endpoints, processes them via internal synchronous pipeline by invoking pre-configured inbuilt / custom Event Handlers. | ||
| When pipeline encounters custom handler, the respective EventHandler implementation is loaded from the cached copy of Extension. The Extensions are (un)cached dynamically (via background job) from the external Extension Registry (S3 bucket or local folder). The setup thus, allows flexibility in injecting the custom business logic as part of pipeline execution. | ||
|
|
||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove additional bracket ")"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| 1. **Prepare the config directory** as per the configuration instructions: [Naksha Service Configuration](../../README.md#configuration). | ||
| 2. **Start Naksha Service using the custom config**. For example, you can run: | ||
| ```bash | ||
| java -jar here-naksha-app-service/build/libs/naksha-app-service-*.jar extension-config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are not specifying the version of the jar then try to use same convention everywhere like Section#9 Intellij Debugging to avoid confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| 2025-09-24 15:30:48.455 -0500 [INFO ] [NakshaWorker#2] - ext.test.handlers.TestHandler (processEvent:45) {streamId=3Yr6hZRsTSS9} - Handler received request WriteXyzFeatures | ||
| 2025-09-24 15:30:48.465 -0500 [INFO ] [NakshaWorker#2] - app.service.util.logging.AccessLogUtil (writeAccessLog:219) {streamId=3Yr6hZRsTSS9} - {"time":"2025-09-24T20:30:48,464","clientInfo":{"appId":"naksha","ip":"0:0:0:0:0:0:0:1","realm":null,"remoteAddress":"0:0:0:0:0:0:0:1:60076","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36","userId":"master-test-user"},"ms":37,"ns":37950490,"reqInfo":{"accept":"application/geo+json","contentType":"application/geo+json","method":"POST","origin":"http://localhost:8080","referer":"http://localhost:8080/hub/swagger/index.html","size":540,"uri":"/hub/spaces/test_space/features"},"respInfo":{"contentType":"application/geo+json","size":68,"statusCode":200,"statusMsg":"OK"},"src":null,"streamId":"3Yr6hZRsTSS9","streamInfo":{"spaceId":"test_space","timeInStorageMs":0},"t":"STREAM","timeWithoutStorageMs":37,"unixtime":1758745848464} | ||
| 2025-09-24 15:30:48.465 -0500 [INFO ] [NakshaWorker#2] - app.service.util.logging.AccessLogUtil (writeAccessLog:225) {streamId=3Yr6hZRsTSS9} - [REST API stats => spaceId,storageId,method,uri,status,timeTakenMs,resSize,timeWithoutStorageMs] - RESTAPIStats test_space - POST /hub/spaces/test_space/features 200 37 68 37 | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have V3 specific logs here? Instead of copying it from V2 file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
docs/drafts/EXTENSIONS_TESTING.md
Outdated
| Use the following command to start the Naksha service with remote debugging enabled: | ||
|
|
||
| ```bash | ||
| java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8888,suspend=y -jar naksha-2.2.12-all.jar extension-config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my above comment related to jar version, Make sure to use same convention everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
docs/drafts/EXTENSIONS_TESTING.md
Outdated
|
|
||
| - `-Xdebug` → Enables debugging. | ||
| - `-Xrunjdwp:server=y,transport=dt_socket,address=8888,suspend=y` → Starts a remote debugging server on port `8888` and waits for the debugger to attach before running. | ||
| - `-jar naksha-2.2.2-all.jar` → Specifies the Naksha service JAR to run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my above comment related to jar version, Make sure to use same convention everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| .getProperties() | ||
| .getOr(WHITE_LIST_CLASSES, extensionConfig.getWhitelistDelegateClasses()); | ||
| logger.info("Whitelist classes in use for extension {} are {}", extensionIdWthEnv, whitelistClasses); | ||
| logger.info("Whitelist classes in use for extension {} are {}", extensionIdWthEnv, whitelistClasses.toArray()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need toArray() here? Will it work if we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need for now. It will not work without it. When I looked into it seems that is problem with proxy model classes like StringList and AnyObject when working with logger. I will add ticket for it.
| extensionIds.add(extensionId); | ||
| } else { | ||
| logger.error("Environment is missing for an extension Id"); | ||
| logger.info("Environment is missing for an extension Id"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Marcin-Here <[email protected]>
here-naksha-lib-hub/src/jvmMain/java/com/here/naksha/lib/hub/NakshaHubConfig.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Marcin-Here <[email protected]>
* CASL-1358: Extensions local testing Signed-off-by: Marcin-Here <[email protected]> * CASL-1358: README corrections. Signed-off-by: Marcin-Here <[email protected]> * CASL-1358: moved README files to 'latest'. Signed-off-by: Marcin-Here <[email protected]> --------- Signed-off-by: Marcin-Here <[email protected]>
No description provided.