L.S.,

The file you're using here contains a full container definition. You can use it for static configuration (where you specify everything in a file and then run the container from that file), but from your mail I gather you want to use ServiceMix in a stand-alone way as a container and then deploy SA to it.

I would also recommend you to use the JBI components (as is shown in the tutorials) rather than the lightweight components. Perhaps you can take a look at http://servicemix.apache.org/2-beginner-using-maven-to-develop-jbi-applications.html for a introduction in building SU/SA with Maven as that will no doubt clarify things for you.

Regards,

Gert

smo001 wrote:
Hi all,

i have got a question about how to read files into a jbi container. I'd like
to read a file from a directory with a filepoller. Then it should be send to
an eip pipeline for xslt transformation and the transformed object should
delivered to JMS endpoint (a ActiveMQ Messagequeue). I took the example from
http://servicemix.apache.org/creating-a-protocol-bridge-30.html and added a
filepoller SU. The example uses a http SU to send an input.

Is it the right way to use the pipeline example to create a solution for my
problem? An how to implement the filepoller? I understand it like this, that
i have to put my file into a message container to send it to the next
service, is that right?

Actual my filepoller is like this, but i get an error "No endpoint found" in
the filepoller-su.

<?xml version="1.0" encoding="UTF-8"?>

<!-- XBean.xml -->

<beans xmlns:f="http://servicemix.apache.org/file/1.0";
       xmlns:b="http://servicemix.apache.org/formattransform/bridge";
           xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd";>
        <!-- the JBI container -->
        <container id="jbi">
                <property name="useMBeanServer" value="true"/>
                <property name="createMBeanServer" value="true"/>
                <property name="dumpStats" value="true"/>
                <property name="statsInterval" value="10"/>
                <!--property name="transactionManager" 
ref="transactionManager"/-->
                
                <components>
                        <!-- Look for files in the inbox directory -->
                        <component id="FilePoller" service="b:FilePoller"
class="org.servicemix.components.file.FilePoller">
                                <property name="targetService" 
value="b:outputSender"/>
                                <property name="targetEndpoint" value="endpoint" 
/>
                                <property name="endpoint" value="FilePoller"/>
                                
                                <property name="workManager" ref="workManager"/>
                                <property name="file" 
value="file:///C:\Servicemix\inbox_opentrans"/>
                                <property name="period" value="20000"/>
                                <property name="filter">
                                        <bean 
class="org.apache.commons.io.filefilter.WildcardFilter">
                                                <constructor-arg value="*.xml"/>
                                        </bean>
                                </property>
</component> <!-- Publish the result to a JMS destination -->
                <component id="outputSender" service="b:outputSender"
class="org.servicemix.components.jms.JmsSenderComponent">
<property name="targetService" value="b:EipPipeline"/> <property name="targetEndpoint" value="endpoint"/>
                        <property name="endpoint" value="endpoint"/>
                        
                        <property name="template">
                                <bean 
class="org.springframework.jms.core.JmsTemplate">
                                        <property name="connectionFactory">
                                                <ref local="jmsFactory"/>
                                        </property>
                                        <property name="pubSubDomain" 
value="true"/>
                                        <property name="deliveryModePersistent" 
value="true"/>
                                        <property name="priority" value="4"/>
                                        <property name="timeToLive" value="0"/>
                                </bean>
                        </property>
                </component>      
                        
</components> </container>
        
        <bean id="transactionManager"
class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="java:comp/env/smx/TransactionManager"/> </bean>
        
        <bean id="jmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
                <property name="connectionFactory">
                        <bean 
class="org.apache.activemq.ActiveMQConnectionFactory">
                                <property name="brokerURL">
                                        <value>tcp://localhost:61616</value>
                                </property>
                        </bean>
                </property>
        </bean>
        
        <bean id="workManager" 
class="org.jencks.factory.WorkManagerFactoryBean">
                <property name="threadPoolSize" value="30"/>
                <property name="transactionManager" ref="transactionManager" />
</bean> </beans>

Thanks for your help
Greetz

Reply via email to