Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I want to create a software about sports and nutrition and I am trying to create a multi-module project with multiples environments.
First , I would like to create six modules ,nutrition , sports , healthy , this modules has a backend and frontend that they consume a restful webservice.
So , the structure of the project I am thinking is the following (This modules will be more subdmodules)
-back-sports
-back-nutrition
-back-health
-front-sports
-front-nutrition
-front-health
-authentication
-authorization
-rest-api
I am not sure how to consume the rest api , but I am sure that I will be use JavaScript(This is the next step to think)
The part of the rest api will be : Jersey , Spring/POJO , JPA/Hibernate.
Database : MySQL
What is better ? Separte the module rest-api in another project or not.
Regards !
You can have rest-api as separate module, you just "inject" services from bussines modules, so rest api module will just expose those services to the rest transport layer.
Btw if you use spring boot you have security already in.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a google cloud compute engine where the external ip is 35...*. I put my Spring boot jar in the folder and ran java -jar app.jar. The jar is starting.
However, when i use postman to call the endpoint of the spring, i do not get a response.
eg http://35...*/getallusers
Must I add some configurations for this to work?
You most likely haven’t configured the firewall rules correctly.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am using Spring Batch to process CSV files as a batch process and SFTP adapters (Spring Integration) to download and upload files. Found Spring Documentation very helpful. But I am a little bit confused and curious about their best use cases.
So far my understanding, a monolith application can be broken down and integrated with another external system (FTP, email, queue, etc) using Spring Integration. What are the other use cases? Should I use Spring Batch with Spring Integration? What are the best practices?
Can anybody help?
There are no "best" use cases, it depends on the context. There is a whole chapter about how to use Spring Batch and Spring Integration together here: https://docs.spring.io/spring-batch/docs/4.2.x/reference/html/spring-batch-integration.html#springBatchIntegration.
I will let you decide when it is best to use them together depending on your requirement.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I'm calling a service that exposes a GraphQL interface. So I'm able to post a GraphQL query and receive data back via curl. Now I want to write a service that builds the query for me (dynamically, based on query parameters I send my endpoint) and sends the request and gets the response back.
I'm using Spring Boot 2.1.4.
I know you can build queries with the elastic search library in Spring. Wondering if there's something similar for GraphQL.
There's a few clients, taking rather different approaches.
SmallRye GraphQL - Offers both a dynamic and a typesafe client
Netflix DGS client - Has both a simple and a type-safe client
Apollo Kotlin - Generates Kotlin and Java models from GraphQL queries.
There's a Node based Java client generator and a Maven plugin for it too.
Nodes
Shopify's GraphQL code gen - Needs (J)Ruby to run but generates Java code.
Manifold can be used as a GraphQL client
These are all different beasts, as you'll see, so you'll have to decide what fits.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I have checked in google and stackoverflow for end to end testing of Spring Boot Rest APIs.
I would like to test controller -> Service -> Repository at once.
I found two approaches are efficient:
1. TestRestTemplate:
Single call to the controller method with in-memory database configuration for repository.
2. MockMvc:
Create 2 Test classes.
one for Controller->Service
and one for Service->Repository.
Is there any way to club both 2 classes into one class.
which is the best way to do "end to end testing" of Spring Boot Rest APIs from above 2 approaches ???
I would say the better way to do the END2END testing is to use TestRestTemplate. It would actually start-up the server at a random port (it you configured) and call the api itself for testing.In this way, it mimic the actual behavior of the running server and use the default configures and beans.
MockMvc, in my testing experience, is mainly for testing the web layer, aka controllers. I would use mocked Service beans to replace the original ones. So I can test the behaviors of the controller layer itself without having to worry about the bugs in the service layer. More importantly, I don't have to set up any Database before testing.
So I would say, for E2E test, you can go for the first approach.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have developed a set of Web services in Jersey which I am now accessing through a Jersey client application. However I would also like to have a Web UI for human users to access the Web services. Some of the interfaces will also need to use Google maps. I would like some advice on which is the best framework to use with Jersey for building these Web UIs that can get me quickly up and running. Preferably I would like to use template based solutions for generating HTML pages if possible.
Jersey comes with a simple MVC framework built-in. It has built in support for JSPs which you could leverage...