You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by bismy <bi...@qq.com> on 2018/07/26 09:58:05 UTC

回复: Spring Session Support in Java Chassis

Java Chassis now do not provide a easy session management but do give a suggestion to manage it at edge service[1].


If we need to think about Spring Session, we should think about how to use Session API like HttpSession. But java chassis is not a J2EE implementation. 


Do we implement a Spring Session like mechanism?
  
[1]https://huaweicse.github.io/cse-java-chassis-doc/featured-topics/develope-microservice-using-ces/jin-xing-ren-zheng-he-jian-quan-she-ji.html


------------------ 原始邮件 ------------------
发件人: "willem.jiang"<wi...@gmail.com>;
发送时间: 2018年7月26日(星期四) 下午5:43
收件人: "dev"<de...@servicecomb.apache.org>;

主题: Re: Spring Session Support in Java Chassis



After went through the code, it looks like the PR[1] was not merged into
master branch.

[1]https://github.com/vert-x3/vertx-web/pull/950



Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Jul 26, 2018 at 4:35 PM, wjm wjm <zz...@gmail.com> wrote:

> by ClusteredSessionStore, vertx can also do this
> but currently, there is no a official IMPL:
> https://github.com/vert-x3/vertx-web/issues/890
>
> 2018-07-26 15:31 GMT+08:00 Willem Jiang <wi...@gmail.com>:
>
> > Hi team,
> >
> > Today I had a quick talk with the custom who is quite interested about
> take
> > the session out from the single server to the redis cluster with the help
> > of Spring session.  In this way they can build the stateless services
> > without changing any application code.
> >
> > I just checked the Spring Session document, it looks like we need to
> setup
> > a filter to replace the HTTPSession from the container.
> >
> > Now I have a quick question about  how can we integrate Spring Session
> with
> > Java-Chassis?
> > If vertx support servlet filter, we just need to do some configuration,
> > but what if vertx doesn't support servlet filter API.
> >
> > Any throught?
> >
> > Willem Jiang
> >
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
>

Re: Spring Session Support in Java Chassis

Posted by wjm wjm <zz...@gmail.com>.
https://docs.spring.io/spring/docs/5.0.0.BUILD-SNAPSHOT/spring-framework-reference/html/web-reactive.html

springboot2 not bind to servlet anymore, if developers use servlet api,
then can only select servlet stack
if want to work both with servlet and reactive stack, must use wrapped
classes

so i think developers can not use javax.servlet.http.HttpSession directly

2018-07-28 8:53 GMT+08:00 Willem Jiang <wi...@gmail.com>:

> I just google the Spring boot2 Spring Session and find out this[1].
>
> Spring Security and Spring Session filters are configured for ASYNC, ERROR,
> and REQUEST dispatcher types.
>
> From the description, I can assume that Spring Boot2 still support the
> Servlet API even the internal code could be changed.
>
> [1]
> https://github.com/spring-projects/spring-boot/wiki/
> Spring-Boot-2.0-Migration-Guide#servlet-filters
>
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Fri, Jul 27, 2018 at 8:52 AM, wjm wjm <zz...@gmail.com> wrote:
>
> > infact, in springboot2 reactive stack, it's also not compatible:
> >
> >    - can not use servlet request and response, must switch to new class
> >    - can not use selvlet filters
> >
> >       all mechanism about servlet
> >
> > we are similar, if customer want to use servlet stack, then use them as
> > before, but if DO NOT want to bind to servlet, than must follow the new
> > rule.
> >
> > ----------------------
> > @Override public Mono<Void> filter(ServerWebExchange exchange,
> > WebFilterChain chain) {
> >   Mono<?> principal = this.includes.contains(Include.PRINCIPAL) ?
> > exchange.getPrincipal().cast(Object.class).defaultIfEmpty(NONE) :
> > Mono.just(NONE);
> >   Mono<?> session = this.includes.contains(Include.SESSION_ID) ?
> > exchange.getSession() : Mono.just(NONE);
> >
> >
> > 2018-07-26 22:21 GMT+08:00 Willem Jiang <wi...@gmail.com>:
> >
> > > For the normal user, they just want to use the session information as
> > they
> > > use in the web container.
> > > It could be great if we can still support spring session out of box.
> > >
> > >
> > > Willem Jiang
> > >
> > > Twitter: willemjiang
> > > Weibo: 姜宁willem
> > >
> > > On Thu, Jul 26, 2018 at 10:03 PM, wjm wjm <zz...@gmail.com> wrote:
> > >
> > > > java chassis invocation context is easier than session
> > > > but in edge, if we provide a distributed session, that can make
> manage
> > > > session easier.
> > > >
> > > > 2018-07-26 17:58 GMT+08:00 bismy <bi...@qq.com>:
> > > >
> > > > > Java Chassis now do not provide a easy session management but do
> > give a
> > > > > suggestion to manage it at edge service[1].
> > > > >
> > > > >
> > > > > If we need to think about Spring Session, we should think about how
> > to
> > > > use
> > > > > Session API like HttpSession. But java chassis is not a J2EE
> > > > > implementation.
> > > > >
> > > > >
> > > > > Do we implement a Spring Session like mechanism?
> > > > >
> > > > > [1]https://huaweicse.github.io/cse-java-chassis-doc/
> > > > > featured-topics/develope-microservice-using-ces/jin-
> > > > > xing-ren-zheng-he-jian-quan-she-ji.html
> > > > >
> > > > >
> > > > > ------------------ 原始邮件 ------------------
> > > > > 发件人: "willem.jiang"<wi...@gmail.com>;
> > > > > 发送时间: 2018年7月26日(星期四) 下午5:43
> > > > > 收件人: "dev"<de...@servicecomb.apache.org>;
> > > > >
> > > > > 主题: Re: Spring Session Support in Java Chassis
> > > > >
> > > > >
> > > > >
> > > > > After went through the code, it looks like the PR[1] was not merged
> > > into
> > > > > master branch.
> > > > >
> > > > > [1]https://github.com/vert-x3/vertx-web/pull/950
> > > > >
> > > > >
> > > > >
> > > > > Willem Jiang
> > > > >
> > > > > Twitter: willemjiang
> > > > > Weibo: 姜宁willem
> > > > >
> > > > > On Thu, Jul 26, 2018 at 4:35 PM, wjm wjm <zz...@gmail.com> wrote:
> > > > >
> > > > > > by ClusteredSessionStore, vertx can also do this
> > > > > > but currently, there is no a official IMPL:
> > > > > > https://github.com/vert-x3/vertx-web/issues/890
> > > > > >
> > > > > > 2018-07-26 15:31 GMT+08:00 Willem Jiang <willem.jiang@gmail.com
> >:
> > > > > >
> > > > > > > Hi team,
> > > > > > >
> > > > > > > Today I had a quick talk with the custom who is quite
> interested
> > > > about
> > > > > > take
> > > > > > > the session out from the single server to the redis cluster
> with
> > > the
> > > > > help
> > > > > > > of Spring session.  In this way they can build the stateless
> > > services
> > > > > > > without changing any application code.
> > > > > > >
> > > > > > > I just checked the Spring Session document, it looks like we
> need
> > > to
> > > > > > setup
> > > > > > > a filter to replace the HTTPSession from the container.
> > > > > > >
> > > > > > > Now I have a quick question about  how can we integrate Spring
> > > > Session
> > > > > > with
> > > > > > > Java-Chassis?
> > > > > > > If vertx support servlet filter, we just need to do some
> > > > configuration,
> > > > > > > but what if vertx doesn't support servlet filter API.
> > > > > > >
> > > > > > > Any throught?
> > > > > > >
> > > > > > > Willem Jiang
> > > > > > >
> > > > > > > Twitter: willemjiang
> > > > > > > Weibo: 姜宁willem
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Spring Session Support in Java Chassis

Posted by Willem Jiang <wi...@gmail.com>.
I just google the Spring boot2 Spring Session and find out this[1].

Spring Security and Spring Session filters are configured for ASYNC, ERROR,
and REQUEST dispatcher types.

From the description, I can assume that Spring Boot2 still support the
Servlet API even the internal code could be changed.

[1]
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide#servlet-filters


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Jul 27, 2018 at 8:52 AM, wjm wjm <zz...@gmail.com> wrote:

> infact, in springboot2 reactive stack, it's also not compatible:
>
>    - can not use servlet request and response, must switch to new class
>    - can not use selvlet filters
>
>       all mechanism about servlet
>
> we are similar, if customer want to use servlet stack, then use them as
> before, but if DO NOT want to bind to servlet, than must follow the new
> rule.
>
> ----------------------
> @Override public Mono<Void> filter(ServerWebExchange exchange,
> WebFilterChain chain) {
>   Mono<?> principal = this.includes.contains(Include.PRINCIPAL) ?
> exchange.getPrincipal().cast(Object.class).defaultIfEmpty(NONE) :
> Mono.just(NONE);
>   Mono<?> session = this.includes.contains(Include.SESSION_ID) ?
> exchange.getSession() : Mono.just(NONE);
>
>
> 2018-07-26 22:21 GMT+08:00 Willem Jiang <wi...@gmail.com>:
>
> > For the normal user, they just want to use the session information as
> they
> > use in the web container.
> > It could be great if we can still support spring session out of box.
> >
> >
> > Willem Jiang
> >
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> > On Thu, Jul 26, 2018 at 10:03 PM, wjm wjm <zz...@gmail.com> wrote:
> >
> > > java chassis invocation context is easier than session
> > > but in edge, if we provide a distributed session, that can make manage
> > > session easier.
> > >
> > > 2018-07-26 17:58 GMT+08:00 bismy <bi...@qq.com>:
> > >
> > > > Java Chassis now do not provide a easy session management but do
> give a
> > > > suggestion to manage it at edge service[1].
> > > >
> > > >
> > > > If we need to think about Spring Session, we should think about how
> to
> > > use
> > > > Session API like HttpSession. But java chassis is not a J2EE
> > > > implementation.
> > > >
> > > >
> > > > Do we implement a Spring Session like mechanism?
> > > >
> > > > [1]https://huaweicse.github.io/cse-java-chassis-doc/
> > > > featured-topics/develope-microservice-using-ces/jin-
> > > > xing-ren-zheng-he-jian-quan-she-ji.html
> > > >
> > > >
> > > > ------------------ 原始邮件 ------------------
> > > > 发件人: "willem.jiang"<wi...@gmail.com>;
> > > > 发送时间: 2018年7月26日(星期四) 下午5:43
> > > > 收件人: "dev"<de...@servicecomb.apache.org>;
> > > >
> > > > 主题: Re: Spring Session Support in Java Chassis
> > > >
> > > >
> > > >
> > > > After went through the code, it looks like the PR[1] was not merged
> > into
> > > > master branch.
> > > >
> > > > [1]https://github.com/vert-x3/vertx-web/pull/950
> > > >
> > > >
> > > >
> > > > Willem Jiang
> > > >
> > > > Twitter: willemjiang
> > > > Weibo: 姜宁willem
> > > >
> > > > On Thu, Jul 26, 2018 at 4:35 PM, wjm wjm <zz...@gmail.com> wrote:
> > > >
> > > > > by ClusteredSessionStore, vertx can also do this
> > > > > but currently, there is no a official IMPL:
> > > > > https://github.com/vert-x3/vertx-web/issues/890
> > > > >
> > > > > 2018-07-26 15:31 GMT+08:00 Willem Jiang <wi...@gmail.com>:
> > > > >
> > > > > > Hi team,
> > > > > >
> > > > > > Today I had a quick talk with the custom who is quite interested
> > > about
> > > > > take
> > > > > > the session out from the single server to the redis cluster with
> > the
> > > > help
> > > > > > of Spring session.  In this way they can build the stateless
> > services
> > > > > > without changing any application code.
> > > > > >
> > > > > > I just checked the Spring Session document, it looks like we need
> > to
> > > > > setup
> > > > > > a filter to replace the HTTPSession from the container.
> > > > > >
> > > > > > Now I have a quick question about  how can we integrate Spring
> > > Session
> > > > > with
> > > > > > Java-Chassis?
> > > > > > If vertx support servlet filter, we just need to do some
> > > configuration,
> > > > > > but what if vertx doesn't support servlet filter API.
> > > > > >
> > > > > > Any throught?
> > > > > >
> > > > > > Willem Jiang
> > > > > >
> > > > > > Twitter: willemjiang
> > > > > > Weibo: 姜宁willem
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Spring Session Support in Java Chassis

Posted by wjm wjm <zz...@gmail.com>.
infact, in springboot2 reactive stack, it's also not compatible:

   - can not use servlet request and response, must switch to new class
   - can not use selvlet filters

      all mechanism about servlet

we are similar, if customer want to use servlet stack, then use them as
before, but if DO NOT want to bind to servlet, than must follow the new
rule.

----------------------
@Override public Mono<Void> filter(ServerWebExchange exchange,
WebFilterChain chain) {
  Mono<?> principal = this.includes.contains(Include.PRINCIPAL) ?
exchange.getPrincipal().cast(Object.class).defaultIfEmpty(NONE) :
Mono.just(NONE);
  Mono<?> session = this.includes.contains(Include.SESSION_ID) ?
exchange.getSession() : Mono.just(NONE);


2018-07-26 22:21 GMT+08:00 Willem Jiang <wi...@gmail.com>:

> For the normal user, they just want to use the session information as they
> use in the web container.
> It could be great if we can still support spring session out of box.
>
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Thu, Jul 26, 2018 at 10:03 PM, wjm wjm <zz...@gmail.com> wrote:
>
> > java chassis invocation context is easier than session
> > but in edge, if we provide a distributed session, that can make manage
> > session easier.
> >
> > 2018-07-26 17:58 GMT+08:00 bismy <bi...@qq.com>:
> >
> > > Java Chassis now do not provide a easy session management but do give a
> > > suggestion to manage it at edge service[1].
> > >
> > >
> > > If we need to think about Spring Session, we should think about how to
> > use
> > > Session API like HttpSession. But java chassis is not a J2EE
> > > implementation.
> > >
> > >
> > > Do we implement a Spring Session like mechanism?
> > >
> > > [1]https://huaweicse.github.io/cse-java-chassis-doc/
> > > featured-topics/develope-microservice-using-ces/jin-
> > > xing-ren-zheng-he-jian-quan-she-ji.html
> > >
> > >
> > > ------------------ 原始邮件 ------------------
> > > 发件人: "willem.jiang"<wi...@gmail.com>;
> > > 发送时间: 2018年7月26日(星期四) 下午5:43
> > > 收件人: "dev"<de...@servicecomb.apache.org>;
> > >
> > > 主题: Re: Spring Session Support in Java Chassis
> > >
> > >
> > >
> > > After went through the code, it looks like the PR[1] was not merged
> into
> > > master branch.
> > >
> > > [1]https://github.com/vert-x3/vertx-web/pull/950
> > >
> > >
> > >
> > > Willem Jiang
> > >
> > > Twitter: willemjiang
> > > Weibo: 姜宁willem
> > >
> > > On Thu, Jul 26, 2018 at 4:35 PM, wjm wjm <zz...@gmail.com> wrote:
> > >
> > > > by ClusteredSessionStore, vertx can also do this
> > > > but currently, there is no a official IMPL:
> > > > https://github.com/vert-x3/vertx-web/issues/890
> > > >
> > > > 2018-07-26 15:31 GMT+08:00 Willem Jiang <wi...@gmail.com>:
> > > >
> > > > > Hi team,
> > > > >
> > > > > Today I had a quick talk with the custom who is quite interested
> > about
> > > > take
> > > > > the session out from the single server to the redis cluster with
> the
> > > help
> > > > > of Spring session.  In this way they can build the stateless
> services
> > > > > without changing any application code.
> > > > >
> > > > > I just checked the Spring Session document, it looks like we need
> to
> > > > setup
> > > > > a filter to replace the HTTPSession from the container.
> > > > >
> > > > > Now I have a quick question about  how can we integrate Spring
> > Session
> > > > with
> > > > > Java-Chassis?
> > > > > If vertx support servlet filter, we just need to do some
> > configuration,
> > > > > but what if vertx doesn't support servlet filter API.
> > > > >
> > > > > Any throught?
> > > > >
> > > > > Willem Jiang
> > > > >
> > > > > Twitter: willemjiang
> > > > > Weibo: 姜宁willem
> > > > >
> > > >
> > >
> >
>

Re: Spring Session Support in Java Chassis

Posted by Willem Jiang <wi...@gmail.com>.
For the normal user, they just want to use the session information as they
use in the web container.
It could be great if we can still support spring session out of box.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Jul 26, 2018 at 10:03 PM, wjm wjm <zz...@gmail.com> wrote:

> java chassis invocation context is easier than session
> but in edge, if we provide a distributed session, that can make manage
> session easier.
>
> 2018-07-26 17:58 GMT+08:00 bismy <bi...@qq.com>:
>
> > Java Chassis now do not provide a easy session management but do give a
> > suggestion to manage it at edge service[1].
> >
> >
> > If we need to think about Spring Session, we should think about how to
> use
> > Session API like HttpSession. But java chassis is not a J2EE
> > implementation.
> >
> >
> > Do we implement a Spring Session like mechanism?
> >
> > [1]https://huaweicse.github.io/cse-java-chassis-doc/
> > featured-topics/develope-microservice-using-ces/jin-
> > xing-ren-zheng-he-jian-quan-she-ji.html
> >
> >
> > ------------------ 原始邮件 ------------------
> > 发件人: "willem.jiang"<wi...@gmail.com>;
> > 发送时间: 2018年7月26日(星期四) 下午5:43
> > 收件人: "dev"<de...@servicecomb.apache.org>;
> >
> > 主题: Re: Spring Session Support in Java Chassis
> >
> >
> >
> > After went through the code, it looks like the PR[1] was not merged into
> > master branch.
> >
> > [1]https://github.com/vert-x3/vertx-web/pull/950
> >
> >
> >
> > Willem Jiang
> >
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> > On Thu, Jul 26, 2018 at 4:35 PM, wjm wjm <zz...@gmail.com> wrote:
> >
> > > by ClusteredSessionStore, vertx can also do this
> > > but currently, there is no a official IMPL:
> > > https://github.com/vert-x3/vertx-web/issues/890
> > >
> > > 2018-07-26 15:31 GMT+08:00 Willem Jiang <wi...@gmail.com>:
> > >
> > > > Hi team,
> > > >
> > > > Today I had a quick talk with the custom who is quite interested
> about
> > > take
> > > > the session out from the single server to the redis cluster with the
> > help
> > > > of Spring session.  In this way they can build the stateless services
> > > > without changing any application code.
> > > >
> > > > I just checked the Spring Session document, it looks like we need to
> > > setup
> > > > a filter to replace the HTTPSession from the container.
> > > >
> > > > Now I have a quick question about  how can we integrate Spring
> Session
> > > with
> > > > Java-Chassis?
> > > > If vertx support servlet filter, we just need to do some
> configuration,
> > > > but what if vertx doesn't support servlet filter API.
> > > >
> > > > Any throught?
> > > >
> > > > Willem Jiang
> > > >
> > > > Twitter: willemjiang
> > > > Weibo: 姜宁willem
> > > >
> > >
> >
>

Re: Spring Session Support in Java Chassis

Posted by wjm wjm <zz...@gmail.com>.
java chassis invocation context is easier than session
but in edge, if we provide a distributed session, that can make manage
session easier.

2018-07-26 17:58 GMT+08:00 bismy <bi...@qq.com>:

> Java Chassis now do not provide a easy session management but do give a
> suggestion to manage it at edge service[1].
>
>
> If we need to think about Spring Session, we should think about how to use
> Session API like HttpSession. But java chassis is not a J2EE
> implementation.
>
>
> Do we implement a Spring Session like mechanism?
>
> [1]https://huaweicse.github.io/cse-java-chassis-doc/
> featured-topics/develope-microservice-using-ces/jin-
> xing-ren-zheng-he-jian-quan-she-ji.html
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "willem.jiang"<wi...@gmail.com>;
> 发送时间: 2018年7月26日(星期四) 下午5:43
> 收件人: "dev"<de...@servicecomb.apache.org>;
>
> 主题: Re: Spring Session Support in Java Chassis
>
>
>
> After went through the code, it looks like the PR[1] was not merged into
> master branch.
>
> [1]https://github.com/vert-x3/vertx-web/pull/950
>
>
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Thu, Jul 26, 2018 at 4:35 PM, wjm wjm <zz...@gmail.com> wrote:
>
> > by ClusteredSessionStore, vertx can also do this
> > but currently, there is no a official IMPL:
> > https://github.com/vert-x3/vertx-web/issues/890
> >
> > 2018-07-26 15:31 GMT+08:00 Willem Jiang <wi...@gmail.com>:
> >
> > > Hi team,
> > >
> > > Today I had a quick talk with the custom who is quite interested about
> > take
> > > the session out from the single server to the redis cluster with the
> help
> > > of Spring session.  In this way they can build the stateless services
> > > without changing any application code.
> > >
> > > I just checked the Spring Session document, it looks like we need to
> > setup
> > > a filter to replace the HTTPSession from the container.
> > >
> > > Now I have a quick question about  how can we integrate Spring Session
> > with
> > > Java-Chassis?
> > > If vertx support servlet filter, we just need to do some configuration,
> > > but what if vertx doesn't support servlet filter API.
> > >
> > > Any throught?
> > >
> > > Willem Jiang
> > >
> > > Twitter: willemjiang
> > > Weibo: 姜宁willem
> > >
> >
>