当消息发送到转发队列/从转发队列接收时,我想创建一个简单的测试。收到消息后,应调用服务。
不幸的是,消息已发送Message<?> message = MessageBuilder.withPayload(params); forwardGateway.sendPremMessage(message);
但未收到。
这是我的配置:
<!-- SENDER -->
<si:gateway id="forwardGateway"
service-interface="com.ucware.ucpo.forward.jms.MessageGateway"
default-request-channel="inputChannel"/>
<si:channel id="inputChannel"/>
<!-- Subscriber to a channel -->
<int-jms:outbound-channel-adapter
channel="inputChannel"
connection-factory="connectionFactory"
destination-name="FORWARD" />
<!-- RECEIVER -->
<int:channel id="jmsInChannel"/>
<!-- Subscriber to jmsInChannel. Used instead of inboud channel adapter -->
<int-jms:message-driven-channel-adapter id="messageDrivenAdapter"
channel="jmsInChannel" destination-name="FORWARD" connection-factory="connectionFactory"
concurrent-consumers="1" auto-startup="true" acknowledge="auto"/>
// This service should be invoked but it is not
<si:service-activator id ="activator"
input-channel="jmsInChannel"
ref="messageService"
method="process"/>
服务定义为:
@MessageEndpoint
public class MessageService {
public void process(Message<?> message )
} 和网关为:
public interface MessageGateway {
@Gateway
public void sendPremMessage(Message<?> message);
}