Announcement Announcement Module
Collapse
No announcement yet.
JMS Outbound Adapter : Destination Name : SPEL not supported? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


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

      Comment


      • #4
        Great, thanks. I really appreciate your response.

        Comment

        Working...
        X