Apache Camel의 가장 큰 강점이자 처음에 압도되는 이유가 300개 이상의 컴포넌트입니다. 체계적인 분류를 이해하면 필요한 컴포넌트를 빠르게 찾을 수 있습니다.
어떤 컴포넌트를 선택할지 결정하는 체계적인 기준입니다.
필요한 컴포넌트가 없다면 직접 만들 수 있습니다. Camel의 컴포넌트 SPI를 구현합니다.
// 커스텀 컴포넌트의 기본 구조
public class MyComponent extends DefaultComponent {
@Override
protected Endpoint createEndpoint(String uri, String remaining,
Map<String> parameters) throws Exception {
MyEndpoint endpoint = new MyEndpoint(uri, this);
setProperties(endpoint, parameters);
return endpoint;
}
}
public class MyEndpoint extends DefaultEndpoint {
@Override
public Producer createProducer() throws Exception {
return new MyProducer(this);
}
@Override
public Consumer createConsumer(Processor processor) throws Exception {
return new MyConsumer(this, processor);
}
}
// META-INF/services/org/apache/camel/component/my-component 파일에 등록
// com.example.MyComponent // 커스텀 컴포넌트 테스트
public class MyComponentTest extends CamelTestSupport {
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
context.addComponent("my-component", new MyComponent());
return context;
}
@Test
public void testMyComponent() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("처리완료");
template.sendBody("my-component:test", "입력데이터");
mock.assertIsSatisfied();
}
} 300개 컴포넌트는 전 세계 수천 명의 기여자가 만들었습니다. 버그를 발견하거나 새 컴포넌트가 필요하면 GitHub에서 직접 기여할 수 있습니다. Apache Camel의 기여 가이드는 초보자도 따라할 수 있도록 잘 정리되어 있습니다. 오픈소스 기여는 경력 개발에도 도움이 됩니다.
코스피 8% 폭락, 서킷브레이커 발동, SK텔레콤 Claude AI 차단까지. 한국의 AI 레버리지 버블이 단 하루…
SNS 사진 1장으로 30초 만에 딥페이크 영상이 완성됩니다. 당신의 얼굴이 이미 범죄에 악용되고 있을 수…
SNS 사진 1장으로 30초 만에 딥페이크 영상이 완성됩니다. 당신의 얼굴이 이미 범죄에 악용되고 있을 수…
달러/원 환율이 급등하는 이유와 실생활 영향을 정리했습니다. 지금 당장 활용할 수 있는 환전·투자 대응 전략까지…
미래에셋·미래에셋벤처투자·미래에셋생명이 동반 급등한 이유는 스페이스X 상장 기대감입니다. 세 회사가 스페이스X와 어떻게 연결되어 있는지 상세히 분석했습니다.
스페이스X 상장이 계속 미뤄지는 진짜 이유를 파헤쳤습니다. 화성 계획, 스타링크 분리, 국방 계약... 머스크가 절대…