Project

Project/개인프로젝트

자바 스크립트 fetch, await, async

fetch() 를 이용하면 url을 통해 원하는 API의 결과값을 받아올 수 있습니다. 그런데 js는 인터프립터 언어이기때문에 fetch를 사용하게되면 null을 반환하게 됩니다. let resopnse = fetch("http://localhost:8080/chat", { method: "post", body: JSON.stringify(chat), // JS -> JSON headers: { "Content-Type": "application/json; charset=utf-8" } }); 이때 바로 변수에 값을 할당하지 않고 fetch의 반환값이 올때까지 기다렸다 변수에 대응하게 값을 할당하는 것이 awit입니다. 즉, 통신이 끝날때까지 기다리게 됩니다. awit 적용 후 let resopnse =..

Project/개인프로젝트

MongoDB Capped collection 버퍼 크기 에러

MongoDB를 사용해 Chatting 서버를 만드는 중 에러가 발생하였습니다. public interface ChatRepository extends ReactiveMongoRepository { @Tailable @Query("{sender:?0, receiver:?1}") Flux mFindBySender(String sender, String receiver); } 이중에서 문제가 될만한 메세지를 찾았습니다. tailable cursor requested on non capped collection 바로 tailable cursor가 capped collection이 아닌 것을 요청했다는 것입니다. 확인해보니 tailable는 capped collection설정을 해주어야 했습니다. Capped ..

Project/개인프로젝트

[Error] Kafka Consumer UnrecognizedPropertyException

개인 프로젝트에서 Kafka를 이용해 CQRS를 적용하던 중 아래와 같은 에러가 발생하였습니다. Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "postId" (class com.example.core.domain.messaging.command.post.PostCreateMessage), not marked as ignorable (2 known properties: "postCreate", "userId"]) at [Source: (String)"{"postId":{"id":"fd94aee3-2ede-4c9a-a0b8-dd0262e73eb3"},"title":"성공인가?","c..

Project/개인프로젝트

[Error] 멀티모듈 BeanCreationException

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commentQueryRepositoryImpl' defined in com.example.query.infra.jpa.CommentQueryRepositoryImpl defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Not a managed type: class com.example.core.domain.comment.entity.Comment 좀더 확인해보니 Caused by: java...

Sol b
'Project' 카테고리의 글 목록