답변

1

몇 가지 코드가 그것을 생산하기 위해 필요합니다. 그것은 작동하지 않지만 적어도 뭔가를 시작합니다. 아무도 여기에 코드를 작성하지 않습니다.

<bean id="s3SessionFactory" 
      class="org.springframework.integration.aws.support.S3SessionFactory"/> 

<int-aws:s3-inbound-channel-adapter channel="s3Channel" 
        session-factory="s3SessionFactory" 
        filename-pattern="*.txt" 
        local-directory="." 
        remote-directory-expression="'my_bucket'"> 
    <int:poller fixed-rate="1000"/> 
</int-aws:s3-inbound-channel-adapter> 


<int:transformer input-channel="s3Channel" output-channel="kafkaChannel" 
     ref="myTransformer"/> 

<int-kafka:outbound-channel-adapter 
           kafka-template="template" 
           channel="kafkaChannel" 
           topic="foo" 
           message-key-expression="'bar'" 
           partition-id-expression="2"> 
</int-kafka:outbound-channel-adapter> 

<bean id="template" class="org.springframework.kafka.core.KafkaTemplate"> 
    <constructor-arg> 
     <bean class="org.springframework.kafka.core.DefaultKafkaProducerFactory"> 
      <constructor-arg> 
       <map> 
        <entry key="bootstrap.servers" value="localhost:9092" /> 
       </map> 
      </constructor-arg> 
     </bean> 
    </constructor-arg> 
</bean> 
+0

감사합니다! @Artem Bilan. 참조 코드를 구현하려고합니다. – samba

+0

좋아요! 그 때 대답을 수락 할 시간 : https://stackoverflow.com/help/someone-answers –