Announcement Announcement Module
Collapse
No announcement yet.
Spring ApplicationEvent Support Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring ApplicationEvent Support

    Hi

    I would like to know how to have the namespace support int-event:.
    It is not mentioned in the last version document 2.0.0.RELEASE.

    I would like to know the proper way to send a message as an event to the application and as a message to an channel. Do I have to use a recipientListRouter ?

    Regards

  • #2
    Have you look at this http://static.springsource.org/sprin...plicationevent ?

    Comment


    • #3
      Event Support

      Hi

      After a look at the source code I am using this:


      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans" 
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      	xmlns:p="http://www.springframework.org/schema/p"
      	xmlns:si="http://www.springframework.org/schema/integration"
      	xmlns:si-event="http://www.springframework.org/schema/integration/event"
      	
      	xsi:schemaLocation="
      		http://www.springframework.org/schema/beans 
      		http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      		http://www.springframework.org/schema/integration
      		http://www.springframework.org/schema/integration/spring-integration.xsd
      		http://www.springframework.org/schema/integration/event
      		http://www.springframework.org/schema/integration/event/spring-integration-event.xsd">
      For my second question, I want an event to be fired every time a channel receives a message.
      The si-event:outbound-channel-adapter is fine but all my service-activator has to send their messages to that channel.

      I wanted to know if there was a simplest way to duplicate the message and have it send to two channels (another channel and the event channel).
      Otherwise I was going to use a recipientListRouter .

      Regards

      Comment


      • #4
        I am assuming that reason why you want to send it to two channels is because you need two actions performed once an event happens.
        All you need to do is have event adapter send message to a pub-sub channel and then have as many subscribers to that channel as you want.
        Code:
        <si-event:outbound-channel-adapter channel="fooChannel" .../>
        
        <si:publish-subscribe-channel id="fooChannel"/>
        
        <si:service-activator id="serviceA" input-channel="fooChannel".../>
        
        <si:service-activator id="serviceB" input-channel="fooChannel".../>
        In the above both service activators will react to the same event at the same time.
        Hope that helps

        Comment


        • #5
          Identify message's channel

          Hi

          Using topic with publish-subscribe-channel works fine

          Is it possible to have the inputChannel name in the message ?
          Or is there another way to identify the channel where the message commes from ? (maby add header-enricher)

          Regards

          Comment

          Working...
          X