Results 1 to 3 of 3

Thread: Specifying an output channel for a jms:outbound-channel-adapter

  1. #1
    Join Date
    May 2010
    Posts
    24

    Default Specifying an output channel for a jms:outbound-channel-adapter

    Hi - I have a use case where I want to put a message on to an output queue then update a record in the database to record the fact that the message has been sent. I'm using a <jms:outbound-channel-adapter> for putting the message on to the queue, but then I want to route the message on to another channel after that (synchronously). Then I would use a service-activator on that channel to do the 'post-send' database update. As far as I can see, however, an outbound-channel-adapter must be the terminal node in the pipeline -- I don't see any way to specify an output channel following the outbound adapter.

    I have tried setting the input-channel of my service-activator to be the same as the channel defined for the channel adapter (see below), but that results in messages arbitrarily being routed to either the adapter or the service-activator, rather than one followed by the other.

    Code:
    	<service-activator input-channel="publicationOutputChannel"
    						ref="publicationLogUpdater"
    						method="updatePublicationLog"
    						output-channel="nullChannel"  
    						auto-startup="true"/>
    
    	<jms:outbound-channel-adapter id="jmsOut" jms-template="jmsOutTemplate" channel="publicationOutputChannel"/>
    Please advise...

    Thanks
    -Matt

  2. #2
    Join Date
    Nov 2008
    Location
    Swansea, Wales
    Posts
    202

    Default

    Have you tried doing the database update first and the putting the message on the queue last? If the jms part fails then the database call will be rolled back if it's all in the same transaction

  3. #3
    Join Date
    May 2010
    Posts
    24

    Default

    Yes, I've considered that approach, and that may be what I have to do in this case, but I'm still surprised there isn't a facility to route messages onward from an outbound channel. I appreciate that in most use cases, once you've routed a message to the output channel, the processing is complete, but there will be some cases where some additional processing is required after the output channel.

Tags for this Thread

Posting Permissions

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