I have not been able to lay my hands on a complete tutorial that explains how
to create a recipientlist osgi bundle.

What I rily like to do is shown below:

jms:queue -> recipientlist

I am building using maven which I am a lil new to as well, so I'll
appreciate if pointers are shown how to also compile (if java bean is used
for loading dynamic routes) the java class.

Here is what I think my camel-context.xml should look like.

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
                <property name="connectionFactory" ref="jmsConnectionFactory"/>
        </bean>

        <bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
                <property name="alwaysSessionAsync" value="true"/>
                <property name="alwaysSyncSend" value="false"/>
                <property name="brokerURL" value="tcp://localhost:61616"/>
        </bean>

<bean id="recipientList" class="com.services.RouteBuilder"/>

        <osgi:camelContext
xmlns="http://activemq.apache.org/camel/schema/spring";>
                <route>
                        <from uri="jms:queue:requestQueue" />
                        <to uri="recipientList" />
                </route>
        </osgi:camelContext>

        <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />

is the bold line correct? I expect whatever routes defined in the routes
have messages sent to them.

Content of route builder class
public class RouteBuilder {

        @RecipientList
    public String[] route(String body) {
        return new
String[]{"jbi:endpoint:http://services.com/nauService/endpoint?mep=in-out"};
    }

}

Are the route routes returned by the java class supposed to be endpoint
names defined in the bean.xml files or full endpoint name as registered by
NMR (It seems they are not always the same). Can they also e ordinary
service names as defined in the bean.xml files?

kr.
-- 
View this message in context: 
http://old.nabble.com/how-to-create-a-dynamic-recipient-list-using-a-java-bean-tp26408382p26408382.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to