Application publishing both REST and SOAP API with Spring Boot - spring

I Have a Spring Boot application with RestController, service, and domain. So my application publishes a REST API. How would I go about to have my application publish both a REST and a SOAP API at the same time? Thanks!

Related

Spring cloud Consul for non spring boot web app

I have microservice written in spring boot that is not web app (no spring-boot-starter-web dependency).
It consumes event from message bus and do some other calculation not related to web request at all.
Still I want it to be registered with Hashicorp Consul using spring cloud service registration (for external configuration and health checks) but it only registered automatically when I add the spring-boot-starter-web dependency.
Any ideas how to use spring-cloud-starter-consul without web dependency?

How to build a Pub Sub application with RabbitMQ, Spring Boot and React

I'm trying to build an application with a couple of services. One service publishes details to a rabbitMQ queue, another spring boot application has to consume them and send the correct details to the correct user. The front end is developed in reactJS. How can I implement the spring boot consuming and sending to the subscribed user part? Any reference is appreciated. Can I use the web socket in spring boot to this?

Using Gateway to consume Spring Boot application from Spring Integration application

I am just starting with Spring Integration with Spring Boot 2.
I am working on a application which uses Spring Integration's HTTP outbound gateway to consume a Spring boot Service.
I am consuming the spring boot service from Spring Integration application using Gateway.
When I call the Gateway method which in turn will use the outbound gateway to call the spring boot service, the request does not seem to be completed. It is just going on when I make the HTTP GET request via the browser.
The request is also not received by the Spring Boot service.
I am not able to identify what is wrong in my Integration application when using gateway to consume a Spring Boot 2 service.
I have shared my Spring Boot 2 Application and also the Integration application which I am using to consume it in the below github folder. it contains 2 folders, one for the spring Integration application and the other for the spring boot application.
https://github.com/gsamartian/spring-int-demos
I have exposed a REST interface for the Integration application using RestController.
I access the boot application from integration application via the url, http://localhost:8763/callExternalServiceViaGateway
I am able to access the spring boot application directly from its port.
If anyone can help me identify the cause it would be great.
Thanks,
Your problem that the gateway method is without any args:
#Gateway(requestChannel = "get.request.channel", replyChannel = "reply.channel")
String getCustomMessage();
In this case the gateway works as receiving. No any requests is send because nothing to wrap to the payload. See more info on the matter in the Reference Manual.
Right now I see several bugs with the payloadExpression and no arg, so I suggest you to add some String payload arg to the getCustomMessage() gateway method and perform it with an empty string.
Will take a look into the bugs and will fix them soon.
Thank you for a good sample how to catch and reproduce!
https://jira.spring.io/browse/INT-4448
https://jira.spring.io/browse/INT-4449

Which Spring project is for RESTful Web Services as Spring Web-Service Project is for just SOAP based web services?

I was looking to implement RestFul Web Services using Spring so in all Spring Projects list I saw Spring Web Services.
But Strangely it's just for SOAP and no Restful web services!
Where is project for RestFul web Services? Is there any JAX-RS implementation of Restful Web Services?
( Actually, It should be part of Spring Web Services project as its a popular web Services architecture as SOAP itself)
For Creating ReSTful web using spring, two ways are there :
1.One very easy way to use Spring MVC project. Spring provides annotations specificto ReSTful web services if you are using Spring MVC project like #RestController etc.
2.One can also create ReSTful web services by following JAX-RS methodology. Using spring-boot-starter-jersey project. Using this one can get other core functionalities of spring framework like DI, AOP etc.

Securing REST endpoints with CXF in OSGI Karaf

What is the standard approach in securing REST endpoints implemented with CXF in OSGI?
The system in question is a web application deployed as a WAB in Karaf. The application contains JavaScript making AJAX calls to REST service implemented in a separate OSGI bundle using CXF. The main Web application is secured using Spring Security (with the standard DelegatingFilterProxy). The application should be open to be used with any security provider compatible with Spring Security.
We need to be able to obtain the user information in REST services based on the principal with which the user authenticated in the main Web application.
What is the best way to secure the REST endpoints in the application?
Thank you,
Michael

Resources