1717
1818import org .slf4j .Logger ;
1919import org .slf4j .LoggerFactory ;
20-
21- import org .springframework .cloud .gateway .filter .factory .WebFilterFactory ;
20+ import org . springframework . cloud . gateway . filter . GatewayFilter ;
21+ import org .springframework .cloud .gateway .filter .factory .GatewayFilterFactory ;
2222import org .springframework .context .annotation .Bean ;
2323import org .springframework .context .annotation .Configuration ;
2424import org .springframework .tuple .Tuple ;
25- import org .springframework .web .server .WebFilter ;
2625import org .springframework .web .server .WebSession ;
2726
2827/**
@@ -38,10 +37,10 @@ public class GatewayConfig {
3837 /**
3938 * Force the current WebSession to get saved
4039 */
41- static class SaveSessionWebFilterFactory
42- implements WebFilterFactory {
40+ static class SaveSessionGatewayFilterFactory
41+ implements GatewayFilterFactory {
4342 @ Override
44- public WebFilter apply (Tuple args ) {
43+ public GatewayFilter apply (Tuple args ) {
4544 return (exchange , chain ) -> exchange .getSession ()
4645 .map (webSession -> {
4746 log .debug ("Session id: " + webSession .getId ());
@@ -57,8 +56,8 @@ public WebFilter apply(Tuple args) {
5756 }
5857
5958 @ Bean
60- SaveSessionWebFilterFactory saveSessionWebFilterFactory () {
61- return new SaveSessionWebFilterFactory ();
59+ SaveSessionGatewayFilterFactory saveSessionWebFilterFactory () {
60+ return new SaveSessionGatewayFilterFactory ();
6261 }
6362}
6463// end::code[]
0 commit comments