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

Thread: Using header-enricher for priority with spring-integration 2.1.0

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

    Default

    Yes; if you use
    Code:
    <header-enricher input-channel="replyChannelInput" output-channel="echoInput">
    	<priority value="2"/>
    </header-enricher>
    You get an Integer. But if you do what the OP did

    Code:
    <header-enricher input-channel="in" output-channel="out">
    	<header name="priority" value="7"/>
    </header-enricher>
    You get a String (you can fix this with an expression).

    Given that we have a well-known header <priority/>, that works correctly (aside from the schema issue), that is a better way to solve the issue than using an expression.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  2. #12
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,016

    Default

    By the way, another solution is to explicitly type the header...

    Code:
    	<header name="priority" value="7" type="java.lang.Integer" />
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #13
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Good catch Gary, but we can actually fix that as well. Look at MessageBuilder.verifyType(..). So I'll fix it and will add a test to MessageBuilderTests

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
  •