I'm confused by what you mean with consumerURI and targetURI.  Is the
consumer the "client" or the "server"?  In my scenario, I've got a server
that is pumping out XML messages over TCP periodically.  Note, the server
already exists in the enterprise and is not part of my solution, i'm just
trying to connect to it.

I'd like to use spring configuration for my solution.  Right now I've got
something in place that works most of the time...but I think I'm missing
some messages.  My current solution has a timer in place that fires every 10
seconds.  The timer routes to a MinaEndpoint.  The MinaEndpoint has a a
custom filter attached to it that parses the message and acts on it.

The end game is to have a TCP monitor that blocks until a message is
received from the server and then takes action.  Once a message is received,
the TCP monitor starts up again and the process is repeated.

Here's my springclient.xml file:

............................
<bean id="minaFactory"
class="org.apache.camel.component.mina.MinaComponent">
  <constructor-arg index="0" ref="camel"/>
</bean>
<bean id="minaEndpoint" factory-bean="minaFactory"
factory-method="createEndpoint">
  <constructor-arg index="0" ref="minaConfig"/>
</bean>
<bean id="minaConfig"
class="org.apache.camel.component.mina.MinaConfiguration">
  <property name="protocol" value="tcp"/>
  <property name="host" value="<<SERVER_IP>>"/>
  <property name="port" value="<<SERVER_PORT>>"/>
  <property name="textline" value="true"/>
  <property name="sync" value="true"/>
  <property name="minaLogger" value="true"/>
  <property name="filters" ref="minaFilters"/>
</bean>
<bean id="minaFilters" class="java.util.ArrayList">
  <construcutor-arg>
    <list value-type="org.apache.mina.common.IoFilter">
      <ref bean="myFilter">
    </list>
  </constructor-arg>
</bean>
<bean id="myFilter" class="sample.myMinaIoFilter"/>
<camel:camelContext id="camel">
  <camel:route>
    <camel:from uri="timer://testTimer?fixedRate=true&amp;period=10000"/>
    <camel:to ref="minaEndpoint" />
  </camel:route>
</camel:camelContext>
............................

-- 
View this message in context: 
http://old.nabble.com/MINA-as-a-TCP-Client-questions-tp27426504p27440985.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to