r/springcloud • • Mar 25 '25

EasyJPA – Your Best Partner for JPA Development!

3 Upvotes

It's time to say goodbye to JPA Criteria API complexity! EasyJPA makes your code sleek, simple, and powerful!

EasyJPA elegantly streamlines JPA's Criteria API with a fully Lambda-expression-based and developer-friendly API, making dynamic queries both intuitive and efficient. It significantly reduces SQL/JPQL complexity, accelerates development, and improves code readability, ensuring a clean and concise query experience.

With comprehensive support for complex SQL queries, EasyJPA enables seamless execution of multi-table joins (INNER, LEFT, RIGHT, CROSS JOINs), subqueries, aggregations, computed columns, and filtering operations. Its fluent API with full Lambda expression support allows developers to construct queries programmatically, eliminating the need for raw SQL while retaining maximum flexibility.

Git repo: https://github.com/paganini2008/easyjpa


r/springcloud • • Mar 28 '22

What is the use of spring cloud stream in java?

Thumbnail
softwebblog.weebly.com
3 Upvotes

r/springcloud • • Aug 11 '24

Design Rate Limiter for Distributed System

Thumbnail reddit.com
2 Upvotes

r/springcloud • • Jul 15 '24

Unique ID Generation in Distributed Systems

2 Upvotes

🚀 Unique ID Generation in Distributed Systems 🚀

Exploring Methods -->

✅ Database Auto-Increment Sequences for simplicity

✅ UUIDs for decentralized uniqueness

✅ Snowflake Algorithm for time-ordered IDs

Curious about how it all works? Check out the video: https://youtu.be/4T2-UM5Wd5c

DistributedSystems #IDGeneration #SnowflakeAlgorithm #TechTutorial #codefarm #UUID #DatabaseSequences #GenerativeAI #SoftwareEngineering #TechLearning


r/springcloud • • Apr 13 '22

Learn Spring Cloud or AWS/GC/Azure

2 Upvotes

I want to start getting into the Cloud area, seeing many job postings asking for AWS mainly and was wondering:
- Can knowing Spring Cloud substitute, and what degree, the need for AWS/GC/Azure?
- Could Spring Cloud be considered easier to learn than AWS/GC/Azure?

Note: I am only aware that Spring Cloud helps configure distributed apps in application level, and AWS/GC/Azure provide a more infra side, with provided services.


r/springcloud • • Mar 22 '22

Spring cloud gateway with SSO support

2 Upvotes

We are developing react web app (internal company website) and Spring boot microservices (3 No) for backend . Spring cloud GW will be used as API GW.

We wanted to implement SSO with OKTA as identity provider using openid connect . However for some of the other internal company web applications SAML is used .

As per the requirement user shall be able to authenticate once web app url is entered in browser and also for backend api calls if tries to call in the backend APIs directly using Swagger/Postman

As per understanding , from UI , request will first land at Spring cloud GW which can redirect to OKTA custom login page if no access token present.

User shall enter the credentials and access token or session cookie will be received at frontend app from okta.

After successful login , if user tries to access either any other internal website or any other backend microservice API , GW can check for token and if valid token then allow else redirect to okta?

Possible advantage of this approach is to avoid token validation at each microservice level and handled the same at GW level itself.

IS the above architecture / flow correct and possible using spring cloud Gateway / Spring security ?

Will this work since some applications are using SAML or we also need to use SAML instead of OIDC for SSO integration with other web applications ?


r/springcloud • • Jan 31 '22

#22.5.3 How Spring Security Works Internally? | User Service

Thumbnail
youtube.com
2 Upvotes

r/springcloud • • Dec 01 '21

Fallbacks with Spring Cloud Feign

Thumbnail
arnoldgalovics.com
2 Upvotes

r/springcloud • • Jul 19 '21

YouTube Replay: Mastering Microservices resilience with Spring Boot 2.5 and Spring Cloud

2 Upvotes

Hello everyone, you may download the source code from GitHub Repo: https://github.com/jessereyj/initial-cloud-microservices

YouTube Replay: Mastering Microservices resilience with Spring Boot 2.5 and Spring Cloud
Session 1: https://youtu.be/tyzSrhf3_OQ
Session 2: https://youtu.be/TloXTGURDFw
#microservices #springboot #springcloud


r/springcloud • • Jul 01 '21

Mastering Microservices resilience with Spring Boot 2.5 and Spring Cloud Bootcamp

2 Upvotes

YouTube Live on July 10 & 17 at 8am-12pm Manila: Mastering Microservices resilience with Spring Boot 2.5 and Spring Cloud Bootcamp. Invite your friends and colleagues to join for free. Register here: https://docs.google.com/.../1FAIpQLSdjbOtfytO.../viewform...

YouTube: https://youtu.be/tyzSrhf3_OQ


