Copy to ClipboardCopied!Toggle word wrapToggle overflow
다음으로, Spring XML 파일에 JPA idempotent 리포지토리를 생성할 수도 있습니다.
<!-- we define our jpa based idempotent repository we want to use in the file consumer -->
<bean id="jpaStore" class="org.apache.camel.processor.idempotent.jpa.JpaMessageIdRepository">
<!-- Here we refer to the entityManagerFactory -->
<constructor-arg index="0" ref="entityManagerFactory"/>
<!-- This 2nd parameter is the name (= a category name).
You can have different repositories with different names -->
<constructor-arg index="1" value="FileConsumer"/>
</bean>
<!-- we define our jpa based idempotent repository we want to use in the file consumer -->
<bean id="jpaStore" class="org.apache.camel.processor.idempotent.jpa.JpaMessageIdRepository">
<!-- Here we refer to the entityManagerFactory -->
<constructor-arg index="0" ref="entityManagerFactory"/>
<!-- This 2nd parameter is the name (= a category name).
You can have different repositories with different names -->
<constructor-arg index="1" value="FileConsumer"/>
</bean>
Copy to ClipboardCopied!Toggle word wrapToggle overflow
그리고 yes는 # 구문 옵션을 사용하여 idempotentRepository 를 사용하여 파일 소비자 끝점에서 jpaStore Velero를 참조하기만 하면 됩니다.