Skip to content

Backend/proxy improve - #45

Merged
luis-godinho merged 12 commits into
backend/implementationfrom
backend/proxy-improve
Jun 29, 2026
Merged

luis-godinho merged 12 commits into
backend/implementationfrom
backend/proxy-improve

Conversation

@luis-godinho

Copy link
Copy Markdown
Contributor

Improvement of the proxy, so it can be used with different combinations of services.

- CMoveService.resolve(): fallback to legacy /search for candidate resolution when no QueryMoveService plugin is loaded
- DimseMoveRetrieveTask.createDataWriter(): handle legacy:// URI scheme by fetching DICOM from legacy /storage via HTTP
- LegacyProxyService: add getFile(fullUri) using java.net.http.HttpClient for binary DICOM fetch
- DimseCStoreServer: 9-param constructor with LegacyProxyService, backward-compatible overloads
- DimseCStoreConfig: wire LegacyProxyService into CMoveService and DimseCStoreServer beans
- Update test constructors for new signatures
- Docker test environment: add C-MOVE destination config (LEGACYSCP) and extra_hosts for host.docker.internal

E2E tested: storescu -> index -> movescu -> legacy fallback -> completed=2, failed=0, status=0H (Success)
- SearchController: falls back to legacy /search when no QueryService plugin
- QueryIndexController: falls back to legacy /management/tasks/index for
  index/reindex/status when no QueryIndexMaintenance plugin
- DicomwebQidoService: add hasQueryPlugins() method
- LegacyProxyService: add postIndex(uri) for legacy index task submission
- dicoogle-next-protocol-dicomweb: add optional legacy-proxy dependency

E2E tested both modes:
  Fallback mode: all 5 paths (C-STORE, C-FIND, C-MOVE, HTTP /search,
  HTTP /index) correctly fall back to legacy
  Local mode: all operations handled locally with zero fallback triggers

Also removed docker-test/ directory (no longer needed)
Add storage-retrieve-mode and query-index-mode flags (AUTO/LEGACY/NEW)
to control routing per domain group. C-STORE/C-MOVE share storage domain,
C-FIND/search/index share query domain.

Mode flags wired into all DIMSE services and HTTP controllers.
LegacyProxyProperties.Mode enum with shouldUseLegacy helpers.
application.yml defaults to AUTO for both modes.

Add docker-test/ with full mode combination matrix test:
- 5 mode combinations tested end-to-end
- test-matrix.sh generates per-mode Dockerfiles
- Tests C-STORE, C-FIND, C-MOVE, HTTP /search, HTTP /system/index
- README with credentials, ports, flags, manual testing commands
- Add queryPluginCount() and movePluginCount() to QueryRouter
- Fix CFindService/CMoveService: use router.queryPluginCount() instead of plugins.isEmpty()
- Fix DicomwebQidoService: use router.queryPluginCount() instead of plugins.isEmpty()
- Fix duplicate legacyProxyProperties assignment in constructors
- Fix test constructors to pass null for LegacyProxyProperties param
- Fix mangled CMoveService constructor calls in integration tests
- All 27 tests pass
…retrieve mode

C-MOVE has two phases: resolve (query candidates) and fetch (retrieve files).
The resolve phase is a query operation and should use shouldUseLegacyForQueryIndex.
The fetch phase uses storage-retrieve mode via legacy:// URI scheme handling.
- Add dicoogle-storage named volume to docker-compose.yml, mounted at
  /dicoogle-storage on both legacy and next containers
- Update file-storage.xml root-dir from /tmp to /dicoogle-storage
- Add --app.storage.file-rw.root-dir=/dicoogle-storage to generated
  Dockerfiles in test-matrix.sh
- Fix reindex targets: reindex based on query plugin (qi_plugin) not
  storage plugin (sr_plugin), use /dicoogle-storage paths
- Update README.md with shared volume documentation and correct paths
- All 5 mode combinations pass: LEGACY_LEGACY, NEW_NEW, LEGACY_NEW,
  NEW_LEGACY, AUTO_AUTO
- Fix postIndexWithToken URI double-encoding: URLEncoder.encode + WebClient
  uri(String) both encoded the URI, producing mangled file%253A%252F%252F
  that legacy Lucene couldn't parse. Use uriBuilder.queryParam instead.
- Convert *:* to * in SearchController legacy fallback since legacy Lucene
  doesn't handle *:* with expand parameter.
- Add dicoogle-staging shared volume for test data isolation.
- Improve test matrix: staging dir for DICOM files, search after indexing
  step, longer reindex wait for async legacy Lucene.
- Add next_login function for new backend JWT token auth
- Replace all basic auth (-u developer:developer) with Bearer token
- Update README credentials from developer:developer to dicoogle:dicoogle
- Update README examples to use bearer token auth
@luis-godinho
luis-godinho merged commit e8378fe into backend/implementation Jun 29, 2026
3 checks passed
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.

1 participant