So this week I've been experimenting with the MongoDB service registry
instead of the JSON service registry. Everything seems to be working
correctly, including using cas.serviceRegistry.initFromJson to copy the
JSON service registry entries into the MongoDB service registry. So that's
all good.

The only issue I have is that I'm seeing this warning message in *cas.log*:

2017-12-21 13:39:46,160 WARN
[org.apereo.cas.config.CasCoreServicesConfiguration] - <Runtime memory is
used as the persistence storage for retrieving and persisting service
definitions. Changes that are made to service definitions during runtime
WILL be LOST upon container restarts. Ideally for production, you need to
choose a storage option (JDBC, etc) to store and track service definitions.>


It's coming from
cas/core/cas-server-core-services/src/main/java/org/apereo/cas/config/CasCoreServicesConfiguration.java:

@ConditionalOnMissingBean(name = "serviceRegistryDao")
@Bean
@RefreshScope
public ServiceRegistryDao serviceRegistryDao() {
    LOGGER.warn("Runtime memory is used as the persistence storage for
retrieving and persisting service definitions. "
        + "Changes that are made to service definitions during runtime WILL
be LOST when the web server is restarted. "
        + "Ideally for production, you need to choose a storage option
(JDBC, etc) to store and track service definitions.");
...


But if I'm understanding the annotations above correctly, that bean should
only be getting created if it doesn't already exist. And over in
cas/support/cas-server-support-mongo-service-registry/src/main/java/org/apereo/cas/config/MongoDbServiceRegistryConfiguration.java
we have:

@Bean
public ServiceRegistryDao serviceRegistryDao() {
    final MongoDbServiceRegistryProperties mongo =
casProperties.getServiceRegistry().getMongo();
    return new MongoServiceRegistryDao(
            mongoDbServiceRegistryTemplate(),
            mongo.getCollection());
}


which would presumably satisfy the "there should be a serviceRegistryDao
bean" condition, thereby preventing the warning. But I'm not much of a Java
(especially Java EE) developer though, so my understanding of all the magic
behind annotations is limited to non-existent, so maybe I'm wrong.

But with DEBUG logging turned on, I see that the services from the MongoDB
service registry are "there," so the MongoDB service registry is definitely
getting instantiated:

2017-12-21 14:35:54,220 DEBUG
[org.apereo.cas.services.AbstractServicesManager] - <Adding registered
service [https://casdev.newschool.edu/cas/idp/profile/SAML2/Callback.+]>
2017-12-21 14:35:54,220 DEBUG
[org.apereo.cas.services.AbstractServicesManager] - <Adding registered
service [^https://casdev-casapp.newschool.edu/secured-by-cas(\z|/.*)]>
2017-12-21 14:35:54,221 DEBUG
[org.apereo.cas.services.AbstractServicesManager] - <Adding registered
service [https://casdev-samlsp.newschool.edu/shibboleth]>
2017-12-21 14:35:54,221 DEBUG
[org.apereo.cas.services.AbstractServicesManager] - <Adding registered
service [^https://casdev-casapp.newschool.edu/return-mapped(\z|/.*)]>
2017-12-21 14:35:54,221 DEBUG
[org.apereo.cas.services.AbstractServicesManager] - <Adding registered
service [^https://casdev-casapp.newschool.edu/secured-by-cas-duo(\z|/.*)]>
2017-12-21 14:35:54,221 DEBUG
[org.apereo.cas.services.AbstractServicesManager] - <Adding registered
service [^https://casdev.newschool.edu/cas/status/dashboard(\z|/.*)]>
2017-12-21 14:35:54,221 DEBUG
[org.apereo.cas.services.AbstractServicesManager] - <Adding registered
service [^https://casdev.newschool.edu/cas-management(\z|/.*)]>
2017-12-21 14:35:54,221 INFO
[org.apereo.cas.services.AbstractServicesManager] - <Loaded [7] service(s)
from [MongoServiceRegistryDao].>


And if the MongoDB service registry is "there," then that error message
should not be appearing.

This is with CAS-5.2.1-SNAPSHOT, built this morning. The only service
registry related properties in *cas.properties* are:

cas.serviceRegistry.mongo.clientUri:    ${mongo.uri}
cas.serviceRegistry.mongo.collection:   casServiceRegistry


Is anyone else using the MongoDB service registry (or any other service
registry) and seeing this? Am I doing something wrong or missing some
configuration property? Or did I find a bug?

Thanks,
--Dave

--

DAVID A. CURRY, CISSP
*DIRECTOR OF INFORMATION SECURITY*
INFORMATION TECHNOLOGY

71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
+1 212 229-5300 x4728 • [email protected]

[image: The New School]

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CA%2Bd9XAOpYwpV%2BYR%2BpAAPQckUfBubyheWBOTJat_B0E2iUDMOnw%40mail.gmail.com.

Reply via email to