Skip to content

ATLAS-5377: Remove duplicate NotificationREST endpoint from webapp - #730

Open
UmeshPatil-1 wants to merge 2 commits into
apache:masterfrom
UmeshPatil-1:ATLAS-5377
Open

ATLAS-5377: Remove duplicate NotificationREST endpoint from webapp#730
UmeshPatil-1 wants to merge 2 commits into
apache:masterfrom
UmeshPatil-1:ATLAS-5377

Conversation

@UmeshPatil-1

@UmeshPatil-1 UmeshPatil-1 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR implements ATLAS-5377: consolidate hook REST notification ingress on rest-notification-webapp and remove the duplicate endpoint from the main Atlas webapp.

Background

Previously, hooks could POST notification messages to two URLs:

Endpoint URL
Main webapp (duplicate) POST http://<host>:21000/api/atlas/v2/notification/topic/{topicName}
REST notification server (canonical) POST http://<host>:41000/rest/api/atlas/v2/notification/topic/{topicName}

This PR removes the duplicate ingress on port 21000 and ensures hook clients target 41000/rest only.

Changes

1. Remove duplicate endpoint from main webapp

  • Deleted webapp/src/main/java/org/apache/atlas/web/rest/NotificationREST.java
  • Hook POST to :21000/api/atlas/v2/notification/topic/{topicName} is no longer served
  • Canonical endpoint remains in rest-notification-webapp (unchanged)

2. RestNotification client fail-fast

  • Modified notification/src/main/java/org/apache/atlas/notification/rest/RestNotification.java
  • Removed silent fallbacks to:
    • atlas.rest.address (main webapp, port 21000)
    • DEFAULT_ATLAS_URL (http://localhost:31000/)
  • If atlas.hook.rest.notification.address is not configured when REST notification is enabled, throws AtlasException at startup with an actionable message
  • Uses AtlasConfiguration.NOTIFICATION_HOOK_REST_ADDRESS.getPropertyName() instead of a hardcoded property string

3. AtlasConstants

  • Added DEFAULT_REST_NOTIFICATION_ADDRESS = "http://localhost:41000/rest" for error-message guidance
  • Retained DEFAULT_ATLAS_REST_ADDRESS = "http://localhost:21000" for the main metadata REST API (unchanged purpose)

4. Unit tests

  • Updated notification/src/test/java/org/apache/atlas/notification/RestNotificationTest.java
  • Replaced fallback tests with fail-fast tests (missing address, blank address, only atlas.rest.address configured)
  • Added test for exception message content

Breaking change / migration

Operators using REST hook mode must configure:

atlas.hook.rest.notification.enabled=true
atlas.hook.rest.notification.address=http://<rest-host>:41000/rest
atlas.rest.basic.auth.username=<user>
atlas.rest.basic.auth.password=<password>

How was this patch tested?

Unit tests

mvn clean install -DskipITs=false -Dcheckstyle.skip=false -Drat.skip=true
mvn -pl common install -DskipTests -Drat.skip=true
mvn -pl notification test -Dtest=RestNotificationTest -Drat.skip=true

Result: Tests run: Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS

Manual tests (local distro)

Test Command / check Expected Result
REST canonical POST curl -u admin:admin -X POST .../41000/rest/.../ATLAS_HOOK HTTP 204 PASS
Main webapp POST removed curl -u admin:admin -X POST .../21000/api/.../ATLAS_HOOK Endpoint gone (HTTP 500 + NotFoundException in application.log) PASS
Main Atlas health curl -u admin:admin .../21000/api/atlas/v2/types/typedefs HTTP 200 PASS
REST server health curl .../41000/rest/api/atlas/admin/status HTTP 200 PASS
Authorization curl -u rangertagsync:rangertagsync -X POST .../41000/rest/.../ATLAS_HOOK HTTP 403 PASS

References


UI changes

None — no UI changes in this PR.

…webapp (port 21000) and require hooks to use rest-notification-webapp (port 41000/rest) only.
@chaitalicod

Copy link
Copy Markdown
Contributor

@UmeshPatil-1 Did you check this on docker ?

@UmeshPatil-1

Copy link
Copy Markdown
Contributor Author

@UmeshPatil-1 Did you check this on docker ?

yes

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.

2 participants