-
Jun 26th, 2009, 08:23 AM
#1
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
-
Jun 26th, 2009, 04:09 PM
#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!!
-
Jun 29th, 2009, 03:54 AM
#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">
<beans
roperty name="channels">
<beans:list>
<beans:ref bean="OpenTextService1"/>
</beans:list>
</beans
roperty>
</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"/>
-
Jun 29th, 2009, 11:40 AM
#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.)
-
Jun 30th, 2009, 04:05 AM
#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!
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
-
Forum Rules