Announcement Announcement Module
Collapse
No announcement yet.
ServiceActivator without a reply - quick q Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ServiceActivator without a reply - quick q

    Hi all,

    Here is my SI config. Everything works well, except, in my ServiceActivator endpoint, I am returning void on the processAndPersistMessage method.
    I know that ServiceActivator relies on a reply being generated. In my case, no reply is needed, the endpoint is where I want things to end for this chain. Is it ok then that I get this DEBUG message? Or should I be using something else?
    ============================================
    DEBUG - AbstractReplyProducingMessageHandler.handleMessage Internal(98) | handler 'ServiceActivator for [org.springframework.integration.handler.MessageMap pingMethodInvoker@10697e2]' produced no reply for request Message: [Payload=org.springframework.integration.message.Me ssageHandlingException: error occurred in message handler [ServiceActivator for [org.springframework.integration.handler.MessageMap pingMethodInvoker@1387c6]]][Headers={springintegration_id=bc97daa8-1b2d-42b2-9a49-a0da982bf2d5, springintegration_timestamp=1248166198900}]
    DEBUG - AbstractMessageChannel$ChannelInterceptorList.post Send(169) | postSend (sent=true) on channel 'persistentAdapterErrorMessageChannel', message: [Payload=org.springframework.integration.message.Me ssageHandlingException: error occurred in message handler [ServiceActivator for [org.springframework.integration.handler.MessageMap pingMethodInvoker@1387c6]]][Headers={springintegration_id=bc97daa8-1b2d-42b2-9a49-a0da982bf2d5, springintegration_timestamp=1248166198900}]


    ============================================


    <int:inbound-channel-adapter
    ref="messageAdapter"
    method="getNextMessage"
    channel="transformChannel">

    <intoller>
    <int:interval-trigger interval="20000"/>

    <int:transactional transaction-manager="transactionManager"
    propagation="REQUIRES_NEW" />
    </intoller>
    </int:inbound-channel-adapter>

    <!-- The messages read from the dao are put on this channel. -->
    <int:channel id="transformChannel" />

    <int:chain input-channel="transformChannel">
    <int:header-enricher error-channel="persistentAdapterErrorMessageChannel" />

    <int:service-activator
    ref="messageAdapter"
    method="processAndPersistMessage"/>
    </int:chain>

  • #2
    You are correct, SA may or may not produce the output. In other words 'void' is an OK return type.
    Having said that, I was trying to replicate your issue by using your exact configuration and creating dummy SA etc. . and I observe totally different output:
    Code:
    Getting next message
    DEBUG: org.springframework.integration.channel.DirectChannel - preSend on channel 'transformChannel', message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035}]
    DEBUG: org.springframework.integration.transformer.MessageTransformingHandler - org.springframework.integration.transformer.MessageTransformingHandler@3dc4d5 received message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035}]
    DEBUG: org.springframework.integration.transformer.MessageTransformingHandler - handler 'org.springframework.integration.transformer.MessageTransformingHandler@3dc4d5' sending reply Message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035, springintegration_errorChannel=persistentAdapterErrorMessageChannel}]
    DEBUG: org.springframework.integration.channel.DirectChannel - preSend on channel '_org.springframework.integration.handler.MessageHandlerChain#0.channel#0', message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035, springintegration_errorChannel=persistentAdapterErrorMessageChannel}]
    DEBUG: org.springframework.integration.handler.ServiceActivatingHandler - ServiceActivator for [org.springframework.integration.handler.MessageMappingMethodInvoker@7db754] received message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035, springintegration_errorChannel=persistentAdapterErrorMessageChannel}]
    DEBUG: org.springframework.integration.util.DefaultMethodInvoker - Invoking method [public void org.springframework.integration.forum.int_75112.SampleSA.processAndPersistMessage(java.lang.String)] with arguments [{Hello}]
    Message persisted
    so if you can provide more details. . .

    Comment


    • #3
      Originally posted by oleg.zhurakousky View Post
      You are correct, SA may or may not produce the output. In other words 'void' is an OK return type.
      Having said that, I was trying to replicate your issue by using your exact configuration and creating dummy SA etc. . and I observe totally different output:
      Code:
      Getting next message
      DEBUG: org.springframework.integration.channel.DirectChannel - preSend on channel 'transformChannel', message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035}]
      DEBUG: org.springframework.integration.transformer.MessageTransformingHandler - org.springframework.integration.transformer.MessageTransformingHandler@3dc4d5 received message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035}]
      DEBUG: org.springframework.integration.transformer.MessageTransformingHandler - handler 'org.springframework.integration.transformer.MessageTransformingHandler@3dc4d5' sending reply Message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035, springintegration_errorChannel=persistentAdapterErrorMessageChannel}]
      DEBUG: org.springframework.integration.channel.DirectChannel - preSend on channel '_org.springframework.integration.handler.MessageHandlerChain#0.channel#0', message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035, springintegration_errorChannel=persistentAdapterErrorMessageChannel}]
      DEBUG: org.springframework.integration.handler.ServiceActivatingHandler - ServiceActivator for [org.springframework.integration.handler.MessageMappingMethodInvoker@7db754] received message: [Payload=Hello][Headers={springintegration_id=0fc7a8c7-2a47-4815-a4b5-7913ee686727, springintegration_timestamp=1248178368035, springintegration_errorChannel=persistentAdapterErrorMessageChannel}]
      DEBUG: org.springframework.integration.util.DefaultMethodInvoker - Invoking method [public void org.springframework.integration.forum.int_75112.SampleSA.processAndPersistMessage(java.lang.String)] with arguments [{Hello}]
      Message persisted
      so if you can provide more details. . .
      Thanx so much for your response oleg..
      And...
      Ah, you are right!!!
      Sorry, i ommitted the very crux of the issue....
      I only get that error output, as in my original post, when an exception occurs, and I then handle the error using the 'handleFailedMessage' method. So, then, its only under an exception condition, that i get the error output.
      Normal operation works perfectly fine ....
      Is this acceptable behaviour?

      <int:channel id="persistentAdapterErrorMessageChannel" />

      <int:service-activator input-channel="persistentAdapterErrorMessageChannel"
      ref="messageAdapter"
      method="handleFailedMessage"/>

      Comment

      Working...
      X