[英]How to get failedMessage from the payload in the ErrorMessage in spring cloud stream kafka?
[英]How get channel object from spring cloud stream in my test
我已經定義了下面的TestChannel接口
public interface TestChannel {
String CHANNEL_NAME = "test.channel";
@Input(value = CHANNEL_NAME)
SubscribableChannel channel();
}
我嘗試在測試中自動連線此頻道。
@SpringBootTest
public class TestChannelHandlerTest extends BaseTest {
@Autowired
private TestChannel testChannel;
@Test
public void someTest() {
...
}
}
但是TestChannel
bean。 我的問題是:如何為所有頻道自動接線。
將@Qualifier("test.channel")
添加到@Autowired
。
如果名稱為testChannel
則testChannel
。
您還需要在某個地方使用@EnableBinding(TestChannel.class)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.