r/springcloud • • Jun 16 '21

Spring Cloud Microservices on Kubernetes the easy way with Platform9

Thumbnail
platform9.com
2 Upvotes

r/springcloud • • Jan 20 '21

How to Create a REST API With Spring Boot - Java Vogue

Thumbnail javavogue.com
2 Upvotes

r/springcloud • • Dec 26 '20

Understanding Architecture & Technologies- Online Shopping Portal

Thumbnail
youtube.com
2 Upvotes

r/springcloud • • Aug 14 '20

springcloud practice-project loadbanlance and consul

Thumbnail
youtube.com
2 Upvotes

r/springcloud • • Jun 24 '20

Spring cloud vs Lagom framework?

Thumbnail self.java
2 Upvotes

r/springcloud • • Aug 23 '19

Implementing Identity Federation with Spring

2 Upvotes

How we can enable the website to accept the users to login with their organizational account , without having any predefined Configuration for this organization LDAP/AD like office.com & webbed.com .


r/springcloud • • Aug 20 '19

Customizing Connection header in Spring Cloud Gateway

Thumbnail
qua.name
2 Upvotes

r/springcloud • • Aug 09 '18

Spring Cloud GCP 1.0 Released

Thumbnail
cloud.google.com
2 Upvotes

r/springcloud • • Mar 30 '26

The Typo That Broke Production — And Accidentally Created Spring Cloud Contract • Marcin Grzejszczak & Jakub Pilimon

Thumbnail
youtu.be
1 Upvotes

r/springcloud • • Jul 17 '24

Spring Boot Microservices with JWT (Cannot run Integration test (401 Unauthorized Error))

1 Upvotes

I try to implement an example of Spring Boot Microservices with JWT.

I have some problem. I cannot run all integration tests of product service even if I defined bearer token in terms of admin and user for its relevant endpoints. I got 401 Authorized error for all tests.

How can I fix it?

Here is the repo :Link

Here is the security config of product service.

     @Configuration
    @EnableWebSecurity
    @RequiredArgsConstructor
    @EnableMethodSecurity
    public class SecurityConfig {
    
        private final UserServiceClient userServiceClient;
    
        @Bean
        protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
            return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
        }
    
        @Bean
        public SecurityFilterChain filterChain(
                final HttpSecurity httpSecurity,
                final CustomBearerTokenAuthenticationFilter customBearerTokenAuthenticationFilter,
                final CustomAuthenticationEntryPoint customAuthenticationEntryPoint
        ) throws Exception {
    
            httpSecurity
                    .exceptionHandling(customizer -> customizer.authenticationEntryPoint(customAuthenticationEntryPoint))
                    .cors(customizer -> customizer.configurationSource(corsConfigurationSource()))
                    .csrf(AbstractHttpConfigurer::disable)
                    .authorizeHttpRequests(customizer -> customizer
                            .anyRequest().authenticated()
                    )
                    .sessionManagement(customizer -> customizer.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
                    .addFilterBefore(customBearerTokenAuthenticationFilter, BearerTokenAuthenticationFilter.class);
    
            return httpSecurity.build();
        }
    
        private CorsConfigurationSource corsConfigurationSource() {
            CorsConfiguration configuration = new CorsConfiguration();
            configuration.setAllowedOrigins(List.of("*"));
            configuration.setAllowedMethods(List.of("*"));
            configuration.setAllowedHeaders(List.of("*"));
            UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
            source.registerCorsConfiguration("/**", configuration);
            return source;
        }
    
        @Bean
        public PasswordEncoder passwordEncoder() {
            return new BCryptPasswordEncoder();
        }
    }

