March 31, 2016 at 4:20 pm #9171
I’ve write a few classes to communicate with OpenAM with the help of the Client SDK.
This classes works fine in a standalone application, so no jee server required.
This is done creating and endpoint that receives the notification message.
The configuration of the Client SDK is done with pure Java, and not with the AMConfig.properties file.
I can see the notifications received, and in the OpenAM server I can see the log messages referring to the client endpoint.
I’ve just added a Listener to the ShutdownManager, and I pass the “-Dopenam.runtime.shutdown.hook.enabled=true”. The listener stops the endpoint, I see the log messages about that. But the OpenAM server tries to send the notification messages to the stopped endpoint, so I think I missed something like ‘deregister’ the notification endpoint to stop the notifications.
The message I can see in the server log is:
ERROR: Cannot send notification to http://A.B.C.D:8181/notificationListener.
Where A.B.C.D is my private IP.
What I am missing in this scenery?
I need to know how it works the “de-register” client notification url.
Thank you for your help and your time.
March 31, 2016 at 4:26 pm #9173
- This topic was modified 6 years, 6 months ago by descartable.emails.
Sorry, the correct topic should be: Receiving Notifications in a standalone Java applicationApril 1, 2016 at 8:39 am #9206Peter MajorModerator
I’m not sure if the ClientSDK actually deregisters listeners upon shutdown. It certainly performs some kind of cleanup, but it’s most likely not going to go through all the session IDs and try to deregister the session listeners.April 1, 2016 at 8:58 am #9208
Thank you for your answer.
I have two questions about that:
- When you say “session IDs”, are you referring to the session IDs in SDK cache?
- The client is not running, but OpenAM tries to send it notifications, so OpenAM keeps the URL in its internal data structure. Is it possible to see the list of listeners in the web admin interface or calling a REST service? I read an old article about OpenSSO (I think it is valid in OpenAM) about entitlements and listeners, with three operations: adding, retrieving and deleting, but it has not listing.
- The sessions in OpenAM expires after a time. Is it possible that OpenAM doesn’t remove that when the session ID contains a session listener?
- I think that restarting OpenAM would clean the pending notifications in the server, to stop the log messages. Is there any other way to get that without restarting the OpenAM?
I am reading the code and some articles about that, to imagine a way to fix my problem.
If you can say me about the entitlements in the Client SDK (for example, if exists a class to perform the listener entitlement operations) it would be great.April 7, 2016 at 11:12 am #9356Peter MajorModerator
2) listeners are registered for individual sessions normally (there is a server-wide notification option as well, but IIRC the ClientSDK doesn’t use that), there is no way to retrieve a list of them without actually traversing through all the active sessions in the system.
4) don’t shut down your clientsdk app? (I mean is this a valid use-case?)
You must be logged in to reply to this topic.