Vert.x2 [Java] Vert.x 클러스터링 예제 오늘은 Vert.x의 클러스터링을 해보겠습니다. 파일 구조는 아래와 같습니다. // Main.java public class Main { public static void main(String[] args) { // 기존 Hazelcast 클러스터 매니저와 Vert.x 옵션 설정 HazelcastClusterManager mgr = new HazelcastClusterManager(); VertxOptions options = new VertxOptions().setClusterManager(mgr); // 클러스터링된 Vert.x 인스턴스 생성 Vertx.clusteredVertx(options, res -> { if (res.succeeded()) { Vertx vertx = res.result();.. 2024. 4. 4. [Java] Vert.x HTTP 기본 예제 오늘은 Java으로 Vert.x 프레임워크를 사용해보겠습니다. 디렉토리 구조는 아래와 같습니다. 아래 코드는 터미널에서 curl을 통해 테스트해보시면 됩니다. GET 요청 (아이템 조회) curl -X GET http://localhost:8080/item/1 POST 요청 (아이템 생성) curl -X POST http://localhost:8080/item -H "Content-Type: application/json" -d '{"name":"NewItem", "description":"Description of new item"}' PUT 요청 (아이템 업데이트) curl -X PUT http://localhost:8080/item/1 -H "Content-Type: application/json".. 2024. 3. 31. 이전 1 다음