14

Is there any easy way in a Java EE application (running on Websphere) to share an object in an application-wide scope across the entire cluster? Something maybe similar to Servlet Context parameters, but that is shared across the cluster.

For example, in a cluster of servers "A" and "B", if a value is set on server A (key=value), that value should immediately (or nearly so) be available to requests on server B.

(Note: Would like to avoid distributed caching solutions if possible. This really isn't a caching scenario as the objects being stored are fairly dynamic)

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
WayneC
  • 2,530
  • 3
  • 31
  • 44
  • The scenario is more of a run-time (not deployment) problem. What I need is a "variable" I can set from code, and have that value be available to any server in the cluster which is running the same application. – WayneC Jan 05 '12 at 16:01
  • Sorry, I can't give you an out-of-the-box solution, but: I have successfully used Hazelcast across a JBoss (WildFly) cluter to implement a cluster-wide singleton (such as a counter). Other IT teams I know of used Infinispan. -- Pseudocode example: https://imgur.com/fF3OlIM – java.is.for.desktop Feb 24 '19 at 11:27

2 Answers2

3

I'm watching this to see if any simple solutions appear, but I don't know of any myself. Last time I asked something like this, the answer was to use a distributed object store.

Our substitute was manual notification over HTTP to a configured list of URLs, one for each Web Container's direct server:port combination. (That is, bypassing any fronting proxy/web server/plugin.)

dbreaux
  • 4,982
  • 1
  • 25
  • 64
1

Try using the WebSphere workarea

  • Could you explain how to use it or how that feature will enable the asker to resolve her or his issue? – ig0774 Oct 20 '12 at 21:53