I still have several questions about Spring/JMS/Camel/POJO mapping.

Question 1
for example I have Spring config file:

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

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:camel="http://activemq.apache.org/camel/schema/spring";
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd";>

  <camelContext id="camel"
                xmlns="http://activemq.apache.org/camel/schema/spring";>
    <package>org.apache.camel.example.spring</package>

    <!-- define routes -->
 
    <!-- now lets process messages from the queue locally -->
    <route>
      <from uri="jms:Updates"/>
      <to uri="bean:updates"/>
    </route>
  </camelContext>

  <!-- lets configure the default ActiveMQ broker URL -->
  <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory">
      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="tcp://localhost:61616"/>
      </bean>
    </property>
  </bean>

  <bean id="updates" class="Updates"/>

  <camel:template id="camelTemplate"/>

</beans>


i have Updates class:

   public class Updates {
        
        public static void getUpdate(Object body) throws Exception {
            System.out.println("\n
******************************************************* \n");
            System.out.println("Received: " + body.getClass());
            System.out.println("Received: " + body.toString());
            java.lang.Thread.currentThread().sleep(1500);
        }
    }


my problem is that I can not explicitly configure URI for this method
getUpdate only. it works now, but I need several other methods in this class
and I'm not sure that this will work later.

I have tried this one config 
     <route>
      <from uri="jms:Updates"/>
      <to uri="bean:updates:getUpdate"/>
    </route>

and several other options but without success (I get an exception because
spring can not map it)

Just do not know the syntax and can not figure it out at the moment.

Question 2
if I want to add route like this:

<route>
      <from uri="bean:updatesender"/>
      <to uri="jms:Updates"/>
</route>
  <bean id="updatesender" class="UpdateSender"/>

than how should look the send method like? for example: 

public Object sendUpdate()
{
  Properties up = new Properties(); 
  up.setProperty("UpdatedParameter","FIOM:1244");
  return up;
}
also can I declare it as:
public static Object sendUpdate(Object up){return up;}
-- 
View this message in context: 
http://www.nabble.com/Newbie%3A-Mapping-JMS-Camel---Spring-to-POJO%2C-ActiveMQ-Queues-tp21558031s22882p21565368.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to