Skip to content

Commit

Permalink
[Fix] Add concurrency setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnsugyeong committed Oct 28, 2024
1 parent 66e25fd commit b058c4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import org.springframework.kafka.listener.ContainerProperties;
import org.springframework.kafka.support.serializer.JsonDeserializer;

import java.util.Map;
Expand All @@ -27,6 +28,8 @@ public class KafkaConsumerConfig {
ConcurrentKafkaListenerContainerFactory<String, ChatMessageDto> kafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String, ChatMessageDto> factory = new ConcurrentKafkaListenerContainerFactory<>();
factory.setConsumerFactory(consumerFactory());
factory.setConcurrency(6); // 파티션 개수에 맞춰 스레드 설정
factory.getContainerProperties().setAckMode(ContainerProperties.AckMode.MANUAL); // 수동 커밋 모드
return factory;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public JwtToken generateToken(Authentication authentication) {
.grantType("Bearer")
.accessToken(accessToken)
.refreshToken(refreshToken)
.build();
.build();User
}

@Override
Expand Down

0 comments on commit b058c4f

Please sign in to comment.