56.3. 추가 Camel Quarkus 구성


확장 기능은 Quarkus MongoDB Client 확장을 활용합니다. Mongo 클라이언트는 Quarkus MongoDB 클라이언트 구성 옵션을 통해 구성할 수 있습니다.

Camel Quarkus MongoDB 확장 프로그램은 camelMongoClient 라는 MongoDB 클라이언트 빈을 자동으로 등록합니다. 이는 mongodb 엔드포인트 URI connectionBean path 매개변수에서 참조할 수 있습니다. 예를 들면 다음과 같습니다.

from("direct:start")
.to("mongodb:camelMongoClient?database=myDb&collection=myCollection&operation=findAll")
Copy to Clipboard Toggle word wrap

애플리케이션이 여러 MongoDB 서버에서 작업해야 하는 경우 Quarkus MongoDB 확장 클라이언트 삽입에 설명된 대로 클라이언트 및 관련 구성을 삽입하여 경로에 "명명" 클라이언트와 참조를 생성할 수 있습니다. 예를 들면 다음과 같습니다.

//application.properties
quarkus.mongodb.mongoClient1.connection-string = mongodb://root:example@localhost:27017/
Copy to Clipboard Toggle word wrap
//Routes.java

    @ApplicationScoped
    public class Routes extends RouteBuilder {
        @Inject
        @MongoClientName("mongoClient1")
        MongoClient mongoClient1;

        @Override
        public void configure() throws Exception {
            from("direct:defaultServer")
                .to("mongodb:camelMongoClient?database=myDb&collection=myCollection&operation=findAll")

            from("direct:otherServer")
                .to("mongodb:mongoClient1?database=myOtherDb&collection=myOtherCollection&operation=findAll");
        }
    }
Copy to Clipboard Toggle word wrap

이름이 지정된 클라이언트를 사용할 때 "default" camelMongoClient 8080은 계속 생성됩니다. 자세한 내용은 여러 MongoDB 클라이언트에 대한 Quarkus 설명서를 참조하십시오.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat