没有参数的 Spring Integration Gateway [英] Spring Integration Gateway with no arguments

查看:16
本文介绍了没有参数的 Spring Integration Gateway的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网关上,我有一个方法

On my gateway, I have a method

@Gateway
String commsTest();

这个想法是我可以从 bean 调用 commsTest 并使用 spring 集成将它连接到将检查通信的服务激活器.

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.

当我这样做时,我得到一个 receive is not supported, because no pollable reply channel has been configured 错误.我意识到这是因为没有参数的方法意味着我正在尝试从频道轮询消息"

When I do that I get a receive is not supported, because no pollable reply channel has been configured error. 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. 从频道轮询消息是什么意思.
  2. 如何获得我想要的功能.

推荐答案

Spring Integration 目前没有没有负载的消息的概念.默认情况下,不带参数的网关方法意味着您要接收数据(而不是发送数据或发送和接收数据).

Spring Integration currently has no concept of a message without a payload. 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.

这篇关于没有参数的 Spring Integration Gateway的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