Hi,
I have queue channel defined as:
In some code I retrieve the channel via the application context as:Code:channel id="myChannel"> <queue capacity="100"/> </channel>
I don't use the PollableChannel interface because I need to call the clear() method on the queue.Code:QueueChannel myChannel = (QueueChannel ) ctx.getBean("myChannel");
All was good until I tried to add JMX support as:
Since then I get a ClassCastException:Code:<jmx:mbean-export default-domain="com.mypackage" server="mbeanServer"/> <beans:bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"> <beans:property name="locateExistingServerIfPossible" value="true"/> </beans:bean>
java.lang.ClassCastException: $Proxy224 cannot be cast to org.springframework.integration.channel.QueueChann el
If I use the interface (PollableChannel) I avoid the error but I can't execute clear() method.
żIs there any way to workaround this get my channel as a QueueChannel?
Thanks in advance.


Reply With Quote