Results 1 to 4 of 4

Thread: JMS Outbound Adapter : Destination Name : SPEL not supported?

  1. #1
    Join Date
    Aug 2011
    Location
    Auckland, NZ
    Posts
    15

    Default JMS Outbound Adapter : Destination Name : SPEL not supported?

    Hi,
    Is there a way I can specify a destination on the jms outbound adapter using a header property? I couldn't find anything related to this in the reference documentation or the samples. Not sure if this is supported? I'd really appreciate any inputs. Thanks.


    Code:
    <int-jms:outbound-channel-adapter
    	explicit-qos-enabled="true" 
    	extract-payload="true" connection-factory="connectionFactory" 
    	id="SOME.ID" 
    	channel="SOME.CHANNEL"
    	destination="#{headers.queueName}" />
    I couldn't get this to work. I get this exception :

    Code:
    org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Field or property 'headers' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext'
    Cheers!

  2. #2
    Join Date
    Aug 2011
    Location
    Auckland, NZ
    Posts
    15

    Default

    Hi,
    Should I be writing my own JMS Outbound Adapter to be able to specify a Queue at runtime? Just checking if there's an easier option before I head that way. I don't want to create N outbound adapters for N Queues, the number of queues could be quite large. Thanks.

    Cheers!

  3. #3
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    In 2.1 M2, we added a "destination-expression" attribute to the outbound-channel-adapter with the Message itself as the root object of evaluation. For the example given above, you would provide something like: destination-expression="headers.queueName"

  4. #4
    Join Date
    Aug 2011
    Location
    Auckland, NZ
    Posts
    15

    Default

    Great, thanks. I really appreciate your response.

Posting Permissions

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