Hi

I'm new to servicemix and need some help.
Currently i'm trying to implement splitter and aggregator using camel
components.

Suppose i have a POJO, Organization which contains a list of Employee POJOs.
Can i pass instance of POJO Organization in the message exchange from
endpoint A, and get unmarshalled POJO Organization directly from message
body from exchange at endpoint B.

Essentially, i want to avoid processing xml at each endpoint using XPATH.

I looked at post
http://www.nabble.com/Better-Aggregator-support-p12564277s22882.html
which shows below mentioned code

private Expression getSplitterExpression () {
                Expression splitterExpression = new Expression(){
            public Object evaluate(Exchange exchange) {
                BBScoringRequest bbScoringRequest = (BBScoringRequest)
exchange.getIn().getBody();
                JmsExchange jmsExchange = (JmsExchange) exchange;
                javax.jms.Message jmsMessage =
jmsExchange.getIn().getJmsMessage();
                try {
                    String jmsMessageID = jmsMessage.getJMSMessageID();
                    jmsMessage.setJMSCorrelationID(jmsMessageID);
                } catch (JMSException e) {
                    throw new RuntimeException(e);
                }
                return bbScoringRequest.getRequest().getParties();
            }
        };
        return splitterExpression;
        }
        
        private Expression getAggregatorExpression () {
                Expression aggregatorExpression = new Expression(){ 
                        public Object evaluate(Exchange exchange) {
                                PartyType party = (PartyType) 
exchange.getIn().getBody();
                                JmsMessage in = (JmsMessage) exchange.getIn();
                                String jmsCorrelationID = null;
                            try {
                    jmsCorrelationID =
in.getJmsMessage().getJMSCorrelationID();
                } catch (JMSException e) {
                    throw new RuntimeException(e);
                }
                return jmsCorrelationID + party.getID();
            }
        }; 
        return aggregatorExpression;
        }


when i tried using it, i dont get POJOs from message exchange rather get
DomSource object.

Request any help on this.

best regards
taran
-- 
View this message in context: 
http://www.nabble.com/POJO-in-message-exchange-tp17325871p17325871.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to