Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: xpath-router + malformed xml

  1. #11
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    You have two subscribers on errorChannel (the stderr adapter and your transformer); this means they will alternate (round robin dispatching).

    If you want to log as well as write to the file, define the error channel as publish/subscribe; that way, both subscribers get the messsage...

    Code:
    <int:publish-subscribe-channel id="errorChannel" />
    Otherwise, simply remove (or comment out) the stderr channel adapter.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  2. #12

    Default

    Sorry again ...

    I tried to define the error channel as publish/subscribe simply adding your suggestion before my def

    Code:
        <int:publish-subscribe-channel id="errorChannel" />
        <stream:stderr-channel-adapter channel="errorChannel" append-newline="true"/>
        <int:transformer input-channel="errorChannel" output-channel="errorToFileChannel"
           expression="payload.failedMessage"/>
        <int:channel id="errorToFileChannel"/>
        <file:outbound-gateway directory="file:${unmatchedMessageType.directory}"
                               request-channel="errorChannel" reply-channel="error-file"
                               filename-generator-expression.../>
        <int:channel id="error-file"/>
        <int:logging-channel-adapter channel="error-file"
                                     expression="..."
                                     level="ERROR"/>
    but the behaviour is still the same. I mean, I see the exception from log but I don't see the file channel is triggered ...

  3. #13
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    Please run with debug log and take a look at the message flow. If you can't figure it out from the log, please attach as a zip.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  4. #14

    Default

    I run with debug log and I got below additional info:

    Code:
    04.Jun.2012 18:08:21,895 - (JMS LISTENER SERVICE) (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) [WARN  ]-[AbstractMessageListenerContainer   (695 )] - Execution of JMS message listener failed, and no ErrorHandler has been set.
    org.springframework.integration.MessageDeliveryException: Dispatcher has no subscribers for channel errorToFileChannel.
    So the xpath-router raises correctly an error and the message-driven-channel-adapter caught it.
    I see also in the log the output from stderr-channel-adapter.
    No output instead from errorToFileChannel.

    I'm reviewing those errorChannel/transformer/errorToFileChannel/etc in order to figure out where I'm wrong ...

  5. #15
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    Right; if you look at the configuration carefully, you'll see the output channel of the transformer is errorToFileChannel, but you didn't change the file gateway to set this as its request-channel - it is still subscribed to the errorChannel.

    All components (endpoints) are connected together with channels - if you are using STS, click on the 'Integration Graph' tab you'll see a visual representation of your flow and errors like this will become very obvious.
    Last edited by Gary Russell; Jun 5th, 2012 at 06:53 AM.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  6. #16

    Default

    As always you are right :-)

    So I changed the file gateway to set the request-channel as "errorToFileChannel" and now it works as expected.

    Thanks again
    nuvola

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •