I need to read the message from the JMS Queue and filter Messages based on the JMSCorrelationID in the middle of the flow. So i used JMSReceiveNode. The JMSCorrelationID is dynamic. So i try to over ride the MessageCorrelationIDSelector via java compute node as below. I added the correlationid tree in the local environment.
My java Compute node code:
localEnv.getRootElement().createElementAsLastChild(MbElement.TYPE_NAME, "JMS", null).
createElementAsLastChild(MbElement.TYPE_NAME, "Receive", null).
createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "MessageCorrelationIDSelector", dynamicID);'
But am getting JMS destinaiton not found exception. If i remove the local MessageCorrelationIDSelector from local environment its works fine.
The local Environment tree as below
'LocalEnvironment
JMS
Receive MessageCorrelationIDSelector:CHARACTER:123457
LocalEnvironment
JMS
Receive
MessageCorrelationIDSelector:CHARACTER:='1111'
Source:CHARACTER:createArrangementQueue
QCF:CHARACTER:jms/RemoteConnectionFactory
JNDIBindingLocation:CHARACTER:http-remoting://localhost:9089
InitialContextFactory:CHARACTER:org.jboss.naming.remote.client.InitialContextFactory
JMSProvider:CHARACTER:jboss71JMS
As @Jérém mentioned its working fine. We need to override all the properties as like above.