Results 1 to 5 of 5

Thread: Spring Integration and custom namespace ...

  1. #1
    Join Date
    Jan 2012
    Location
    Clermont-Ferrand, France
    Posts
    6

    Default Spring Integration and custom namespace ...

    Hi,

    I did a custom namespace for my project.

    within this project I want to declare that kind of things :

    Code:
    <mynamespace:rest-service input-channel="chan1" />
    or in a chain :

    Code:
    <int:chain id="mychainid" input-channel="in"
    		output-channel=out">		
        <mynamespace:rest-service />
    </int:chain>
    which would be translated to spring integration xml as :

    Code:
    <int:service-activator ref="abeanreference" method="theMethodToCall" />
    ...
    <bean id="abeanreference" class="the.rest.service.caller.implementation" />
    So I would like to know what to put in the "BeanDefinitionParser" to be able to register the service-activator. I checked the sources for Service Activator when xml is parsed but .. I don't understand what happens with the BeanDefinitionBuilder ... As far as I understood, it uses a bean factory but ... I can't figure out how to do it myself and to be sure that it will also work in a chain.

    I would like some tips or advices about that ... what should I do ? and is this a good practice or not ?
    Franck MARCHAND

  2. #2
    Join Date
    Jan 2012
    Location
    Clermont-Ferrand, France
    Posts
    6

    Default

    Any idea ?
    Franck MARCHAND

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

    Default

    Franck

    If you look at he schema you'll see that 'chain-type' is limited to the list of element names that belong to SI namespace.
    It would be nearly impossible for us to allow any other namespaces since we don't know what is the end product of this namespace. In other words it may be valid for your use case but it could be completely invalid for other and we would have no way of controlling it at he framework level.

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

    Default

    My bad

    Jumped to quickly and was pointed out that we have this in schema
    Code:
    <xsd:complexType name="chain-type">
                    <xsd:choice minOccurs="1" maxOccurs="unbounded">
                            <xsd:any processContents="strict" namespace="##other" minOccurs="0" maxOccurs="unbounded" />
    So, this means it has to work.

    Are you getting any exception?

  5. #5
    Join Date
    Jan 2012
    Location
    Clermont-Ferrand, France
    Posts
    6

    Default

    Hi,

    I don't have any exception because I just don't know how to declare my Bean within the BeanBuilder to be a service-activator.

    Even if I knew, I don't know if I have to handle input/output channel of the service-activator if it is within a chain.
    Franck MARCHAND

Posting Permissions

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