Skip to content

Conversation

@Marcin-Here
Copy link
Contributor

No description provided.

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.

![extensions_loading.png](../diagrams/extensions_loading.png))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove additional bracket ")"

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor Author

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
```
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

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
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


- `-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.
Copy link
Member

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.

Copy link
Contributor Author

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());
Copy link
Member

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?

Copy link
Contributor Author

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");
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Marcin-Here Marcin-Here merged commit 2d1493e into v3 Oct 16, 2025
3 of 4 checks passed
@Marcin-Here Marcin-Here deleted the CASL-1358_extensions_local_testing_to_v3 branch October 16, 2025 14:16
czyz-bartosz pushed a commit that referenced this pull request Oct 28, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants