消息没有回复

时间:2013-05-30 07:00:19

标签: spring-integration

该消息将没有任何回复。它只是将消息放在队列中,并且确实需要任何回复"单向"但是,如果消息处理失败,则需要回滚它以便其他服务器可以处理它。因此,为了处理该消息,我使用发布 - 订阅 - 频道,如下所示

 <int:publish-subscribe-channel id="SplitChannel">
 </int:publish-subscribe-channel>
 <int-jms:inbound-gateway request-channel="UChannel" request-destination-name="U" extract-request-payload="true" acknowledge="transacted" concurrent-consumers="5" max-messages-per-task="5"/>
 <int:chain input-channel="UChannel">
   <int-http:outbound-gateway
      url="http://localhost/u.php?fileid={fileid}"
      http-method="GET"
      reply-channel="nullChannel">
     <int-http:uri-variable name="fileid" expression="headers.fileid"/>
   </int-http:outbound-gateway>
 </int:chain>

我收到如下错误

DEBUG: [May-30 00:43:28,768] jms.listener.DefaultMessageListenerContainer - Initiating transaction rollback on application exception
javax.jms.InvalidDestinationException: Cannot determine reply destination: Request message does not contain reply-to destination, and no default reply destination set.
DEBUG: [May-30 00:43:28,768] apache.activemq.ActiveMQSession - 43979-1369895783067-0:15:1 Transaction Rollback

1 个答案:

答案 0 :(得分:2)

<gateway/>用于双向整合;通道适配器是单向的;请改用<int-jms:message-driven-channel-adapter/>