Question

I have a proxy, which take a RequestBean as argument, which contains a list property and I need to split this list property using split EIP.

I tried

    <split streaming="true">
        <simple>${body}</simple>
        <process ref="requestHeaderProcessor" />
    </split>

My Complete route is

<route id="httpBridge">
    <from uri="cxf:bean:splitterOperation?dataFormat=POJO" />
    <split streaming="true">
        <simple>${body}</simple>
        <bean ref="requestHeaderProcessor" method="process" />
    </split>
    <to uri="cxf:bean:realService" />
</route>

My Proxy Service method signature is

public List<ResponseBean> splitList(List<RequestContent> requestBean);

ResponseBean.java

ResponseBean {

private String name;

}

RequestBean.java

RequestBean {

private String list;

}

The processor is not receiving individual RequestContent, I want the processor to receive RequestContent individually.

tried printing following line and

System.out.println(exchange.getIn().getBody().getClass().getName());

and got java.util.ArrayList. So its 100% Iteratable.

But, when I print the

System.out.println(exchange.getIn().getBody());

I am getting

[webservice.RequestContent@10128f3, webservice.RequestContent@1277137]

Which is list of all the RequestContent.

But, why am I seeing the list in the bean, the Exchange must contain only one RequestContent according to split definition (Since, it processes sequentially).

Where am I making mistake. or is this the way it works. How can I make sure it splits the content?

How to achieve this?

Was it helpful?

Solution

Whatever this method returns is what is used for splitting

 <simple>${body.requestBean.requestContent}</simple>

So make sure that is a List or array, or can be iterated

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top