I have downloaded the wiremock standalone jar locally. And I am starting the standalone server using below command.
java -jar wiremock-jre8-standalone-2.26.3.jar --port 8089 &
I am placing all the mocked endpoints under the mappings folder.
I need a user interface which can connect to my wiremock server and show me all the mappings.
It would be of advantage if the UI could provide features for editing, deleting and adding new files permanently.
You can take a look at https://github.com/plouc/wiremock-ui and its live demo.
Use any version from https://github.com/holomekc/wiremock/releases and run executable jar having mocked endpoint JSONs under the mappings folder.If you have not provided port configuration then UI with mapping details will be accessible over URL http://localhost:8080/__admin/webapp
Related
I have two microservices. A Spring Cloud Config Server and another module that implements Spring Cloud Config Client. When I use the default configuration for the Spring Cloud Config Server service (localhost:8888) I can start it locally without any issues, after which I can start my other module as well, using a bootstrap.yml, it clearly finds the Config Server, fetches its properties and starts properly. All good. Now I'd like to push both of these services to Pivotal Cloud Foundry.
The Config Server service works just fine, service is up and running in my Space, and using the browser I can verify that it can still fetch the property files from the specific GitHub repository.
The problem is the other module, the client. I've replaced the default localhost:8888 in its bootstrap.yml file (spring.cloud.config.url parameter) to the now active service in the cloud using the Route bound to it and tried to start it locally. Unfortunately now it simply timeouts during startup. At this point I tried to specify longer timeouts but nothing helps.
Interesting thing is that if I directly copy the URL from the logs that timeouts I see it works properly in the browser locally. So why not in IntelliJ when I try to package the client with the changed parameter?
Sorry, I can't include much details here, but I hope maybe there is a straightforward solution that I've missed. Thanks!
I'm developing a SpringBoot app and I need to deploy it on a remote server running Windows Server 2012. I tried running the app from eclipse there, and i can access locally from the server, but when I try to access from other devide using the IP of the server it has no response. Any idea about how can I deploy it? The app runs on port 8080, so the URL is locally: localhost:8080/start/
but when i access XXX.XXX.XXX.XXX:8080/access/ there is no answer
I beg you to help me, I'm desperate
When you run your application in eclipse , the tomcat might be configured to listen to localhost, but still if your remote is in the same network as your local system you should be able to access the endpoints without fail.Make sure that the remote is open to the public , otherwise it won't be accessible to other devices.
If you are using spring-boot to create an executable war or jar to be deployed to a remote server for long term , you can use the Windows service wrapper provided by springboot itself to register your application as a service in windows.
Please read the doc and the sample code to implement it.
You may have to enable CORS--- #CrossOrigin on top of your controller class where you have you #RestController annotation
My question is regarding following problem:
I want to test the setup of my Wkhtmltopdf service structure
Therfore I want to use Gitlab-ci + Docker and Gitlab-Runners
The server framework I am using is Spring boot
I also have another Docker container which is also running a small web service making it accessible via REST to generate PDF files from urls.
For testing I want to use Testcontainers + DockerComposeContainer which is using a compose file defining my test database service and the PDF service.
My problem is the following:
I don't know which host to use for the url the PDF service is going to use for accessing the website on the spring boot service while running the test.
It perfectly works for the spring server to access database and and the PDF service. But I cannot make the PDF service request the provided web url for generating the PDF itself.
I've tried several approaches recommended on the web, like
Testcontainers.exposeHostPort
Domains
host.testcontainers.internal
And so on. Running the tests on my local machine don't seem to have any problems, since also docker default ips work as expected.
Please help, I cannot sleep, but I'll try now and I am willing to provide even more information when I'm back up again and at the computer.
We can create restful API in spring boot jar file?
1)can we split multiple jar file in Apache server?
2) if we split multiple jar file how will identify which jar contain correct rest APIs
How spring boot jar file will work in server?
For Development Environment
You can configure ports via application.properties or via system properties.
Or with option to jvm --server.port=8081
So, there is no problem to run a few APIs on single machine with different ports.
You don't need Apache Server. Spring Boot has it's own embedded for you. So, you can easily use it.
Let's say you have two APIs.
localhost:8081 (Checkout Service)
localhost:8082 (Payment Service)
Hostname and port - it's your identification for each service.
When you trying to search something in Google.
You browser - it's a client.
And Google's servers - it's a server.
The same here. Checkout Service trying to delegate some job to Payment Service. So, Checkout Service - it's a client. And this client should know the address of Payment Service.
For Production Environment
You should think twice, how you will monitor performance, manage scalability and so on.
I need to do some processing on the endpoint classes before they can be deployed and then deploy them manually. However it seems simply having a class annotated with #ServerEndpoint in my war is enough to deploy the endpoint in Tomcat and when I try to manually deploy later obviously I can't because the URL has been deployed already. Is there any way to disable the autodiscovery of endpoints?
Looking at the source for the version I'm using - 8.0.28, there's no dedicated option. The code deploying the endpoints is in org.apache.tomcat.websocket.server.WsSci. The quickest 'shurest' hack is to put my endpoints into the javax.websocket package. I elected to use their ServerApplicationConfig hook instead which serves my purposes if with some minor issues.