Could anyone describe what is difference between openfeign/feign and spring cloud openfeign? I see spring cloud openfeign depends on openfeign/feign, but I couldn't get specific differences.
Is it always recommendable to use spring cloud openfeign rather than vanilla feign when I use spring framework?
https://github.com/OpenFeign/feign
https://github.com/spring-cloud/spring-cloud-openfeign
OpenFeign/feign is a complete http client binder solution which can use multiple different libraries
Spring Cloud Openfeign
provides OpenFeign integrations for Spring Boot apps through
autoconfiguration and binding to the Spring Environment and other
Spring programming model idioms.
"Spring Cloud Openfeign" is only for spring, "OpenFeign" can work without spring environment.
Conclusion, if you are using spring go with "Spring Cloud Openfeign"
PS:https://youtu.be/3NcmlrumSOc this video explains with all details.
Related
How to enable CORS in spring cloud dataflow to make it api accessible from external web app like angular?
Cross Origin Resource Sharing is not supported out of the box in SCDF.
But, Spring Cloud Data Flow server application is a Spring Boot app and can be customized and extended.
You could add global CORS configuration to SCDF custom application. For information on how to do this, you can refer to Spring Boot documentation.
You can also check the sample here on how to customize SCDF server application.
Our services are currently using spring cloud netflix zuul as our gateway.
Now we have to support websocket so we need to migrate zuul 1 to zuul 2 or spring cloud gateway.
I know spring cloud team is no more supporting zuul as they have their own spring cloud gateway.
I briefly looked into zuul 2.0 and I got to know that we should change filter things first
and there is no more #EnableZuulProxy. (How about Routes configration in application.yml?)
So My question is, is there an reference or simple document to migrate zuul 1.0 to 2.0?
Or we have to rebuild our gateway application?
Any help would be appreciated!
I am looking into this right now myself, probably going to migrate to Spring Cloud Gateway as we're using Spring a lot already. One major thing to watch out for is that both Spring Cloud Gateway and Zuul 2 are using a reactive programming model, with only a couple of threads handling all the requests, which means that if you have any custom code that calls http endpoints or other services, you will have to re-code those pieces in a reactive fashion, or else your threads will block and your gateway won't be able to handle more than a couple requests at a time.
You can read a bit about Spring Webflux (used in Spring Cloud Gateway instead of Spring MVC) and reactive programming here: https://docs.spring.io/spring-framework/docs/current/reference/html/web-reactive.html
And no, I have not found a document that will guide you through a migration. In fact that's how I googled to this StackOverflow question...
I'm just prototyping the migration from Spring MVC to Spring WebFlux using the latest milestone releases (also Spring Boot, Spring Data, and Spring Security). Using the Maven module spring-security-webflux I was able to setup BASIC authentication. However, I didn't find how to define a realm. Any hint is appreciated.
I use Spring Cloud approach for building few microservices which supposed to interact with each other. For messaging between microservices I intended to use RabbitMQ and Spring AMQP, but after I looked at Spring Cloud Stream I feel lost. In my mind Spring Cloud Stream is next level of abstraction (probably too strong, but you should get overall impression) with many very useful features. So I wonder why would someone use Spring AMQP for new development? Could you please provide any Spring AMQP benefits over Spring Cloud Stream for pretty basic case when one microservice sends message to another microservice and receives reply?
Thanks.
Spring Cloud Stream provides an opinionated configuration model that connects to the external system (Binder, Consumer Group etc.,). This is mainly intended for Streaming applications where the applications are connected via pipeline. The applications that don't fit this opinionated model can be configured directly from Spring Integration (+ Spring AMQP).
For instance, Spring Cloud Stream doesn't provide direct support for request/reply scenarios for example. You can read this SO question and the github issue here
Spring session seems like a very interesting project but I have not been able to find much information on how to properly incorporate it in a spring security application. The readme on project github page has some information but I dont think thats applicable to spring security. Another example thats mentioned on the same page is to utilize this mechanism for REST access. Thats another use case that i think can benefit from an example. I would appreciate if some information on the subject can be shared. Thanks.
You can use Spring Session with Spring Security by simply ensuring to place the Spring Session Filter before Spring Security's filter. There is also an security sample project that demonstrates the use of Spring Session with Spring Security within the distribution. You can run it by cloning the repository and running the following:
./gradlew :samples:security:tomcatRun
The application will be available at http://localhost:8080/