diff --git a/bruno/findSession.bru b/bruno/findSession.bru index 3ca409e..e7d74cd 100644 --- a/bruno/findSession.bru +++ b/bruno/findSession.bru @@ -5,7 +5,7 @@ meta { } get { - url: http://localhost:9090/services/api/session/a3518555-5a96-42a6-a5ec-958c4963a65e + url: http://localhost:8761/services/api/session/a3518555-5a96-42a6-a5ec-958c4963a65e body: none auth: basic } diff --git a/bruno/findSessions.bru b/bruno/findSessions.bru index e7327dc..c583471 100644 --- a/bruno/findSessions.bru +++ b/bruno/findSessions.bru @@ -5,7 +5,7 @@ meta { } get { - url: http://localhost:9090/services/api/session + url: http://localhost:8761/services/api/session body: none auth: basic } diff --git a/bruno/login.bru b/bruno/login.bru index 0e06db7..2baa818 100644 --- a/bruno/login.bru +++ b/bruno/login.bru @@ -5,7 +5,7 @@ meta { } post { - url: http://localhost:9090/services/api/login/a3518555-5a96-42a6-a5ec-958c4963a65e + url: http://localhost:8761/services/api/login/a3518555-5a96-42a6-a5ec-958c4963a65e body: none auth: basic } diff --git a/bruno/updateSession.bru b/bruno/updateSession.bru index fada031..3e83e0d 100644 --- a/bruno/updateSession.bru +++ b/bruno/updateSession.bru @@ -5,7 +5,7 @@ meta { } post { - url: http://localhost:9090/services/api/session + url: http://localhost:8761/services/api/session body: json auth: basic } diff --git a/conf/springboot.yml b/conf/springboot.yml index dddb4a4..3dc1922 100644 --- a/conf/springboot.yml +++ b/conf/springboot.yml @@ -1,11 +1,13 @@ server: - port: 9090 + port: 8761 camel: springboot: main-run-controller: true spring: + application: + name: eureka-server activemq: broker-url: "tcp://localhost:61616" ldap: @@ -21,3 +23,10 @@ app: username: "app" password: "app" mapper-package: "com.example.sbcamel.mapper" + +eureka: + client: + service-url: + defaultZone: http://cxfrs:password@localhost:8761/eureka/,http://cxfrs:password@localhost:8762/eureka/ + register-with-eureka: false + fetch-registry: false \ No newline at end of file diff --git a/conf2/springboot.yml b/conf2/springboot.yml index ccb1071..6cef5d2 100644 --- a/conf2/springboot.yml +++ b/conf2/springboot.yml @@ -1,11 +1,13 @@ server: - port: 9091 + port: 8762 camel: springboot: main-run-controller: true spring: + application: + name: eureka-server activemq: broker-url: "tcp://localhost:61616" ldap: @@ -21,3 +23,10 @@ app: username: "app" password: "app" mapper-package: "com.example.sbcamel.mapper" + +eureka: + client: + service-url: + defaultZone: http://cxfrs:password@localhost:8761/eureka/,http://cxfrs:password@localhost:8762/eureka/ + register-with-eureka: false + fetch-registry: false \ No newline at end of file diff --git a/pom.xml b/pom.xml index 679ff11..9ff49e2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,23 +4,21 @@ 4.0.0 com.example camel-springboot-activemq6-example - 3.0.0 + 3.0.1 camel-springboot-activemq6-example - - org.springframework.boot - spring-boot-starter-parent - 3.3.9 - + UTF-8 17 17 4.8.4 - ${project.parent.version} + 3.4.4 + 2024.0.1 3.5.19 3.0.4 4.11.1 33.1.0-jre + 3.14.0 @@ -35,7 +33,14 @@ org.springframework.boot spring-boot-dependencies - ${springboot.version} + ${spring-boot-dependencies.version} + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} pom import @@ -60,6 +65,10 @@ org.springframework.security spring-security-ldap + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-server + org.springframework spring-jdbc @@ -103,7 +112,6 @@ org.htmlunit htmlunit - ${htmlunit.version} com.h2database @@ -138,6 +146,7 @@ org.apache.maven.plugins maven-compiler-plugin + ${maven-compiler-plugin.version} ${maven.compiler.source} ${maven.compiler.target} @@ -146,6 +155,7 @@ org.springframework.boot spring-boot-maven-plugin + ${spring-boot-dependencies.version} com.example.sbcamel.Boot diff --git a/src/main/java/com/example/sbcamel/Boot.java b/src/main/java/com/example/sbcamel/Boot.java index 1217c10..4d5d35b 100644 --- a/src/main/java/com/example/sbcamel/Boot.java +++ b/src/main/java/com/example/sbcamel/Boot.java @@ -6,8 +6,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @SpringBootApplication +@EnableEurekaServer public class Boot { private static final Logger logger = LoggerFactory.getLogger(Boot.class); diff --git a/src/main/java/com/example/sbcamel/init/SecurityConfig.java b/src/main/java/com/example/sbcamel/init/SecurityConfig.java index e3493f2..94bc962 100644 --- a/src/main/java/com/example/sbcamel/init/SecurityConfig.java +++ b/src/main/java/com/example/sbcamel/init/SecurityConfig.java @@ -34,7 +34,8 @@ public class SecurityConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http.authorizeHttpRequests((authorize) -> authorize.requestMatchers(HttpMethod.GET, "/**") - .hasAuthority(ROLE_BACKEND).requestMatchers(HttpMethod.POST, "/**").hasAuthority(ROLE_SERVER)) + .hasAuthority(ROLE_BACKEND).requestMatchers(HttpMethod.POST, "/**").hasAuthority(ROLE_SERVER) + .requestMatchers(HttpMethod.PUT, "/**").permitAll()) .httpBasic(Customizer.withDefaults()).csrf(csrf -> csrf.disable()); return http.build(); }