Aug 9th, 2011, 06:28 PM
Removing a ServiceActivator dynamically
I am using spring-integration 2.0.0.RELEASE and spring 3.0.5.RELEASE in my application. I am trying to create message endpoints dynamically which subscribe to a publish-subscribe channel. I am using @MessageEndpoint with @Scope("prototype") and spring bean ObjectFactory to create multiple instances of message endpoint dynamically. I have a method annotated by @ServiceActivator(inputChannel="channelName"). This works as expected for subscribing to message. I am able to create multiple subscribers dynamically and all of them receive the same message simultaneously.
But, while cleanup I am not able to unsubscribe from the channel. I still keep receiving the message on the service-activation of the cleaned up object. I tried to use the control-bus but I don't know how to specify the service-activator id for sending the stop() message.
Aug 10th, 2011, 05:28 AM
I'd be interested to recreate this, could you provide some more code snippets and config? Was it based on a sample or created from scratch.
Aug 10th, 2011, 06:55 AM
Yes a code snippet would be helpful. Also, what would be helpful is if you can explain your use case. THere might be a better way of solving it
I am a also concerned with 'prototype' setting which might not have the effect you expect
Tags for this Thread