Hazelcast Spring Session pass node instanceHazelcast Spring Session SubZero(Kryo) EntryBackupProcessorImpl NullPointerException issueHazelcast MapStoreConfig ignoredHazelcast HTTP session replication doesn't replicate anythingDiscovering Hazelcast instance in a Spring Boot eco-systemfacing issues with hazelcast backup - sync backup not workingHazelcast: how data is partitioned when using Cluster Groups?Hazelcast Session Replciation With Spring BootHazelcast configuration - instance with mismatching network config is able to form join the clusterSpring boot + spring security + hazelcast session replication could not make it workPayara - Hazelcast cluster node picks the wrong network interfaceHazelcast Spring Session SubZero(Kryo) EntryBackupProcessorImpl NullPointerException issue
Class Action - which options I have?
Two monoidal structures and copowering
How do I find the solutions of the following equation?
How do I rename a Linux host without needing to reboot for the rename to take effect?
How does buying out courses with grant money work?
How did Arya survive the stabbing?
How do scammers retract money, while you can’t?
Implement the Thanos sorting algorithm
Is there a korbon needed for conversion?
How can a function with a hole (removable discontinuity) equal a function with no hole?
Large drywall patch supports
Why not increase contact surface when reentering the atmosphere?
How do I go from 300 unfinished/half written blog posts, to published posts?
Anatomically Correct Strange Women In Ponds Distributing Swords
Is there a good way to store credentials outside of a password manager?
A particular customize with green line and letters for subfloat
Crossing the line between justified force and brutality
Lay out the Carpet
Sequence of Tenses: Translating the subjunctive
How do I extract a value from a time formatted value in excel?
Integer addition + constant, is it a group?
Roman Numeral Treatment of Suspensions
How to write papers efficiently when English isn't my first language?
Type int? vs type int
Hazelcast Spring Session pass node instance
Hazelcast Spring Session SubZero(Kryo) EntryBackupProcessorImpl NullPointerException issueHazelcast MapStoreConfig ignoredHazelcast HTTP session replication doesn't replicate anythingDiscovering Hazelcast instance in a Spring Boot eco-systemfacing issues with hazelcast backup - sync backup not workingHazelcast: how data is partitioned when using Cluster Groups?Hazelcast Session Replciation With Spring BootHazelcast configuration - instance with mismatching network config is able to form join the clusterSpring boot + spring security + hazelcast session replication could not make it workPayara - Hazelcast cluster node picks the wrong network interfaceHazelcast Spring Session SubZero(Kryo) EntryBackupProcessorImpl NullPointerException issue
Trying to configure Spring Session using Hazelcast. It works okay out of the box using this doc - but it uses default hazelcast node. In my case I am running several nodes(those are in different clusters) on the same JVM, and I need use particular hazelcast instance to store my session. I haven't find much information, how to configure it(pass hazelcast instance nameor instance itself).
Will appreciate any help.
hazelcast spring-session
add a comment |
Trying to configure Spring Session using Hazelcast. It works okay out of the box using this doc - but it uses default hazelcast node. In my case I am running several nodes(those are in different clusters) on the same JVM, and I need use particular hazelcast instance to store my session. I haven't find much information, how to configure it(pass hazelcast instance nameor instance itself).
Will appreciate any help.
hazelcast spring-session
add a comment |
Trying to configure Spring Session using Hazelcast. It works okay out of the box using this doc - but it uses default hazelcast node. In my case I am running several nodes(those are in different clusters) on the same JVM, and I need use particular hazelcast instance to store my session. I haven't find much information, how to configure it(pass hazelcast instance nameor instance itself).
Will appreciate any help.
hazelcast spring-session
Trying to configure Spring Session using Hazelcast. It works okay out of the box using this doc - but it uses default hazelcast node. In my case I am running several nodes(those are in different clusters) on the same JVM, and I need use particular hazelcast instance to store my session. I haven't find much information, how to configure it(pass hazelcast instance nameor instance itself).
Will appreciate any help.
hazelcast spring-session
hazelcast spring-session
edited Mar 20 at 16:16
Oleg Kuts
asked Mar 20 at 14:55
Oleg KutsOleg Kuts
369721
369721
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Session storage is sharded across the available nodes. You can't chose which node hosts any particular session. Further, if Hazelcast needs to rebalance the shards, sessions may get moved from one node to another.
The instance-name
parameter just dictates whether to try to find an existing connection to the cluster or whether to start a new connnection.
Perhaps the question is why do you need to control which node hosts which session?
I should have mentioned those nodes are in different clusters(groups), but running same JVM. I will have several instances of app, and two clusters. The reason I need two clusters is - one cluster will be used for distributed cache(both service and second level), another - for distributed session only. The reason I am doing so is that for nodes in first cluster I will be using Kryo(SubZero), and I have faced issue running Kryo with distributed session. So as a workaround i was going to create separate cluster for session. For that purpose I need to tell SpringSession to use particular node.
– Oleg Kuts
Mar 20 at 16:24
I described my issue with Kryo and Spring Session here stackoverflow.com/questions/55262028/…
– Oleg Kuts
Mar 20 at 16:24
add a comment |
Next code let me to configure Spring Session to use particular node, instead of default one. Only question I have is how to configure session time to live. hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600)
sets only max inactive time, not time to live.
@Configuration
@EnableSpringHttpSession
public class HazelcastSessionConfig
@Bean//default
public HazelcastInstance hazelcastInstance()
Config config = new Config();
config.setInstanceName("cache-node");
config.getGroupConfig().setName("cluster-1");
return Hazelcast.newHazelcastInstance(config);
@Bean//Node I need to use
public HazelcastInstance hazelcastSessionInstance()
Config config = new Config();
config.setInstanceName("session-node");
config.getGroupConfig().setName("cluster-2");
MapAttributeConfig attributeConfig = new MapAttributeConfig()
.setName(HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
.setExtractor(PrincipalNameExtractor.class.getName());
final MapConfig mapConfig = config.getMapConfig(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME);
mapConfig
.addMapAttributeConfig(attributeConfig)
.addMapIndexConfig(new MapIndexConfig(
HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));
return Hazelcast.newHazelcastInstance(config);
@Bean//Pass node here
public HazelcastSessionRepository sessionRepository(HazelcastInstance hazelcastSessionInstance)
final HazelcastSessionRepository hazelcastSessionRepository = new HazelcastSessionRepository(hazelcastSessionInstance);
hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600);
return hazelcastSessionRepository;
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55263815%2fhazelcast-spring-session-pass-node-instance%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Session storage is sharded across the available nodes. You can't chose which node hosts any particular session. Further, if Hazelcast needs to rebalance the shards, sessions may get moved from one node to another.
The instance-name
parameter just dictates whether to try to find an existing connection to the cluster or whether to start a new connnection.
Perhaps the question is why do you need to control which node hosts which session?
I should have mentioned those nodes are in different clusters(groups), but running same JVM. I will have several instances of app, and two clusters. The reason I need two clusters is - one cluster will be used for distributed cache(both service and second level), another - for distributed session only. The reason I am doing so is that for nodes in first cluster I will be using Kryo(SubZero), and I have faced issue running Kryo with distributed session. So as a workaround i was going to create separate cluster for session. For that purpose I need to tell SpringSession to use particular node.
– Oleg Kuts
Mar 20 at 16:24
I described my issue with Kryo and Spring Session here stackoverflow.com/questions/55262028/…
– Oleg Kuts
Mar 20 at 16:24
add a comment |
Session storage is sharded across the available nodes. You can't chose which node hosts any particular session. Further, if Hazelcast needs to rebalance the shards, sessions may get moved from one node to another.
The instance-name
parameter just dictates whether to try to find an existing connection to the cluster or whether to start a new connnection.
Perhaps the question is why do you need to control which node hosts which session?
I should have mentioned those nodes are in different clusters(groups), but running same JVM. I will have several instances of app, and two clusters. The reason I need two clusters is - one cluster will be used for distributed cache(both service and second level), another - for distributed session only. The reason I am doing so is that for nodes in first cluster I will be using Kryo(SubZero), and I have faced issue running Kryo with distributed session. So as a workaround i was going to create separate cluster for session. For that purpose I need to tell SpringSession to use particular node.
– Oleg Kuts
Mar 20 at 16:24
I described my issue with Kryo and Spring Session here stackoverflow.com/questions/55262028/…
– Oleg Kuts
Mar 20 at 16:24
add a comment |
Session storage is sharded across the available nodes. You can't chose which node hosts any particular session. Further, if Hazelcast needs to rebalance the shards, sessions may get moved from one node to another.
The instance-name
parameter just dictates whether to try to find an existing connection to the cluster or whether to start a new connnection.
Perhaps the question is why do you need to control which node hosts which session?
Session storage is sharded across the available nodes. You can't chose which node hosts any particular session. Further, if Hazelcast needs to rebalance the shards, sessions may get moved from one node to another.
The instance-name
parameter just dictates whether to try to find an existing connection to the cluster or whether to start a new connnection.
Perhaps the question is why do you need to control which node hosts which session?
answered Mar 20 at 15:55
Neil StevensonNeil Stevenson
1,517410
1,517410
I should have mentioned those nodes are in different clusters(groups), but running same JVM. I will have several instances of app, and two clusters. The reason I need two clusters is - one cluster will be used for distributed cache(both service and second level), another - for distributed session only. The reason I am doing so is that for nodes in first cluster I will be using Kryo(SubZero), and I have faced issue running Kryo with distributed session. So as a workaround i was going to create separate cluster for session. For that purpose I need to tell SpringSession to use particular node.
– Oleg Kuts
Mar 20 at 16:24
I described my issue with Kryo and Spring Session here stackoverflow.com/questions/55262028/…
– Oleg Kuts
Mar 20 at 16:24
add a comment |
I should have mentioned those nodes are in different clusters(groups), but running same JVM. I will have several instances of app, and two clusters. The reason I need two clusters is - one cluster will be used for distributed cache(both service and second level), another - for distributed session only. The reason I am doing so is that for nodes in first cluster I will be using Kryo(SubZero), and I have faced issue running Kryo with distributed session. So as a workaround i was going to create separate cluster for session. For that purpose I need to tell SpringSession to use particular node.
– Oleg Kuts
Mar 20 at 16:24
I described my issue with Kryo and Spring Session here stackoverflow.com/questions/55262028/…
– Oleg Kuts
Mar 20 at 16:24
I should have mentioned those nodes are in different clusters(groups), but running same JVM. I will have several instances of app, and two clusters. The reason I need two clusters is - one cluster will be used for distributed cache(both service and second level), another - for distributed session only. The reason I am doing so is that for nodes in first cluster I will be using Kryo(SubZero), and I have faced issue running Kryo with distributed session. So as a workaround i was going to create separate cluster for session. For that purpose I need to tell SpringSession to use particular node.
– Oleg Kuts
Mar 20 at 16:24
I should have mentioned those nodes are in different clusters(groups), but running same JVM. I will have several instances of app, and two clusters. The reason I need two clusters is - one cluster will be used for distributed cache(both service and second level), another - for distributed session only. The reason I am doing so is that for nodes in first cluster I will be using Kryo(SubZero), and I have faced issue running Kryo with distributed session. So as a workaround i was going to create separate cluster for session. For that purpose I need to tell SpringSession to use particular node.
– Oleg Kuts
Mar 20 at 16:24
I described my issue with Kryo and Spring Session here stackoverflow.com/questions/55262028/…
– Oleg Kuts
Mar 20 at 16:24
I described my issue with Kryo and Spring Session here stackoverflow.com/questions/55262028/…
– Oleg Kuts
Mar 20 at 16:24
add a comment |
Next code let me to configure Spring Session to use particular node, instead of default one. Only question I have is how to configure session time to live. hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600)
sets only max inactive time, not time to live.
@Configuration
@EnableSpringHttpSession
public class HazelcastSessionConfig
@Bean//default
public HazelcastInstance hazelcastInstance()
Config config = new Config();
config.setInstanceName("cache-node");
config.getGroupConfig().setName("cluster-1");
return Hazelcast.newHazelcastInstance(config);
@Bean//Node I need to use
public HazelcastInstance hazelcastSessionInstance()
Config config = new Config();
config.setInstanceName("session-node");
config.getGroupConfig().setName("cluster-2");
MapAttributeConfig attributeConfig = new MapAttributeConfig()
.setName(HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
.setExtractor(PrincipalNameExtractor.class.getName());
final MapConfig mapConfig = config.getMapConfig(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME);
mapConfig
.addMapAttributeConfig(attributeConfig)
.addMapIndexConfig(new MapIndexConfig(
HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));
return Hazelcast.newHazelcastInstance(config);
@Bean//Pass node here
public HazelcastSessionRepository sessionRepository(HazelcastInstance hazelcastSessionInstance)
final HazelcastSessionRepository hazelcastSessionRepository = new HazelcastSessionRepository(hazelcastSessionInstance);
hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600);
return hazelcastSessionRepository;
add a comment |
Next code let me to configure Spring Session to use particular node, instead of default one. Only question I have is how to configure session time to live. hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600)
sets only max inactive time, not time to live.
@Configuration
@EnableSpringHttpSession
public class HazelcastSessionConfig
@Bean//default
public HazelcastInstance hazelcastInstance()
Config config = new Config();
config.setInstanceName("cache-node");
config.getGroupConfig().setName("cluster-1");
return Hazelcast.newHazelcastInstance(config);
@Bean//Node I need to use
public HazelcastInstance hazelcastSessionInstance()
Config config = new Config();
config.setInstanceName("session-node");
config.getGroupConfig().setName("cluster-2");
MapAttributeConfig attributeConfig = new MapAttributeConfig()
.setName(HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
.setExtractor(PrincipalNameExtractor.class.getName());
final MapConfig mapConfig = config.getMapConfig(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME);
mapConfig
.addMapAttributeConfig(attributeConfig)
.addMapIndexConfig(new MapIndexConfig(
HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));
return Hazelcast.newHazelcastInstance(config);
@Bean//Pass node here
public HazelcastSessionRepository sessionRepository(HazelcastInstance hazelcastSessionInstance)
final HazelcastSessionRepository hazelcastSessionRepository = new HazelcastSessionRepository(hazelcastSessionInstance);
hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600);
return hazelcastSessionRepository;
add a comment |
Next code let me to configure Spring Session to use particular node, instead of default one. Only question I have is how to configure session time to live. hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600)
sets only max inactive time, not time to live.
@Configuration
@EnableSpringHttpSession
public class HazelcastSessionConfig
@Bean//default
public HazelcastInstance hazelcastInstance()
Config config = new Config();
config.setInstanceName("cache-node");
config.getGroupConfig().setName("cluster-1");
return Hazelcast.newHazelcastInstance(config);
@Bean//Node I need to use
public HazelcastInstance hazelcastSessionInstance()
Config config = new Config();
config.setInstanceName("session-node");
config.getGroupConfig().setName("cluster-2");
MapAttributeConfig attributeConfig = new MapAttributeConfig()
.setName(HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
.setExtractor(PrincipalNameExtractor.class.getName());
final MapConfig mapConfig = config.getMapConfig(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME);
mapConfig
.addMapAttributeConfig(attributeConfig)
.addMapIndexConfig(new MapIndexConfig(
HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));
return Hazelcast.newHazelcastInstance(config);
@Bean//Pass node here
public HazelcastSessionRepository sessionRepository(HazelcastInstance hazelcastSessionInstance)
final HazelcastSessionRepository hazelcastSessionRepository = new HazelcastSessionRepository(hazelcastSessionInstance);
hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600);
return hazelcastSessionRepository;
Next code let me to configure Spring Session to use particular node, instead of default one. Only question I have is how to configure session time to live. hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600)
sets only max inactive time, not time to live.
@Configuration
@EnableSpringHttpSession
public class HazelcastSessionConfig
@Bean//default
public HazelcastInstance hazelcastInstance()
Config config = new Config();
config.setInstanceName("cache-node");
config.getGroupConfig().setName("cluster-1");
return Hazelcast.newHazelcastInstance(config);
@Bean//Node I need to use
public HazelcastInstance hazelcastSessionInstance()
Config config = new Config();
config.setInstanceName("session-node");
config.getGroupConfig().setName("cluster-2");
MapAttributeConfig attributeConfig = new MapAttributeConfig()
.setName(HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
.setExtractor(PrincipalNameExtractor.class.getName());
final MapConfig mapConfig = config.getMapConfig(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME);
mapConfig
.addMapAttributeConfig(attributeConfig)
.addMapIndexConfig(new MapIndexConfig(
HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));
return Hazelcast.newHazelcastInstance(config);
@Bean//Pass node here
public HazelcastSessionRepository sessionRepository(HazelcastInstance hazelcastSessionInstance)
final HazelcastSessionRepository hazelcastSessionRepository = new HazelcastSessionRepository(hazelcastSessionInstance);
hazelcastSessionRepository.setDefaultMaxInactiveInterval(3600);
return hazelcastSessionRepository;
edited Mar 21 at 16:03
answered Mar 21 at 15:57
Oleg KutsOleg Kuts
369721
369721
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55263815%2fhazelcast-spring-session-pass-node-instance%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown