Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api: ✨ Implementing Chatroom Join API: A Bounded Context Approach #184

Merged
merged 40 commits into from
Oct 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
529af53
chore: external-api module messabe broker config 주입
psychology50 Oct 27, 2024
17fbd59
chore: add chat_join_event_message exchange properties
psychology50 Oct 27, 2024
f70fa0c
chore: add chat.join exchange
psychology50 Oct 27, 2024
20faf4b
style: domain service 역할을 구분하기 위한 chat_member 생성 로직 위치 수정
psychology50 Oct 27, 2024
3dd8dde
fix: modify the chat_member entity to don't check exsists member is_d…
psychology50 Oct 27, 2024
0292b30
feat: add domain logic(is_active(), is_banned_member()) in the chat_m…
psychology50 Oct 27, 2024
db98b94
feat: add ban domain method in entity
psychology50 Oct 27, 2024
74bb8b9
feat: add chat_member exception & error code
psychology50 Oct 27, 2024
7ef6be7
test: add user_fixture & chat_room_fixture within the domain test pac…
psychology50 Oct 27, 2024
57fdc46
feat: impl chat_member_repository
psychology50 Oct 27, 2024
c9869c2
feat: impl create_member business logic within chat_member_service
psychology50 Oct 27, 2024
50fcf39
test: chat_member create business logic unit test
psychology50 Oct 27, 2024
7113a65
fix: exclude nickname parameter when create chat_member
psychology50 Oct 27, 2024
5ae151f
feat: add password check and verify domain logic whitin the chat room…
psychology50 Oct 27, 2024
7f983be
feat: add chat_room error code with exception
psychology50 Oct 29, 2024
aac5895
fix: add chat_room not_found error code
psychology50 Oct 29, 2024
215b6e1
feat: chat_room_service.read_by_id()
psychology50 Oct 29, 2024
a3ce597
feat: add count_chat_member in chat_room logic
psychology50 Oct 29, 2024
27e7685
feat: chat_member_join business service impl
psychology50 Oct 29, 2024
e7aa55c
feat: add chat_room_join event handler within infra module
psychology50 Oct 29, 2024
8a94f4d
fix: when member join finish, call the chat_room join event handler
psychology50 Oct 29, 2024
9284ccc
feat: join_chat_room_usecase & fix chat_member_join_service return value
psychology50 Oct 29, 2024
57a6b48
fix: chat_member_join_service return value is adding plus 1 about cur…
psychology50 Oct 29, 2024
451cf22
feat: impl join chat room controller
psychology50 Oct 29, 2024
7379fe2
docs: write join_api swagger
psychology50 Oct 29, 2024
6218d86
fix: join_req_dto is added getter method for swagger ui presenting
psychology50 Oct 29, 2024
2793368
fix: chat_member_repository method rule find_by_chat_room_id -> find_…
psychology50 Oct 29, 2024
a12d85e
test: add chat_member_fixture in the external-api module
psychology50 Oct 29, 2024
0a67a54
test: chat_member_join_service_unit_test
psychology50 Oct 29, 2024
1ff3b7d
test: refactor & add chat_member_join_service test case
psychology50 Oct 29, 2024
96610b5
chore: prevent automatic rabbitmq connection creation during applicat…
psychology50 Oct 29, 2024
60ba5b6
fix: add two types of getter whitin chat_member_req
psychology50 Oct 29, 2024
5cdfe43
fix: add default constructor within dto
psychology50 Oct 29, 2024
1d44cb6
fix: modify distributed_lock's key correctly about the spel
psychology50 Oct 29, 2024
6981338
rename: add log within chat_member_join_service
psychology50 Oct 29, 2024
ad57c34
test: fix chat_room_id of the chat_room_fixture due to integration f…
psychology50 Oct 29, 2024
22a6d3a
rename: join_service_test (usecase package) move to (service package)
psychology50 Oct 29, 2024
c1cdbdf
fix: chat_room_join_event_hander bean create within the message_brock…
psychology50 Oct 29, 2024
9b65d96
fix: modify join_event_hander phase after_commit to before_commit due…
psychology50 Oct 29, 2024
2034cc3
test: chat_member_join integration test
psychology50 Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: prevent automatic rabbitmq connection creation during applicat…
…ion startup
psychology50 committed Oct 29, 2024
commit 96610b56925d686c4835296bcefe60f6b8de3794
4 changes: 4 additions & 0 deletions pennyway-app-external-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -13,6 +13,10 @@ jwt:
access-token: ${JWT_ACCESS_EXPIRATION_TIME:1800000} # 30m (30 * 60 * 1000)
refresh-token: ${JWT_REFRESH_EXPIRATION_TIME:604800000} # 7d (7 * 24 * 60 * 60 * 1000)

pennyway:
rabbitmq:
validate-connection: true

---
spring:
config:
Original file line number Diff line number Diff line change
@@ -19,12 +19,14 @@
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.Connection;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitMessagingTemplate;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
@@ -98,9 +100,16 @@ public ConnectionFactory createConnectionFactory() {
return factory;
}

@Bean
@ConditionalOnProperty(prefix = "pennyway.rabbitmq", name = "validate-connection", havingValue = "true", matchIfMissing = false)
ApplicationRunner connectionFactoryRunner(ConnectionFactory cf) {
return args -> cf.createConnection().close();
return args -> {
try (Connection conn = cf.createConnection()) {
log.info("RabbitMQ connection validated");
} catch (Exception e) {
log.error("Failed to validate RabbitMQ connection", e);
throw e;
}
};
}

@Bean
2 changes: 2 additions & 0 deletions pennyway-socket/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ pennyway:
chat:
endpoint: ${SOCKET_CHAT_ENDPOINT:/ws}
allowed-origin-patterns: ${ALLOWED_ORIGIN_PATTERNS:*}
rabbitmq:
validate-connection: true

message-broker:
external: