From my initial reading i understand that HazelCast offers Session Clustering as one of it's feature. But can I use HazelCast to create and manage the complete session lifecycle (creation, update, destroy, auto-expiry) ? Does HazelCast has this capability ?
or should i still have to use something like Spring Session or regular HTTPSession for creating & managing a session's lifecycle ?
Actually hazelcast doesn't offer such a api. But you can try this trick:
sessions (that are distributed) are stored in Hazelcast Map. If you reach hazelcastInstance somehow. (probably in your web application.) Then you can add entry listener to your map. So when there is a session change (like insert,evict or removed, updated etc.) you can be informed.
Related
I have two applications, one is a Web API, and the other is a scheduled job.
Web API
First I run this service
There is an entity called 'User'
I'm adding some fake users using a DB Context called 'ApplicationContext'
The data will be persisted in an in-memory DB
Scheduled Job service (Background service)
Now I'm running this service and trying to access the same DbContext
But I don't see the fake users in the new context
How can I access the data in another application?
Your second application must access the DB via the API on the first. You can't access an in-memory database from another process without doing this.
The good news is, this means the first application enables you to expose higher level features than the bare database. This is mostly the entire purpose of a service.
#RefreshScope and /refresh not working for updating multiple service instance i know this can be done using spring cloud bus but due to some constraint i can not opt for that is there any alternatives
Consider using Ribbon to determine the available instances and then call refresh event for all of them. I have not tried this, but seems to be possible as I read in the documentations
I am using Grace and I want to configure it to track my settings in appsettins.json file. I can configure that with default container of ASP.NET Core like the following:
services.Configure<DatabaseConnectionSettings>(this.Configuration.GetSection("Database:Connection"));
and later use the IOptions<DatabaseConnectionSettings> or for reloading capability IOptionsSnapshot<DatabaseConnectionSettings> to get the strong-typed values from the container. How can I achieve this when using Grace? and will it support the reload capability of settings when the underlying data changed?
You can continue configuring your application the exact same way. What ever is registered in the service collection will be registered automatically in Grace. I just created an sample app to test that
We are moving right along with building out our custom IdentityServer solution based on IdentityServer3. We will be deploying in a load balanced environment.
According to https://identityserver.github.io/Documentation/docsv2/configuration/serviceFactory.html there are a number of services and stores that need to be implemented.
I have implemented the mandatory user service, client and scope stores.
The document says there are other mandatory items to implement but that there are default InMemory versions.
We were planning on using the default in memory for the other stuff but am concerned that not all will work in a load balanced scenario.
What are the other mandatory services and stores we must implement for things to work properly when load balanced?
With multiple Identity Server installations serving the same requests (e.g. load balanced) you won't be able to use the various in-memory token stores, otherwise authorization codes, refresh tokens and reference tokens issued by one server won't be recognized by the other, nor will user consent be persisted. If you are using IIS, machine key synchronization is also necessary to have tokens work across all instances.
There's an entity framework package available for the token stores. You'll need the operational data.
There's also a very useful guide to going live here.
I note that with the various refactoring of common elements into spring cloud commons, the information that you get from auto wiring DiscoveryClient is rather sparse.
Lets say that I want to get more information for the incoming service data that the service gets when it registers with Eureka. Much of what i want is in the Application object.
I know that I could get this detail form the EurekaClient. How can I get access to the EurekaClient object.
I suspect you mean InstanceInfo objects, since Application basically just holds a list on InstanceInfo's. The ServiceInstance returned from the Spring Cloud DiscoveryClient.getInstances(serviceId) backed by an InstanceInfo. My guess is it would be easiest for you to autowire EurekaClient (or com.netflix.*.DiscoveryClient if your using an older version) and go from there. We have to be sparse as we support more than just eureka (consul, zookeeper).