Announcement Announcement Module
Collapse
No announcement yet.
creating custom handler equivalent to a set of message handlers Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • creating custom handler equivalent to a set of message handlers

    Hi ,

    I realized that in about 70% our use cases we need a certain combination of spring integration components/handlers (e.g amp gateway, xml or jason transformer, a payload type router and few service activators).

    As below:
    Code:
    <int-amqp:inbound-gateway request-channel="inputChannel" queue-names="someQName" />
    
    <int:chain id="xml2Obj" input-channel="inputChannel"  output-channel="servicesChannel" >
    <int-xml:unmarshalling-transformer unmarshaller="jaxbMarshaller" />
    <int:service-activator expression="payload.getValue()"></int:service-activator>
    </int:chain>
    
    <int:payload-type-router input-channel="servicesChannel">
    	<int:mapping type="org.me.Type1" channel="service1Channel" />
    	<int:mapping type="org.me.Type2" channel="service2Channel" />
      	<int:mapping type="org.me.Type3" channel="service3Channel" />
    </int:payload-type-router>
    
    <int:service-activator id="service1"  input-channel="service1Channel"  ref="serviceImpl" method="serviceMethod1" output-channel="serviceOutChannel" />	
    <int:service-activator id="service2"  input-channel="service2Channel" ref="serviceImpl" method="serviceMethod2"  output-channel="serviceOutChannel"/>	
    <int:service-activator id="service3"  input-channel="service3Channel" ref="serviceImpl" method="serviceMethod3"  output-channel="serviceOutChannel"/>
    So, instead of wiring up these exact series of components for all my use cases, I am interested in developing a custom component or namespace handler so that we can use this out-of-box for all our use cases.

    Some thing like
    Code:
    <int-myService:serviceActivator bean ="someBeanWhichProvidesImplementation" amqp-Q="someAmqpQueueName"  methods="m1,m2,m3,m4,m5" />
    behind the scene, i want to retrieve messages from amp broker, transform the payload (say xml to java objects), route the message to appropriate method based on payload type.

    But i am not sure how to come up with such a coarse grained message handler, which internally employee these component to serve requests.

    The idea of using such a component is, this is the exact set of steps we need to do 60% to 70% of the time, and don't want to configure this every time for various use cases.


    I can of course do this with help of a velocity template but my idea is to come up with a custom message handler for this pattern.


    Can you please guide on how i should be going about this?
    Last edited by kkcmadhu; Jan 15th, 2012, 01:13 AM.
Working...
X