Announcement Announcement Module
Collapse
No announcement yet.
Specifying an output channel for a jms:outbound-channel-adapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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.

      Comment

      Working...
      X