You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ygou <yu...@gmail.com> on 2016/11/09 15:39:58 UTC

Is there a way to substitute the application scoped cache?

Hi, I'm trying to cluster Wicket web application. I'm using Wicket 6.x.

In terms of the page store, in our system, all servers now share the http
sessions, while the persistent store is still set to be disk files. (We
prefer not to put persistent store into the session, otherwise the session
size would be too big.)

Now about the application scoped cache (i.e., the second level cache), we
can control its size (via IStoreSettings.setInmemoryCacheSize()), and so we
would like to share it across all servers.

If I understand correctly, the application scoped cache
(SerializedPagesCache) is local and may not be able to be clustered. Is it
possible to re-implement it and inject the new implementation via
configuration, so that the second level cache can be clustered?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Is-there-a-way-to-substitute-the-application-scoped-cache-tp4676073.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Is there a way to substitute the application scoped cache?

Posted by Martin Sturm <ma...@comsysto.com>.
If you are using Spring you could also use SessionPageStore in combination
with Springs session project for distributed sessions:
http://projects.spring.io/spring-session/

But nevertheless if your intention is to at least disable sticky sessions
for your application, this won't work. See
https://ci.apache.org/projects/wicket/guide/7.x/guide/redirects.html

I have a small PoC on github that works with Spring Session via Redis and
without sticky sessions by storing buffered responses into session. But
actually you would loose the page access synchronization. Therefore you
would need to implement a custom PageAccessSynchronizer:
https://github.com/RoadRunner120485/wicket-redis-session-test

cheers,
Martin

Martin Grigorov <mg...@apache.org> schrieb am Do., 10. Nov. 2016 um
09:47 Uhr:

I think we have to put this information into the guide.
There are several impls of IDataStore which could be used depending on what
the application already uses or prefer to use:
https://github.com/wicketstuff/core/tree/master/datastores-paren
<https://github.com/wicketstuff/core/tree/master/datastores-parent>

Martin Grigorov


Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Nov 9, 2016 at 5:53 PM, ygou <yu...@gmail.com> wrote:

> Thanks Martin. That's very helpful and inspiring.
>
> That said, I now think, from web clustering's point of view, it might not
> be
> a bad idea to just cluster the page store (which is now in clustered
cache)
> and disable the application scoped cache. (See
> http://stackoverflow.com/questions/24991767/wicket-
> cluster-session-store-page-store-data-store)
> The maximum number of pages (the data store can hold) can be controlled.
It
> would meet our need.
>
> Thanks again.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Is-there-a-way-to-substitute-the-application-scoped-cache-
> tp4676073p4676075.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

-- 

Martin Sturm
Solution Architect



[image: comSysto] <http://comsysto.com>



comSysto GmbH
Tumblingerstr. 23
80337 München

Tel: +49 173 3847 302
Fax: +49 89 550 605 90

http://comsysto.com/
http://comsysto.com/blog
[image: Facebook] <http://www.facebook.com/comSysto> [image: Twitter]
<http://twitter.com/comSysto> [image: Google+]
<https://plus.google.com/+Comsysto/videos> [image: Xing]
<https://www.xing.com/company/comsysto>

Proud partner of Atlassian, MongoDB and Oracle.
Dedicated host of Munich User Groups:
Spark & Hadoop User Group Munich
<http://www.meetup.com/Hadoop-User-Group-Munich/>
Lightweight Java User Group München
<http://www.meetup.com/Lightweight-Java-User-Group-Munchen/>
Cloud UG Munich <http://www.meetup.com/CloudUG-Munich/>

*Geschäftsführer: *
Daniel Bartl
Tomislav Zorc

*Handelsregister:*
Amtsgericht München
HRB 147101

*Wichtiger Hinweis:* Diese E-Mail und etwaige Anlagen enthalten
vertrauliche oder rechtlich geschützte Informationen. Wenn Sie nicht der
vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollten, so
beachten Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung,
Vervielfältigung oder Weitergabe des Inhalts dieser E-Mail unzulässig ist.
Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail in
Verbindung zu setzen.

*Important Note:* This e-mail and any attachment are confidential or
protected by law. Access to this email by anyone else is unauthorized. If
you are not the intended recipient, any form of disclosure, reproduction,
distribution or any action taken or refrained from in reliance on it, is
prohibited and may be unlawful. Please notify the sender immediately.

Re: Is there a way to substitute the application scoped cache?

Posted by Martin Grigorov <mg...@apache.org>.
I think we have to put this information into the guide.
There are several impls of IDataStore which could be used depending on what
the application already uses or prefer to use:
https://github.com/wicketstuff/core/tree/master/datastores-parent

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Nov 9, 2016 at 5:53 PM, ygou <yu...@gmail.com> wrote:

> Thanks Martin. That's very helpful and inspiring.
>
> That said, I now think, from web clustering's point of view, it might not
> be
> a bad idea to just cluster the page store (which is now in clustered cache)
> and disable the application scoped cache. (See
> http://stackoverflow.com/questions/24991767/wicket-
> cluster-session-store-page-store-data-store)
> The maximum number of pages (the data store can hold) can be controlled. It
> would meet our need.
>
> Thanks again.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Is-there-a-way-to-substitute-the-application-scoped-cache-
> tp4676073p4676075.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Is there a way to substitute the application scoped cache?

Posted by Martin Grigorov <mg...@apache.org>.
I think we have to put this information into the guide.
There are several impls of IDataStore which could be used depending on what
the application already uses or prefer to use:
https://github.com/wicketstuff/core/tree/master/datastores-parent

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Nov 9, 2016 at 5:53 PM, ygou <yu...@gmail.com> wrote:

> Thanks Martin. That's very helpful and inspiring.
>
> That said, I now think, from web clustering's point of view, it might not
> be
> a bad idea to just cluster the page store (which is now in clustered cache)
> and disable the application scoped cache. (See
> http://stackoverflow.com/questions/24991767/wicket-
> cluster-session-store-page-store-data-store)
> The maximum number of pages (the data store can hold) can be controlled. It
> would meet our need.
>
> Thanks again.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Is-there-a-way-to-substitute-the-application-scoped-cache-
> tp4676073p4676075.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Is there a way to substitute the application scoped cache?

Posted by ygou <yu...@gmail.com>.
Thanks Martin. That's very helpful and inspiring.

That said, I now think, from web clustering's point of view, it might not be
a bad idea to just cluster the page store (which is now in clustered cache)
and disable the application scoped cache. (See
http://stackoverflow.com/questions/24991767/wicket-cluster-session-store-page-store-data-store) 
The maximum number of pages (the data store can hold) can be controlled. It
would meet our need.

Thanks again.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Is-there-a-way-to-substitute-the-application-scoped-cache-tp4676073p4676075.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Is there a way to substitute the application scoped cache?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

You can create your own IPageManagerProvider that extends from
DefaultPageManagerProvider and overrides its #getPageStore() method [1]
Then set it in YourApp#init(), like at [2]

1.
https://github.com/apache/wicket/blob/936adf7c1658de32cabddfd6acc4994bb3f5ea45/wicket-core/src/main/java/org/apache/wicket/DefaultPageManagerProvider.java#L71
2.
https://github.com/apache/wicket/blob/936adf7c1658de32cabddfd6acc4994bb3f5ea45/wicket-core/src/main/java/org/apache/wicket/Application.java#L662

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Nov 9, 2016 at 4:39 PM, ygou <yu...@gmail.com> wrote:

> Hi, I'm trying to cluster Wicket web application. I'm using Wicket 6.x.
>
> In terms of the page store, in our system, all servers now share the http
> sessions, while the persistent store is still set to be disk files. (We
> prefer not to put persistent store into the session, otherwise the session
> size would be too big.)
>
> Now about the application scoped cache (i.e., the second level cache), we
> can control its size (via IStoreSettings.setInmemoryCacheSize()), and so
> we
> would like to share it across all servers.
>
> If I understand correctly, the application scoped cache
> (SerializedPagesCache) is local and may not be able to be clustered. Is it
> possible to re-implement it and inject the new implementation via
> configuration, so that the second level cache can be clustered?
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Is-there-a-way-to-substitute-the-application-
> scoped-cache-tp4676073.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>