Spring Cloud Config Server using properties from server in actual application - spring-cloud-config-server

I use Spring cloud config server embedded in an application. Can I populate that application's placeholders?
If my config server gets a property ${some.property} from git, vault, native; can I actually use that ${some.property}, in the sever's actual application?

Related

.net core console app transient DI EF connection

i'm piecing together EF and DI, i have a beginners understanding in it and im trying to solve for the following (in the one solution);
I have a web app (blazor web assembly) which has two projects (Client / Server)
I have a separate console app which will run off a service bus queue and needs to interact with the EF model in the server project
The solution is multi-tenant, so i send the client ID as a part of the request to the console app which will tell the app (and dbContext) which tenant DB to connect to
i have added the server project reference to the console app, and what i have the console app currently listening to a service bus queue and executing the required processing with dummy stub data.
what i need help with is how to setup the console app in .net6.0 to;
establish a transient DI database dbContext which uses the other project EF model AND establishes a tenant db connection on each execute (service bus post)
as a result of the processing i may need to also send a request to another service bus queue for other processing / actions / etc.
so i'm assuming a singleton service for that....???
i know the model, just not sure on how to code...
it's fairly simple and would probably take a dev about 15 minutes to configure... i'm not a good dev though :D

How can I acquire a server session from a Lotus Domino OSGI servlet

From a Domino OSGi Servlet I can acquire a user session using:
ContextInfo.getUserSession()
However, as part of the execution of the servlet I need to access a database to retrieve configuration settings. This database is only accessible to Admins and the server so I need, ideally, a signer or server session as well.
Is this possible?
You can create a server session with NotesFactory.createSession().
The class must be imported by import lotus.domino.NotesFactory;
There are unsupported methods available in the lotus.domino code that can do this, which are used in org.openntf.domino.session.NativeSession (https://stash.openntf.org/projects/ODA/repos/dominoapi/browse/domino/core/src/main/java/org/openntf/domino/session/NativeSessionFactory.java#14 and https://stash.openntf.org/projects/ODA/repos/dominoapi/browse/domino/core/src/main/java/org/openntf/domino/session/LotusSessionFactory.java#63).
If you want that and more, OpenNTF Domino API Starter Servlet uses ODA to provide a starter OSGi servlet that brings all the benefits of ODA plus examples of JSON handling from IBM packages and an optional HTTP Service. There is an introductory video on NotesIn9.

JMS JNDI pool locked on server

I was developing a simple Spring MVC application that invokes a Web Service over a JMS trasport. I need to deploy it on websphere application server. Everything seems to work fine when I reference the remote connection factory directly from my application, and even seems to work properly when I try to use a local JNDI Queue connection factory on my WAS, but then, I cannot shutdown my server.
It seems to be because its connections pool keeps locked by somebody. It never invokes Session.close over JMS session (it is managed by JAX-WS server framework, in this case Apache Axis2). I have done the same from an even simpler spring MVC application (just #Controller and views) and it stops fine. The application that makes pool to be locked just includes a more complex context with persistence and transaction management (annotation-driven).
Do you think that this transaction mananagement could affect JMS session management? Somebody have ever found a JMS connection pool locked by an spring application?
Thanks.
Regards.
That was the solution to avoid locking. We removed ServletContext.close, so our server can find the references to used resources, and can release connections on pool.

webapp configuration in spring mvc read from database

I'm struggling to find some idea, tutorial or sample how to put some of the configuration of the webapp into database. There will be static configuration put in properties files like database connection, but there is some configuration which can be changed like email account, facebook account and best location for this in the database. That configuration should be loaded as soon as possible when webapp starts. Ideally all the configuration should be in some bean named Configuration.
Thanks in advance.
When a Spring webapp starts, Spring instantiates and injects all its beans. Once the beans are instantiated and injected, if a bean has a method annotated with #PostConstruct, it calls this method.
So you just have to define such a method, read the config from the database and store it in the bean (if you want it to be cached).
Inject this bean everywhere you need access to the configuration properties.

Customize the CSLA server side initialization

I have next problem. We have a huge client-server system and use CSLA to operate with DB data. There are a set of WinForms-based clients and one WCF-based AppServer. We have custom logging subsystem and settings for this subsystem are stored in DB. So on initialization of each side of our system (client application or application server) we need to configure logging subsystem with settings from DB. In the client application it is easy to do. But how can we extend CSLA WCF Portal to init logging after init of CSLA WCF Portal??
So, how to customize the initialization of CSLA?
Thanks a lot!!
Rockford Lhotka answered this question on his forum http://forums.lhotka.net/forums/p/9224/43785.aspx#43785
In CSLA 3.8 and higher there's one hook that exists on the server before anything else occurs. It is designed to enable authorization on every single server call, but it can be used to perform server-side initialization as well.
You need to implement Csla.Server.IAuthorizeDataPortal and add a config entry so the data portal knows the assembly qualified type name of your class that implements the interface.

Resources