简体   繁体   English

没有参数的 Spring Integration Gateway

[英]Spring Integration Gateway with no arguments

On my gateway, I have a method在我的网关上,我有一个方法

@Gateway
String commsTest();

The idea is that I can call commsTest from the bean and use spring integration to wire it up to the service activator that will check comms.这个想法是我可以从 bean 调用 commsTest 并使用 spring 集成将它连接到将检查通信的服务激活器。

When I do that I get a receive is not supported, because no pollable reply channel has been configured error.当我这样做时,我得到一个receive is not supported, because no pollable reply channel has been configuredreceive is not supported, because no pollable reply channel has been configured错误。 I realise that this is because a method with no params means "I am trying to poll a message from the channel"我意识到这是因为没有参数的方法意味着“我正在尝试从频道轮询消息”

This is a two part question.这是一个两部分的问题。

  1. What does it mean to poll a message from the channel.从通道轮询消息是什么意思。
  2. How can I get the functionality I want.我怎样才能获得我想要的功能。

Spring Integration currently has no concept of a message without a payload. Spring Integration 目前没有没有有效载荷的消息的概念。 By default, a gateway method with no arguments implies you want to receive data (rather than sending data or sending and receiving data).默认情况下,不带参数的网关方法意味着您要接收数据(而不是发送数据或发送和接收数据)。

You can change that default behavior, as described in the reference documentation .您可以更改该默认行为,如参考文档中所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM