Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring integration 带void方法返回类型的Spring集成网关:为什么不';它不会自动设置一个空通道replyChannel吗?_Spring Integration_Void_Gateway_Spring Integration Http - Fatal编程技术网

Spring integration 带void方法返回类型的Spring集成网关:为什么不';它不会自动设置一个空通道replyChannel吗?

Spring integration 带void方法返回类型的Spring集成网关:为什么不';它不会自动设置一个空通道replyChannel吗?,spring-integration,void,gateway,spring-integration-http,Spring Integration,Void,Gateway,Spring Integration Http,使用Spring integration 4.3.x,我有一个这样的集成流程: <int:gateway> => <int:transformer> => <int-http:outbound-gateway> => <int:transformer> => return to the gateway 我搜索了很多,阅读了SI文档并进行了调试,最终得出结论:org.springframework.integration.g

使用Spring integration 4.3.x,我有一个这样的集成流程:

<int:gateway> => <int:transformer> => <int-http:outbound-gateway> => <int:transformer> => return to the gateway
我搜索了很多,阅读了SI文档并进行了调试,最终得出结论:
org.springframework.integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(MethodInvocation,boolean)
,这基本上是这样做的:如果需要回复,请执行“发送和接收”,否则执行简单的“发送”。前者设置
replyChannel
头,后者不设置

这是有道理的,但是。。。在后一种情况下,为什么不直接自动设置
NullChannel
replyChannel
头?我不完全理解的是,这种行为(即:每当流产生无法转换为网关响应的响应时获取异常)是否是理想的行为,因为我在文档中找不到任何提及。文档似乎建议忽略任何回复,但事实并非如此,我现在需要在链中放置一个转换器,每当我检测到不返回任何实际响应时,设置
NullChannel
replyChannel
头。。。事实上,这是我期望门户为我做的事情。事实上,网关中的void方法似乎只有在将适配器作为最终流端点时才能“开箱即用”


也许我遗漏了什么,所以这就是这个问题的原因。

这是一个有趣的建议(
replyChannel
标题中的
NullChannel

我们必须考虑是否会有一些意想不到的后果

同时,您应该能够使用

@Gateway(headers = @GatewayHeader(name = MessageHeaders.REPLY_CHANNEL,
    expression = "@nullChannel"))
void foo(String bar);

这是一个有趣的建议(
replyChannel
标题中的
NullChannel

我们必须考虑是否会有一些意想不到的后果

同时,您应该能够使用

@Gateway(headers = @GatewayHeader(name = MessageHeaders.REPLY_CHANNEL,
    expression = "@nullChannel"))
void foo(String bar);

请提出一个问题:我们会考虑的!谢谢你,Gary,这确实是我正在做的事情(尽管当我确定不需要回复时,我会在下游做这件事……这是另一个故事)@阿滕比兰我开了,谢谢!请提出一个问题:我们会考虑的!谢谢你,Gary,这确实是我正在做的事情(尽管当我确定不需要回复时,我会在下游做这件事……这是另一个故事)@阿滕比兰我开了,谢谢!