2017-11-15 4 views
0

私はrabbitMQを使用してSpringバッチリモートチャンクを実装しようとしています。 I以下のINBOUNDため、このspring messaging xml configの同等のJava Config

<int:channel id="requests"/> 
<int:channel id="replies"/> 

<int-jms:message-driven-channel-adapter id="jmsIn" 
    destination-name="requests" 
    channel="requests"/> 

<int-jms:outbound-channel-adapter id="outgoingReplies" 
    destination-name="replies" 
    channel="replies"> 
</int-jms:outbound-channel-adapter> 

答えて

0

のための同等のJavaの設定が何であるか、このlink

:OUTBOUNDについては

@Bean(AMQP_INPUT_CHANNEL) 
public MessageChannel amqpInputChannel() { 
    return new DirectChannel(); 
} 

@Bean 
public AmqpInboundChannelAdapter inbound(SimpleMessageListenerContainer listenerContainer, 
             @Qualifier(AMQP_INPUT_CHANNEL) MessageChannel channel, 
             Jackson2JsonMessageConverter messageConverter) { 
    AmqpInboundChannelAdapter adapter = new AmqpInboundChannelAdapter(listenerContainer); 
    adapter.setMessageConverter(messageConverter);  
    adapter.setOutputChannel(channel); 
    return adapter; 
} 

@Bean 
public SimpleMessageListenerContainer container(ConnectionFactory connectionFactory) { 
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory); 
    container.setConcurrentConsumers(5);   
    container.setQueueNames("Queue_Name");   
    return container; 
} 

@Bean 
public MessageChannel amqpOutboundChannel() { 
    return new DirectChannel(); 
} 

@Bean 
@ServiceActivator(inputChannel = "amqpOutboundChannel") 
public AmqpOutboundEndpoint amqpOutbound(AmqpTemplate amqpTemplate) { 
    AmqpOutboundEndpoint outbound = new AmqpOutboundEndpoint(amqpTemplate); 
    outbound.setRoutingKey("ERROR-QUEUE"); 
    return outbound; 
} 

@MessagingGateway(defaultRequestChannel = "amqpOutboundChannel") 
public interface BatchServiceMessagingGateway { 
    void sendMessage(String data); 
} 
関連する問題