Debugging Rest Controller in Spring boot application - spring

I am deploying a spring boot, service broker application for CF. The application defines multiple rest controllers ( for the different service broker endpoints that has to be implemented ).
On testing the application locally and performing a http request using postman, the request is serviced by one of the thread of the runtime ( Please view the attachment ).
My breakpoints dont trigger and i am unable to debug the rest calls. I have changed the debug setting for the breakpoint from suspend Thread to Suspend VM but this does not help either. Please advise how we can debug such calls. I am using eclipse IDE with STS plugin installed.

Related

Configure Spring to run without web services

I want to create Spring Boot project which runs without web services because I need to use it to process Kafka messages, SQL queries and webflux client.
Is it possible to disable the rest API functionality and to disable tomcat from exposing server on the network?

How to check the java application (non spring boot) if it is up or down

I have this requirement that I need to check if the java application (not web app) is running or down via bash script.
It is non springboot application as well. It is just a normal spring application that connects and listen to kafka, get the the object from the topic and call an API.
We thought of to use spring actuator to check the health however it is not a web application.
What is the recommended way to check a non-web and non-springboot application if it is up or down?
Please advise.

spring boot rest API got blocked

I'm not very familiar with network configuration. I have an API server developed on spring boot with CORS enabled. The server works fine on the external network. But when I try to call API from the internal network, it got blocked, is there a way to resolve this problem in spring boot without changing network's configuration?

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

How to deploy a spring integration component?

I've developed a spring integration component that is to sit on a server and process messages coming in over an inbound RMI channel do some processing/filtering and then send out some messages over a different RMI channel.
Currently, for testing, I've been running it using a Main class that just loads the context, which sets up the inbound RMI gateway and it's working fine. But I don't think that this is appropriate for a production environment.
What is the best way to deploy this type of project to a server?
If I were working in a .Net I'd be deploying this type of application as a windows service, is that what I should be doing here?
The application that is sending me data is hosted in Tomcat, would it be a good idea to also run this application within the same Tomcat container (Current requirements are for both components to be on the same machine this may change)? And if so how?
I'm currently looking into Spring Boot, am I on the right path?
I think the best would be Spring Boot, as it's made to easily allow running different types of applications. Also, you don't need Tomcat if you can run the same component with a simple Main and not using UI. Spring Boot, also, has a sample using Spring Integration here, so you should be up and running in no time.

Resources