私は私の春の統合の設定をテストしようとしていますが、春の統合MessageDeliveryException
「MessageDeliveryException:Dispatcherは、チャネルのための加入者を持っていない」を受け付けております。
私はQueueChannelを使用していますが、私は(私がドキュメントで見ることができる)ハンドラが必要ではないと思います。
私はSpring Integration Java DSLを使用して、コンテキストを使用するのではなく、プログラムによって統合フローを定義しています。
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.channel.MessageChannels;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
public class SimplifiedIntegrationTest {
@Test
public void simpleTest() {
MessageChannel inputChannel = MessageChannels.direct().get();
QueueChannel outputChannel = MessageChannels.queue().get();
IntegrationFlows.from(inputChannel).channel(outputChannel).get();
inputChannel.send(MessageBuilder.withPayload("payload").build());
Message<?> outMessage = outputChannel.receive(0);
Assert.notNull(outMessage);
}
}