Announcement Announcement Module
Collapse
No announcement yet.
Properties in xml configuration of spring integration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Properties in xml configuration of spring integration

    Hi,

    I want to use properties that I load (from a properties file let's say) using:
    <bean class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="location" value="classpath:file.properties"/>
    </bean>

    In some attributes in spring integration ,where you have a type check, I can't seem to use a variable. One example is the period attribute of the schedule element which is expected to be an integer. This prevents me from using a variable like ${poll.period}.

    Is there another way to go around this?

    Thanks,
    Marwan

  • #2
    The hard way around would be to define the component as a bean instead of using the namespace. The easy way (for you) would be to convince the developers that the convenience of property placeholders outweighs the safety of type checking in xml.

    If we remove the restriction from the xsd there would be no problem of course.

    Almost completely off-topic: did you check out
    Code:
    <context:property-placeholder/>
    ?
    Last edited by iwein; Aug 11th, 2008, 08:38 AM. Reason: using the code tags like a good boy :p

    Comment


    • #3
      I will try the piece of code you sent.

      So I get from your reply that the easy way (for me) is out of the question?

      Comment


      • #4
        There is an open issue for this in JIRA, so you can add your vote: http://jira.springframework.org/browse/INT-302

        Comment


        • #5
          Originally posted by marwan simaan View Post
          So I get from your reply that the easy way (for me) is out of the question?
          No no, as Mark mentioned, we do take you seriously and you're not alone. If pressured to take sides I'd probably side with you on this one.

          Comment


          • #6
            Also, this same general issue is on the roadmap for the Spring core: http://jira.springframework.org/browse/SPR-3180

            While losing the type-safety at the level of the XSD is unfortunate, the flexibility of using placeholders for common configuration elements that happen to be numeric or boolean is probably more important.

            -Mark

            Comment

            Working...
            X