Results 1 to 5 of 5

Thread: Killing of services once execution is complete

Hybrid View

  1. #1

    Post 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. #2
    Join Date
    Apr 2008
    Posts
    174

    Default

    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!!

  3. #3

    Default

    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"/>

  4. #4
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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.)

  5. #5

    Default

    Cheers David this worked!

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

Tags for this Thread

Posting Permissions

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