File tree 18 files changed +45
-21
lines changed
src/main/java/com/example/catalogservice/messagequeue
src/main/java/com/example/orderservice
src/main/java/com/example/userservice/security
18 files changed +45
-21
lines changed Original file line number Diff line number Diff line change
1
+ FROM openjdk:17-ea-11-jdk-slim
2
+ VOLUME /tmp
3
+ COPY target/apigateway-service-1.0.jar ApigatewayService.jar
4
+ ENTRYPOINT ["java" ,"-jar" ,"ApigatewayService.jar" ]
Original file line number Diff line number Diff line change 10
10
</parent >
11
11
<groupId >com.example</groupId >
12
12
<artifactId >apigateway-service</artifactId >
13
- <version >0.0.1-SNAPSHOT </version >
13
+ <version >1.0 </version >
14
14
<name >apigateway-service</name >
15
15
<description >apigateway-service</description >
16
16
<properties >
Original file line number Diff line number Diff line change
1
+ FROM openjdk:17-ea-11-jdk-slim
2
+ VOLUME /tmp
3
+ COPY target/catalog-service-1.0.jar CatalogService.jar
4
+ ENTRYPOINT ["java" ,"-jar" ,"CatalogService.jar" ]
Original file line number Diff line number Diff line change 10
10
</parent >
11
11
<groupId >com.example</groupId >
12
12
<artifactId >catalog-service</artifactId >
13
- <version >0.0.1-SNAPSHOT </version >
13
+ <version >1.0 </version >
14
14
<name >catalog-service</name >
15
15
<description >catalog-service</description >
16
16
<properties >
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public class KafkaConsumerConfig {
19
19
@ Bean
20
20
public ConsumerFactory <String , String > consumerFactory (){
21
21
Map <String , Object > properties = new HashMap <>();
22
- properties .put (ConsumerConfig .BOOTSTRAP_SERVERS_CONFIG , "127.0 .0.1 :9092" );
22
+ properties .put (ConsumerConfig .BOOTSTRAP_SERVERS_CONFIG , "172.18 .0.101 :9092" );
23
23
properties .put (ConsumerConfig .GROUP_ID_CONFIG , "consumerGroupId" );
24
24
properties .put (ConsumerConfig .KEY_DESERIALIZER_CLASS_CONFIG , StringDeserializer .class );
25
25
properties .put (ConsumerConfig .VALUE_DESERIALIZER_CLASS_CONFIG , StringDeserializer .class );
Original file line number Diff line number Diff line change
1
+ FROM openjdk:17-ea-11-jdk-slim
2
+ VOLUME /tmp
3
+ COPY apiEncryptionKey.jks apiEncryptionKey.jks
4
+ COPY target/config-service-1.0.jar ConfigServer.jar
5
+ ENTRYPOINT ["java" ,"-jar" ,"ConfigServer.jar" ]
Original file line number Diff line number Diff line change 10
10
</parent >
11
11
<groupId >com.example</groupId >
12
12
<artifactId >config-service</artifactId >
13
- <version >0.0.1-SNAPSHOT </version >
13
+ <version >1.0 </version >
14
14
<name >config-service</name >
15
15
<description >config-service</description >
16
16
<properties >
Original file line number Diff line number Diff line change 1
1
encrypt :
2
2
# key: abcdefghijklmnopqrstuvwxyz0123456789
3
3
key-store :
4
- location : file:///Users/jasun/Desktop/develop/keystore/apiEncryptionKey.jks
4
+ # location: file:///Users/jasun/Desktop/develop/keystore/apiEncryptionKey.jks
5
+ location : file://apiEncryptionKey.jks
5
6
password : test1234
6
- alias : apiEncryptionKey
7
+ alias : apiEncryptionKey
Original file line number Diff line number Diff line change
1
+ FROM openjdk:17-ea-11-jdk-slim
2
+ VOLUME /tmp
3
+ COPY target/discoveryservice-1.0.jar DiscoveryService.jar
4
+ ENTRYPOINT ["java" ,"-jar" ,"DiscoveryService.jar" ]
Original file line number Diff line number Diff line change 10
10
</parent >
11
11
<groupId >com.example</groupId >
12
12
<artifactId >discoveryservice</artifactId >
13
- <version >0.0.1-SNAPSHOT </version >
13
+ <version >1.0 </version >
14
14
<name >discoveryservice</name >
15
15
<description >discoveryservice</description >
16
16
Original file line number Diff line number Diff line change 4
4
spring :
5
5
application :
6
6
name : discoveryservice
7
+ cloud :
8
+ config :
9
+ uri : http://127.0.0.1:8888
10
+ name : ecommerce
7
11
eureka :
8
12
client :
9
13
register-with-eureka : false
Original file line number Diff line number Diff line change
1
+ FROM openjdk:17-ea-11-jdk-slim
2
+ VOLUME /tmp
3
+ COPY target/order-service-1.0.jar OrderSerivce.jar
4
+ ENTRYPOINT ["java" ,"-jar" ,"OrderSerivce.jar" ]
Original file line number Diff line number Diff line change 10
10
</parent >
11
11
<groupId >com.example</groupId >
12
12
<artifactId >order-service</artifactId >
13
- <version >0.0.1-SNAPSHOT </version >
13
+ <version >1.0 </version >
14
14
<name >order-service</name >
15
15
<description >order-service</description >
16
16
<properties >
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public ResponseEntity<ResponseOrder> createOrder(@PathVariable("userId") String
56
56
// orderDto.setTotalPrice(orderDetails.getQty() * orderDetails.getUnitPrice());
57
57
58
58
/* send this order to the kafka */
59
- // kafkaProducer.send("example-catalog-topic", orderDto);
59
+ kafkaProducer .send ("example-catalog-topic" , orderDto );
60
60
// orderProducer.send("orders", orderDto);
61
61
62
62
// ResponseOrder responseOrder = mapper.map(orderDto, ResponseOrder.class);
@@ -75,15 +75,12 @@ public ResponseEntity<List<ResponseOrder>> getOrder(@PathVariable("userId") Stri
75
75
result .add (new ModelMapper ().map (v , ResponseOrder .class ));
76
76
});
77
77
78
- try {
79
- Thread .sleep (1000 );
80
- throw new Exception ("장애 발생" );
81
- }catch (InterruptedException e ){
82
- log .warn (e .getMessage ());
83
- }
84
-
85
-
86
-
78
+ // try{
79
+ // Thread.sleep(1000);
80
+ // throw new Exception("장애 발생");
81
+ // }catch (InterruptedException e){
82
+ // log.warn(e.getMessage());
83
+ // }
87
84
88
85
log .info ("After retrieve orders data" );
89
86
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public class KafkaProducerConfig {
19
19
@ Bean
20
20
public ProducerFactory <String , String > producerFactory (){
21
21
Map <String , Object > properties = new HashMap <>();
22
- properties .put (ProducerConfig .BOOTSTRAP_SERVERS_CONFIG , "127.0 .0.1 :9092" );
22
+ properties .put (ProducerConfig .BOOTSTRAP_SERVERS_CONFIG , "172.18 .0.101 :9092" );
23
23
properties .put (ProducerConfig .KEY_SERIALIZER_CLASS_CONFIG , StringSerializer .class );
24
24
properties .put (ProducerConfig .VALUE_SERIALIZER_CLASS_CONFIG , StringSerializer .class );
25
25
Original file line number Diff line number Diff line change 1
1
FROM openjdk:17-ea-11-jdk-slim
2
2
VOLUME /tmp
3
3
COPY target/user-service-1.0.jar UserService.jar
4
- ENTRYPOINT ["java" ,"-jar" ,"- UserService.jar" ]
4
+ ENTRYPOINT ["java" ,"-jar" ,"UserService.jar" ]
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public class WebSecurity {
25
25
26
26
@ Bean
27
27
public AuthenticationManager authenticationManager () throws Exception {
28
+
28
29
return this .authenticationConfiguration .getAuthenticationManager ();
29
30
}
30
31
@@ -37,7 +38,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
37
38
http .authorizeRequests ()
38
39
.antMatchers ("/error/**" ).permitAll ()
39
40
.antMatchers ("/**" )
40
- .access ("hasIpAddress('127.0.0.1' )" )
41
+ .access ("hasIpAddress(env.getProperty( \" gateway.ip \" ) )" )
41
42
.and ()
42
43
.addFilter (getAuthenticationFiler ());
43
44
You can’t perform that action at this time.
0 commit comments