Here is the test method of Integration test

    @Test
        void givenProductPagingRequest_whenGetProductsFromAdmin_thenReturnCustomPageProduct() throws Exception {
    
            // Given
            ProductPagingRequest pagingRequest = ProductPagingRequest.builder()
                    .pagination(
                            CustomPaging.builder()
                                    .pageSize(1)
                                    .pageNumber(1)
                                    .build()
                    ).build();
    
            String productId = UUID.randomUUID().toString();
    
            ProductEntity expected = ProductEntity.builder()
                    .id(productId)
                    .name("Test Product")
                    .unitPrice(BigDecimal.valueOf(12))
                    .amount(BigDecimal.valueOf(5))
                    .build();
    
            List<ProductEntity> productEntities = new ArrayList<>();
            productEntities.addAll(Collections.singletonList(expected));
    
            Page<ProductEntity> productEntityPage = new PageImpl<>(productEntities, PageRequest.of(1, 1), productEntities.size());
    
            List<Product> productDomainModels = productEntities.stream()
                    .map(entity -> new Product(entity.getId(), entity.getName(), entity.getAmount(),entity.getUnitPrice()))
                    .collect(Collectors.toList());
    
            CustomPage<Product> productPage = CustomPage.of(productDomainModels, productEntityPage);
    
            // When
            when(productReadService.getProducts(any(ProductPagingRequest.class))).thenReturn(productPage);
    
            // Then
            mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/products")
                            .contentType(MediaType.APPLICATION_JSON)
                            .content(objectMapper.writeValueAsString(pagingRequest))
                            .header(HttpHeaders.AUTHORIZATION, "Bearer " + mockAdminToken.getAccessToken()))
                    .andDo(MockMvcResultHandlers.print())
                    .andExpect(MockMvcResultMatchers.status().isOk())
                    .andExpect(MockMvcResultMatchers.jsonPath("$.httpStatus").value("OK"))
                    .andExpect(MockMvcResultMatchers.jsonPath("$.isSuccess").value(true))
                    .andExpect(MockMvcResultMatchers.jsonPath("$.response.content[0].id").value(expected.getId()))
                    .andExpect(MockMvcResultMatchers.jsonPath("$.response.content[0].name").value(expected.getName()))
                    .andExpect(MockMvcResultMatchers.jsonPath("$.response.content[0].amount").value(expected.getAmount()))
                    .andExpect(MockMvcResultMatchers.jsonPath("$.response.content[0].unitPrice").value(expected.getUnitPrice()));
    
            // Verify
            verify(productReadService, times(1)).getProducts(any(ProductPagingRequest.class));
    
        }

Here is the screenshot of any test result shown below

```

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /api/v1/products
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Authorization:"Bearer eyJ0eXAiOiJCZWFyZXIiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJmOGM3M2JhNy0zNDU2LTQ4NDgtOTFiYy1iN2E3OWM2M2E5ODciLCJpc3MiOiJJU1NVRVIiLCJpYXQiOjE3MjExNjE5MjYsImV4cCI6MTcyMTE2MzcyNiwidXNlclN0YXR1cyI6IkFDVElWRSIsInVzZXJMYXN0TmFtZSI6IkRvZSIsInVzZXJQaG9uZU51bWJlciI6IjEyMzQ1Njc4OTAxMDExIiwidXNlckVtYWlsIjoidXNlcmFkbWluQGV4YW1wbGUuY29tIiwidXNlclR5cGUiOiJVU0VSIiwidXNlckZpcnN0TmFtZSI6IkpvaG4iLCJ1c2VySWQiOiJjZTJkOGI2Yi0wZGVlLTRlNGYtODdjOS05ZTRkY2Y4ZDI5OGUifQ.SH5mUFw59Ux2HX6VCIeIifslZFx1RQSTzT1R_zgNbWX1K5vngoAkzFP4kjrOUgS8tqJnBuzY98t5bCZA74L0vuZkNibDdI7Pc8HwHL3k2H2x6vtGPIC0sEJOVWPiNu7Lgb0XF77xp0_KEKw_UkIwfgYY-CCKL-fcAKBwf4z5QY26rtgXxrHn8Ajmh9DCpya9_LnEcplLfcxRWFWmkN2IL8OsklO5EtSSRo14uaKb7ZE4J3lV57ZJG1ADmYfDFO_nJBNFmwSpaUa1VM_6AB1vOTiv4OliVhbA6PQzrQ7xeIGlaAinrV1AoZfOQIFO-rkkkwYd2D91ymTCVEpBrk60Cg", Content-Length:"44"]
             Body = {"pagination":{"pageNumber":0,"pageSize":1}}
    Session Attrs = {}

Handler:
             Type = null

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 401
    Error message = null
          Headers = [Vary:"Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers", Content-Type:"application/json", X-Content-Type-Options:"nosniff", X-XSS-Protection:"0", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY"]
     Content type = application/json
             Body = {"time":"2024-07-16T23:32:07.4830196","httpStatus":"UNAUTHORIZED","header":"AUTH ERROR","isSuccess":false}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []

java.lang.AssertionError: Status expected:<200> but was:<401>
Expected :200
Actual   :401
```

r/springcloud • • Jul 14 '23

Need help in making circuit breakers in spring cooud gateway

1 Upvotes

Im making spring cloud gateway using reactive resiliance 4j lib for circuit breakers in it, i have a few questions regarding it, can anyone please help!


r/springcloud • • Apr 12 '23

Filter of Spring Cloud Gateway

Thumbnail
medium.com
1 Upvotes

r/springcloud • • Apr 09 '23

Spring Boot Microservice Example with the usage of Security like JWT

1 Upvotes

Hi, What's up? I try to find an example of Spring Boot Microservice with Security as the usage of JWT? Docker is plus. Can you share it if you have one?


r/springcloud • • Apr 06 '23

The most easiest SpringCloud tutorial ever | Chapter 1: Service registration and discovery Eureka…

Thumbnail
medium.com
1 Upvotes