Announcement Announcement Module
Collapse
No announcement yet.
Killing of services once execution is complete Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Killing of services once execution is complete

    I have a some services

    I have a reader that when an file is read it creates an object this object then gets packaged into a message
    Which gets sent to a splitter which duplicates the message putting a header on the messager header saying what service it shouls be sent to

    THen goes into a routing object which actually sends the message

    Then have the service that recives the object for processing
    This is all threaded so 4 services can be executing concurrently

    Issues is that on execution completion i drip out of main but process continues executing (from presumable the services are still lying in wait for messages)

    How do i take down these services for execution completion

  • #2
    Well, even though the workflow was really not clear, from design perspective I can give you some input.

    There should be a central repository where all your services are registered and at afterStep (hopefully this is what you mean by execution completion) you can stop all the services from the repository.

    Hope that was helpful!!

    Comment


    • #3
      Hello thanks for the response

      Sorry if i was not clear i have this config setup where OpenTextService bean has method service which takes object that the reader returns and is denoted with @serviceActivator

      I want something like @serviceDeactivator maybe

      <beans:bean id="writer" class="com.correspondenceRoutingService.io.writing .SimpleWriter" />
      <annotation-config />
      <channel id="requests" />
      <channel id="splits" />
      <channel id="OpenTextService1"/>
      <channel id="results" />
      <channel id="replies">
      <queue />
      </channel>

      <splitter input-channel="requests" output-channel="splits" ref="splitter"/>
      <beans:bean id="splitter" class="com.correspondenceRoutingService.ScatterSpl itter">
      <beansroperty name="channels">
      <beans:list>
      <beans:ref bean="OpenTextService1"/>
      </beans:list>
      </beansroperty>
      </beans:bean>

      <service-activator input-channel="OpenTextService1"
      output-channel="results" ref="OpenTextService" />
      <beans:bean id="OpenTextService" class="com.correspondenceRoutingService.services.O penTextService" p:label="OpenTextService"/>

      Comment


      • #4
        Spring Integration normally shuts down cleanly for me. Did you create the ApplicationContext? If so did you call ConfigurableApplicationContext.close()?

        You could try posting on the Integration forum, since I think the issue is just usage of that framework. Maybe you need to show more configuration as well (like scheduler / task executor set up and the ApplicationContext handling code)?

        (Please use [code][/code] tags to post code and stack traces.)

        Comment


        • #5
          Cheers David this worked!

          I was using ApplicationContext opposed to ConfigurableApplicationContext just switched over and called close after finished and worked a treat. thanks!

          Comment

          Working...
          X