spring-guides / gs-gateway Goto Github PK
View Code? Open in Web Editor NEWBuilding a Gateway :: Learn how to configure a gateway
Home Page: https://spring.io/guides/gs/gateway
License: Apache License 2.0
Building a Gateway :: Learn how to configure a gateway
Home Page: https://spring.io/guides/gs/gateway
License: Apache License 2.0
Netty server dont support set context-path:
Exmaple in: application.yml
server:
servlet:
context-path: /gtw
(I hope this is the right place to report about this bug.)
When I open guide https://spring.io/guides/gs/gateway/ and try to unfold "Build with Gradle" or other sections, they don't show up. In fact, I can't read them at this moment. Reproducible on Safari 14.0.3 and Firefox 91.0.2
Update the guide to use the most recent Spring Boot version.
Files that require changes are:
initial/build.gradle
initial/pom.xml
complete/build.gradle
complete/pom.xml
i'm trying to use Hystrix,
but when i visit "http://localhost:8080/delay/3" ,i got a 404 error.
it seems like the "host: www.hystrix.com" setting no effect.
Has anyone encountered this situation?
Dear all @spring,
I'm running through the GS Gateway and have noticed what seems to be a small typo in the following snippet:
@Bean
public RouteLocator myRoutes(RouteLocatorBuilder builder) {
return builder.routes()
.route(p -> p
.path("/get")
.filters(f -> f.addRequestHeader("Hello", "World"))
.uri("http://httpbin.org:80"))
.build();
}
If you wish to modify the response header, then instead of
.filters(f -> f.addRequestHeader("Hello", "World"))
there should be
.filters(f -> f.addResponseHeader("Hello", "World"))
Response instead of Request.
When you set context app by:
application.yml:
spring:
webflux:
base-path: /gtw
And apply rule to RewritePath
filters:
- RewritePath=/gtw/ict/(?<segment>.*),/ict/$\{segment}
You will get bug with:
java.lang.IllegalArgumentException: Invalid contextPath '/gtw': must match the start of requestPath: '/ict/swagger-ui/index.html'
at org.springframework.http.server.DefaultRequestPath.validateContextPath(DefaultRequestPath.java:81)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
So you apply validation rules (DefaultRequestPath) on result path after apply RewritePath - that does not make sense. After apply base-path you cannot remove that path from result path (that is running in deferent context and path)
I'm unable to get the 'ApplicationTest' class to run successfully. I'm getting the following error message when I try to run it within Eclipse:
java.lang.NoClassDefFoundError: org/junit/platform/engine/TestEngine
at org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry.loadTestEngines(ServiceLoaderTestEngineRegistry.java:35)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:87)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:67)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.(JUnit5TestLoader.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:371)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:366)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:310)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:225)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.lang.ClassNotFoundException: org.junit.platform.engine.TestEngine
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/cloud/client/discovery/event/HeartbeatMonitor
Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.client.discovery.event.HeartbeatMonitor
use Greenwich.SR2 can start successfully
I am following this guide and when doing the curl command, i got this in response:
<title>Loading...</title><script type='text/javascript'>window.location.replace('http://httbin.org/get?js=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJKb2tlbiIsImV4cCI6MTYzMzYyMzkzMiwiaWF0IjoxNjMzNjE2NzMyLCJpc3MiOiJKb2tlbiIsImpzIjoxLCJqdGkiOiIycWxzYmdxN3Q1YTgwNGx1c3MwMnR0a2ciLCJuYmYiOjE2MzM2MTY3MzIsInRzIjoxNjMzNjE2NzMyMzY3NTc5fQ.ddhBr3IvtI8v1ItlI3nboJR0Ng0K2tu72U97Uboa0i8&sid=6dd0a6b8-277a-11ec-a668-5f460581a7c8');</script>%In the browser, it redirects me to shady sites. Is there something with httpbin, my machine or something else?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.